mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-07-12 23:14:42 +00:00
Fix implant terminals having disconnected characters permanently occupying seat
This commit is contained in:
parent
d6325d8dfc
commit
cfe2dffa44
1 changed files with 12 additions and 3 deletions
|
|
@ -171,12 +171,21 @@ class WorldSessionActor extends Actor with MDCContextAware {
|
||||||
* @param player_guid the player
|
* @param player_guid the player
|
||||||
*/
|
*/
|
||||||
def DismountVehicleOnLogOut(vehicle_guid : PlanetSideGUID, player_guid : PlanetSideGUID) : Unit = {
|
def DismountVehicleOnLogOut(vehicle_guid : PlanetSideGUID, player_guid : PlanetSideGUID) : Unit = {
|
||||||
val vehicle = continent.GUID(vehicle_guid).get.asInstanceOf[Vehicle]
|
// Use mountable type instead of Vehicle type to ensure mountables such as implant terminals are correctly dismounted on logout
|
||||||
vehicle.Seat(vehicle.PassengerInSeat(player).get).get.Occupant = None
|
val mountable = continent.GUID(vehicle_guid).get.asInstanceOf[Mountable]
|
||||||
|
mountable.Seat(mountable.PassengerInSeat(player).get).get.Occupant = None
|
||||||
|
|
||||||
|
// If this is a player constructed vehicle then start deconstruction timer
|
||||||
|
// todo: Will base guns implement Vehicle type? Don't want those to deconstruct
|
||||||
|
continent.GUID(vehicle_guid) match {
|
||||||
|
case Some(vehicle : Vehicle) =>
|
||||||
if(vehicle.Seats.values.count(_.isOccupied) == 0) {
|
if(vehicle.Seats.values.count(_.isOccupied) == 0) {
|
||||||
vehicleService ! VehicleServiceMessage.DelayedVehicleDeconstruction(vehicle, continent, 600L) //start vehicle decay (10m)
|
vehicleService ! VehicleServiceMessage.DelayedVehicleDeconstruction(vehicle, continent, 600L) //start vehicle decay (10m)
|
||||||
}
|
}
|
||||||
vehicleService ! Service.Leave(Some(s"${vehicle.Actor}"))
|
case _ => ;
|
||||||
|
}
|
||||||
|
|
||||||
|
vehicleService ! Service.Leave(Some(s"${mountable.Actor}"))
|
||||||
vehicleService ! VehicleServiceMessage(continent.Id, VehicleAction.KickPassenger(player_guid, 0, true, vehicle_guid))
|
vehicleService ! VehicleServiceMessage(continent.Id, VehicleAction.KickPassenger(player_guid, 0, true, vehicle_guid))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue