Fix #2335: Don't allow dead peds to enter vehicles #2344
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#1907 allowed dead peds to send entry/exit packets, because this is necessary to fix #908
This PR fixes #2335 by not allowing a dead ped to enter a vehicle (serverside).
But why is this clientside check in
CClientPed::EnterVehiclenot preventing a dead ped from sending a packet?mtasa-blue/Client/mods/deathmatch/logic/CClientPed.cpp
Lines 6456 to 6459 in 2aa3c38
Because in
CClientPed::IsDeadwhen the ped is streamed it queries gta for TASK_SIMPLE_DEAD instead of returning m_bDead, and the task probably isn't initiated yet before the next frame (and it processed the player wasted packet fromkillPedand entity destroy packet fromdestroyElementin the same frame, so whenCClientGame::DoVehicleInKeyCheck()is pulsed afterwards the player appears to be alive and outside a vehicle for that 1 frame).