Open ArranTuna opened 6 years ago
This issue just screwed me over for hours, because I thought I broke something.
Therefore I think adding the same condition (CResource::HasStarted) to warpPedIntoVehicle plus a short warning message would be the most sensible way (ofc only if nobody finds a short(er) solution).
I think this is a good solution. Nobody wants network trouble and a frozen game.
- The following snippet from
CStaticFunctionDefinitions::CreateVehicle(server)
causes the vehicle to only spawn immediately if the resource has already been started:
But isn't onResourceStart
called after resource is fully started? If not, why not?
It's not started on the client at that point. onResourceStart
is called before the resource is broadcast to clients, probably because it's cancellable.
So we just need to add this check, and a warning like the issue poster suggests
if (pResource->IsClientSynced())
This issue was created by @Jusonex
Describe the bug
The code posted below leads to a network trouble. I did not test it completely, but I guess the desync is caused as follows:
The following snippet from
CStaticFunctionDefinitions::CreateVehicle(server)
causes the vehicle to only spawn immediately if the resource has already been started:warpPedIntoVehicle warps the player into the vehicle that exists on the server, but not yet on the client. This causes a desync and therefore network trouble
I think a fix would require pretty much effort (i.e. queueing), but this situation happens practically never (probably mainly for debugging purposes). Therefore I think adding the same condition (
CResource::HasStarted
) towarpPedIntoVehicle
plus a short warning message would be the most sensible way (ofc only if nobody finds a short(er) solution).To Reproduce
Expected behavior No desync.
MTA Client (please complete the following information): 1.5.5-release-13192
MTA Server (please complete the following information): 1.5.5-release-13192
Additional context From https://bugs.mtasa.com/view.php?id=7855