Vehicle weapons - if player dies but vehicle does not, some the usual exit functionality doesn't happen

Issue #160 resolved
Matt Hands created an issue

Player exit from VW position calls KDriverLeft() on the server, which calls DriverLeft(), which calls DrivingStatusChanged(), wchich then gets triggered on all net modes.

But if player dies & vehicle does not, DriverDied(), which is the equivalent to KDriverLeave, does not call DriverLeft & DrivingStatusChanged isn't called.

As a result, vital exit-related functionality may not happen if player is killed in a VW.

Comments (2)

  1. Matt Hands reporter

    Looks like this is a known UT2004 bug that was subsequently fixed in a UT 2004 patch, which came after UT2004 build that RO is based on.

    It is fixed for vehicles themselves in ROVehicle.DriverLeft(), with the comment "Incorporated from 3369 UT2004 patch. Should fix DriverLeft not getting called when the driver dies but the vehicle doesn't".

    The fix is simply for DriverDied() to call DriverLeft() at the end, which is what KDriverLeave() does.

    I'll just add the same to VehicleWeaponPawns.

    There is a certain amount of code repeated between KDriverLeave() and DriverDied(). Ideally all common code would be moved into DriverLeft() to avoid unnecessary repetition and to make it easier to maintain that exit code by only having it in one place.

  2. Log in to comment