split air and reduce time

This commit is contained in:
ScrawnyRonnie 2023-11-16 22:43:44 -05:00 committed by GitHub
parent 03ed518f07
commit 26046580b2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -128,13 +128,21 @@ class VehicleControl(vehicle: Vehicle)
mountBehavior.apply(msg)
mountCleanup(mount_point, player)
// For Issue 1133. Todo: There may be a better way to address the issue?
case Mountable.TryDismount(user, seat_num, _) if (vehicle.History.find { entry => entry.isInstanceOf[SpawningActivity] } match {
case Some(entry) if System.currentTimeMillis() - entry.time < 8500L => true
// Issue 1133. Todo: There may be a better way to address the issue?
case Mountable.TryDismount(user, seat_num, _) if GlobalDefinitions.isFlightVehicle(vehicle.Definition) &&
(vehicle.History.find { entry => entry.isInstanceOf[SpawningActivity] } match {
case Some(entry) if System.currentTimeMillis() - entry.time < 3000L => true
case _ => false
}) =>
sender() ! Mountable.MountMessages(user, Mountable.CanNotDismount(vehicle, seat_num))
case Mountable.TryDismount(user, seat_num, _) if !GlobalDefinitions.isFlightVehicle(vehicle.Definition) &&
(vehicle.History.find { entry => entry.isInstanceOf[SpawningActivity] } match {
case Some(entry) if System.currentTimeMillis() - entry.time < 8500L => true
case _ => false
}) =>
sender() ! Mountable.MountMessages(user, Mountable.CanNotDismount(vehicle, seat_num))
case msg @ Mountable.TryDismount(_, seat_num, _) =>
dismountBehavior.apply(msg)
dismountCleanup(seat_num)