mirror of
https://github.com/psforever/PSF-LoginServer.git
synced 2026-04-29 08:15:29 +00:00
Fix Players getting unmounted but still appearing to be inside a Mountable
This commit is contained in:
parent
b5f15cd3d4
commit
e29f4e310b
2 changed files with 26 additions and 10 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
// Copyright (c) 2021 PSForever
|
// Copyright (c) 2021 PSForever
|
||||||
package net.psforever.objects.serverobject.mount
|
package net.psforever.objects.serverobject.mount
|
||||||
|
|
||||||
|
import net.psforever.objects.Player
|
||||||
import net.psforever.types.BailType
|
import net.psforever.types.BailType
|
||||||
|
|
||||||
trait MountableSpace[A <: MountableEntity] {
|
trait MountableSpace[A <: MountableEntity] {
|
||||||
|
|
@ -92,6 +93,10 @@ trait MountableSpace[A <: MountableEntity] {
|
||||||
case Some(p) if testToUnmount(p) =>
|
case Some(p) if testToUnmount(p) =>
|
||||||
_occupant = None
|
_occupant = None
|
||||||
p.BailProtection = bailable && (bailType == BailType.Bailed || bailType == BailType.Kicked)
|
p.BailProtection = bailable && (bailType == BailType.Bailed || bailType == BailType.Kicked)
|
||||||
|
p match {
|
||||||
|
case player: Player =>
|
||||||
|
player.VehicleSeated = None
|
||||||
|
}
|
||||||
None
|
None
|
||||||
case _ =>
|
case _ =>
|
||||||
occupant
|
occupant
|
||||||
|
|
|
||||||
|
|
@ -18,16 +18,27 @@ trait CaptureTerminalAwareBehavior {
|
||||||
case true => ; // CC is resecured
|
case true => ; // CC is resecured
|
||||||
case false => // CC is hacked
|
case false => // CC is hacked
|
||||||
// Remove seated occupants for mountables
|
// Remove seated occupants for mountables
|
||||||
if (CaptureTerminalAwareObject.isInstanceOf[Mountable]) {
|
CaptureTerminalAwareObject match {
|
||||||
CaptureTerminalAwareObject.asInstanceOf[Mountable].Seats.filter(x => x._2.isOccupied).foreach(x => {
|
case mountable: Mountable =>
|
||||||
val (seat_num, seat) = x
|
|
||||||
val user = seat.occupant.get
|
val guid = mountable.GUID
|
||||||
CaptureTerminalAwareObject.Zone.VehicleEvents ! VehicleServiceMessage(
|
val zone = mountable.Zone
|
||||||
CaptureTerminalAwareObject.Zone.id,
|
val zoneId = zone.id
|
||||||
VehicleAction.KickPassenger(user.GUID, seat_num, true, CaptureTerminalAwareObject.GUID)
|
val events = zone.VehicleEvents
|
||||||
)
|
|
||||||
seat.unmount(user)
|
mountable.Seats.values.zipWithIndex.foreach {
|
||||||
})
|
case (seat, seat_num) =>
|
||||||
|
seat.occupant match {
|
||||||
|
case Some(player) =>
|
||||||
|
seat.unmount(player)
|
||||||
|
player.VehicleSeated = None
|
||||||
|
if (player.HasGUID) {
|
||||||
|
events ! VehicleServiceMessage(zoneId, VehicleAction.KickPassenger(player.GUID, seat_num, true, guid))
|
||||||
|
}
|
||||||
|
case None => ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case _ =>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue