Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: Unexpected behavior with mp_forcerespawn #653

Conversation

FEDERICOMB96
Copy link
Contributor

Basically there is an exploit (or bug?) where depending on mp_forcerespawn if his value is higher to 0 and lower than 1, when you respawn you have a brief window to change your team, if you succesfully manage to change your team between the mp_forcerespawn value and WITHOUT closing the change appearance menu, you won't die due to "m_fNextSuicideTime", that will trigger the change team but without actually changing your skin model, you will keep the enemy one but the team change will success.

Thanks @metita for helping me with this

Basically there is an exploit (or bug?) where depending on mp_forcerespawn if his value is higher to 0 and lower than 1, when you respawn you have a brief window to change your team, if you succesfully manage to change your team between the mp_forcerespawn value and WITHOUT closing the change appearance menu, you won't die due to "m_fNextSuicideTime", that will trigger the change team but without actually changing your skin model, you will keep the enemy one but the team change will success.

Thanks https://github.com/metita for helping me with this

Co-Authored-By: metita <33007491+metita@users.noreply.github.com>
@wopox1337
Copy link
Collaborator

wopox1337 commented Dec 16, 2022

@FEDERICOMB96 @metita I confirm that there is a problem
It was possible to change the command without dying because of m_fNextSuicideTime.

bandicam.2022-11-25.01-51-11-257.mp4

As soon as the suicide was performed, it is spawned, then if you suddenly change the command, ClientKill() will not work, because m_fNextSuicideTime will not allow.

Conclusion:

If ClientKill() was called by GameDLL code (not by the game client, via "kill") - it should work without delay.
Engine (HLDS) calls ClientKill() (pfnClientKill) only in one case - when the player client sends "kill" and only then, here it needs the client's spam protection.

Solution

Everywhere in the ReGameDLL where ClientKill() is called, it is necessary to set m_fNextSuicideTime = 0.0f before calling it.

Thank you for finding the problem.

Copy link
Collaborator

@wopox1337 wopox1337 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wopox1337 wopox1337 changed the title Unexpected behavior with mp_forcerespawn leading to a possible exploit FIX: Unexpected behavior with mp_forcerespawn Dec 17, 2022
@wopox1337 wopox1337 self-assigned this Dec 17, 2022
@wopox1337 wopox1337 merged commit 1c68cb0 into s1lentq:master Dec 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants