mirror of
https://github.com/psforever/PSF-LoginServer.git
synced 2026-02-23 00:23:40 +00:00
Automatically despawn vehicles capable of flight if the driver bails out as a temporary fix for aircraft floating in the air with no pilot
This commit is contained in:
parent
6f65603942
commit
def736194c
1 changed files with 8 additions and 0 deletions
|
|
@ -2448,6 +2448,14 @@ class WorldSessionActor extends Actor with MDCContextAware {
|
|||
obj.PassengerInSeat(player) match {
|
||||
case Some(seat_num : Int) =>
|
||||
obj.Actor ! Mountable.TryDismount(player, seat_num)
|
||||
|
||||
// Deconstruct the vehicle if the driver has bailed out and the vehicle is capable of flight
|
||||
//todo: implement auto landing procedure if the pilot bails but passengers are still present instead of deconstructing the vehicle
|
||||
//todo: continue flight path until aircraft crashes if no passengers present (or no passenger seats), then deconstruct.
|
||||
if(bailType == BailType.Bailed && seat_num == 0 && GlobalDefinitions.isFlightVehicle(obj.asInstanceOf[Vehicle].Definition)) {
|
||||
vehicleService ! VehicleServiceMessage.DelayedVehicleDeconstruction(obj.asInstanceOf[Vehicle], continent, 0L) // Immediately deconstruct vehicle
|
||||
}
|
||||
|
||||
case None =>
|
||||
dismountWarning(s"DismountVehicleMsg: can not find where player $player_guid is seated in mountable $obj_guid")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue