Deploying into a moving spawn vehicle dumps player out of vehicle if driver's seat is taken

Issue #369 resolved
Matt Hands created an issue

This applies to truly mobile, MDV-style spawn vehicles, set to SVT_Always. If vehicle has a driver, the deploying player spawns at a vehicle exit position, not actually in the vehicle. If vehicle is moving, the deploying player gets dumped out of the back and sees the vehicle drive off.

Comments (2)

  1. Matt Hands reporter

    Problem is caused by use of TryToDrive() function in DHSpawnManager.SpawnPlayerAtSpawnVehicle() function. TryToDrive() returns false if the vehicle has a driver.

    When a player gets into a vehicle normally, the FindEntryVehicle() function is called, which tries to find a valid, empty vehicle position. If the vehicle has a driver, it tries the weapon pawn slots. It's a helper function for TryToDrive(), as it finds a suitable Vehicle/VehicleWeaponPawn for call TryToDrive() on.

    Can't simply use FindEntryVehicle() in SpawnPlayerAtSpawnVehicle(), as it includes an entry radius check, which fails because the deploying player pawn at this stage still a long way from the vehicle. But can use similar functionality in DHSpawnManager before calling TryToDrive().

    At Basnett's request, will write it so it ignores the driver's slots, the idea being to discourage players deploying into a spawn vehicle from immediately starting to drive it somewhere else. Also aiming to try rider positions before genuine weapon slots, so deploying players are probably mostly shielded initially.

    Testing stuff now, so probably committed before the weekend.

  2. Matt Hands reporter

    Fixed in commit 1fab7b3.

    Added FindEntryVehicle() function to DHSpawnManager and use it to find a valid, empty VehicleWeaponPawn to call TryToDrive() on. Ignores the driver's slot completely & prioritises rider positions before genuine weapon slots.

    As is so typical, solving this bug so that players are able to deploy into passenger or MG slots, now reveals major camera bugs when deploying into replicating VehicleWeaponPawns ! But that's a separate issue, so am closing this one down as complete (the other problem is solved and I will commit separately).

  3. Log in to comment