-
-
Notifications
You must be signed in to change notification settings - Fork 446
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 #539 Changing player position when he/she has a jetpack will remove the jetpack and bug when skin is changed #3511
base: master
Are you sure you want to change the base?
Conversation
Good stuff |
The code looks fine, but I don't think we want to introduce desync (new client sees jetpack, older clients do not) right now |
Will simply taking a jetpack when changing positions solve the problem? |
I would keep the jetpack on the player. |
@botder I think I solved the desync problem by sending a GIVE_PED_JETPACK packet. So now it is no longer bakcwards-incompatible |
"Changing player position when he/she has a jetpack will remove the jetpack and bug when skin is changed" If you set the Video: https://youtu.be/BLVGxOA0NIY |
Yeah, this happens because if the warp argument is set to false, only the position vector in the matrix/transform of the given entity is changed. However, when warp is true, a GTA function is called, specifically |
Fixed #539
Jetpack is removed because the GTA function that is called
CPed::Teleport
aborts all tasks (including jetpack).Then when changing the skin, the jetpack is set based on the m_bHasJetPack variable, which is true because its state is not changed when the position is changed, therefore the new skin gets the jetpack that was removed by GTA, but the MTA still knows that the player has the jetpack because he doesn't know that GTA removed it.
mtasa-blue/Client/mods/deathmatch/logic/CClientPed.cpp
Line 5232 in 97920d8
Therefore, we first check whether the player has a jetpack before changing position, and then set it after changing position depending on whether he had it before.