mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-03-03 12:10:22 +00:00
Spawn Pad Fix (#394)
* reset pad order queueing system if the player forces a system fix; blocking dismounting of vehicle in certain situations, such as the vehicle just being spawned * test fixes
This commit is contained in:
parent
9f12cfa625
commit
4e5bb3a252
7 changed files with 62 additions and 38 deletions
|
|
@ -112,6 +112,8 @@ class VehicleSpawnControl(pad : VehicleSpawnPad) extends VehicleSpawnControlBase
|
|||
case None => ;
|
||||
}
|
||||
trackedOrder = None
|
||||
handleOrderFunc = NewTasking
|
||||
pad.Zone.VehicleEvents ! VehicleSpawnPad.ResetSpawnPad(pad) //cautious animation reset
|
||||
concealPlayer ! akka.actor.Kill //should cause the actor to restart, which will abort any trapped messages
|
||||
|
||||
case _ => ;
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ class VehicleSpawnControlConcealPlayer(pad : VehicleSpawnPad) extends VehicleSpa
|
|||
def receive : Receive = {
|
||||
case order @ VehicleSpawnControl.Order(driver, _) =>
|
||||
//TODO how far can the driver stray from the Terminal before his order is cancelled?
|
||||
if(driver.Continent == pad.Continent && driver.VehicleSeated.isEmpty) {
|
||||
if(driver.Continent == pad.Continent && driver.VehicleSeated.isEmpty && driver.isAlive) {
|
||||
trace(s"hiding ${driver.Name}")
|
||||
pad.Zone.VehicleEvents ! VehicleSpawnPad.ConcealPlayer(driver.GUID)
|
||||
context.system.scheduler.scheduleOnce(2000 milliseconds, loadVehicle, order)
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ class VehicleSpawnControlDriverControl(pad : VehicleSpawnPad) extends VehicleSpa
|
|||
else {
|
||||
trace(s"${driver.Name} is not seated in ${vehicle.Definition.Name}; vehicle controls might have been locked")
|
||||
}
|
||||
vehicle.MountedIn = None
|
||||
finalClear ! order
|
||||
|
||||
case msg @ (VehicleSpawnControl.ProcessControl.Reminder | VehicleSpawnControl.ProcessControl.GetNewOrder) =>
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ class VehicleSpawnControlLoadVehicle(pad : VehicleSpawnPad) extends VehicleSpawn
|
|||
|
||||
def receive : Receive = {
|
||||
case order @ VehicleSpawnControl.Order(driver, vehicle) =>
|
||||
if(driver.Continent == pad.Continent && vehicle.Health > 0) {
|
||||
if(driver.Continent == pad.Continent && vehicle.Health > 0 && driver.isAlive) {
|
||||
trace(s"loading the ${vehicle.Definition.Name}")
|
||||
vehicle.Position = vehicle.Position - Vector3.z(if(GlobalDefinitions.isFlightVehicle(vehicle.Definition)) 9 else 5) //appear below the trench and doors
|
||||
vehicle.Cloaked = vehicle.Definition.CanCloak && driver.Cloaked
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ class VehicleSpawnControlRailJack(pad : VehicleSpawnPad) extends VehicleSpawnCon
|
|||
|
||||
def receive : Receive = {
|
||||
case order @ VehicleSpawnControl.Order(_, vehicle) =>
|
||||
vehicle.MountedIn = pad.GUID
|
||||
pad.Zone.VehicleEvents ! VehicleSpawnPad.AttachToRails(vehicle, pad)
|
||||
context.system.scheduler.scheduleOnce(10 milliseconds, seatDriver, order)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue