Open FileEX opened 3 days ago
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
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.
I would keep the jetpack on the player.
So how can I solve the desync problem?
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.
https://github.com/multitheftauto/mtasa-blue/blob/97920d83de400e0378f73ea93e87b27cf59dd758/Client/mods/deathmatch/logic/CClientPed.cpp#L5232
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.