multitheftauto / mtasa-blue

Multi Theft Auto is a game engine that incorporates an extendable network play element into a proprietary commercial single-player game.
https://multitheftauto.com
GNU General Public License v3.0
1.41k stars 436 forks source link

Vehicle entry bug in skimmer/seasparrow/leviathan etc #393

Open ArranTuna opened 6 years ago

ArranTuna commented 6 years ago

Describe the bug @Cazomino05 reported:

Vehicle entry in these vehicles, when your player is on land, causes problems like your player getting stuck in water.

When this happens you're also unable to attempt to re-enter this vehicle, or any vehicle for that matter until you go to land at which point you receive the network trouble message and get warped back to the vehicle.

To Reproduce Steps to reproduce the behavior: STEPS NEEDED

Expected behavior It should not bug out

Additional context

@Cazomino05 said:

I've reverted back to vehicle warping at the moment but ideally we should not need it as it would require warping to support jacking and is visually not as good.to re-enable vehicle entry without warping just comment out the linebWarpIn = true;in CGame.cpp in the server deathmatch solution.

From https://bugs.mtasa.com/view.php?id=4246

qaisjp commented 6 years ago

Remp said:

This happens with all vehicles. If you try to enter a vehicle as passenger then fall into water you will be unable to jump, when you reach land you will get the network trouble message, be warped back and everything will work normally again

This is especially prevalent with helicopters in the heligrab resource and is a real pain, often requiring /kill or reconnect (or admin intervention) if no land is nearby

See http://remp.sparksptpm.co.uk/mta/vehicle_enter_jump.mp4 for a video of it happening with a car, reproducable every time (notice in the chat i try to enter the vehicle as i fall past it ("vehicle start enter"))

botder commented 3 years ago

In the game code, in CPlayerInfo::Process, there is an inlined call to CTaskSimpleSwim::SetPlayerSwimToTarget before the primary task, to enter a car, is created. Removing the warp-in from server in CGame::Packet_Vehicle_InOut and then setting the swim target position to the vehicle door position didn't work for me (didn't investigate the reasons for this).