mirror of
https://github.com/psforever/PSF-LoginServer.git
synced 2026-02-25 09:33:39 +00:00
rebased to master/v-spawn-pad-redo; added ams spawn refresh when vehicle is deconstructed
This commit is contained in:
parent
e00202e8fb
commit
552206974e
2 changed files with 16 additions and 5 deletions
|
|
@ -1300,7 +1300,7 @@ class WorldSessionActor extends Actor with MDCContextAware {
|
|||
else {
|
||||
Vector3(0, 0, (z - 90) % 360)
|
||||
}
|
||||
pos = if(x >= 330) {
|
||||
pos = if(x >= 330) { //leaning to the left
|
||||
pos + Vector3(0, 0, xsin)
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
package services.vehicle.support
|
||||
|
||||
import akka.actor.{Actor, ActorRef, Cancellable}
|
||||
import net.psforever.objects.{DefaultCancellable, Vehicle}
|
||||
import net.psforever.objects.{DefaultCancellable, GlobalDefinitions, Vehicle}
|
||||
import net.psforever.objects.guid.TaskResolver
|
||||
import net.psforever.objects.vehicles.Seat
|
||||
import net.psforever.objects.zones.Zone
|
||||
|
|
@ -96,9 +96,20 @@ class DeconstructionActor extends Actor {
|
|||
heapEmptyProcess.cancel
|
||||
val now : Long = System.nanoTime
|
||||
val (vehiclesToScrap, vehiclesRemain) = PartitionEntries(vehicles, now)
|
||||
vehicles = vehiclesRemain //entries from original list before partition
|
||||
vehicles = vehiclesRemain
|
||||
vehicleScrapHeap = vehicleScrapHeap ++ vehiclesToScrap //may include existing entries
|
||||
vehiclesToScrap.foreach { RetirementTask }
|
||||
vehiclesToScrap.foreach(entry => {
|
||||
val vehicle = entry.vehicle
|
||||
val zone = entry.zone
|
||||
RetirementTask(entry)
|
||||
if(vehicle.Definition == GlobalDefinitions.ams) {
|
||||
import net.psforever.types.DriveState
|
||||
vehicle.DeploymentState = DriveState.Mobile //internally undeployed //TODO this should be temporary?
|
||||
context.parent ! VehicleServiceMessage.AMSDeploymentChange(zone)
|
||||
}
|
||||
taskResolver ! DeconstructionTask(vehicle, zone)
|
||||
})
|
||||
|
||||
if(vehiclesRemain.nonEmpty) {
|
||||
val short_timeout : FiniteDuration = math.max(1, DeconstructionActor.timeout_time - (now - vehiclesRemain.head.time)) nanoseconds
|
||||
import scala.concurrent.ExecutionContext.Implicits.global
|
||||
|
|
@ -128,6 +139,7 @@ class DeconstructionActor extends Actor {
|
|||
def RetirementTask(entry : DeconstructionActor.VehicleEntry) : Unit = {
|
||||
val vehicle = entry.vehicle
|
||||
val zone = entry.zone
|
||||
vehicle.Position = Vector3.Zero //somewhere it will not disturb anything
|
||||
zone.Transport ! Zone.Vehicle.Despawn(vehicle)
|
||||
context.parent ! DeconstructionActor.DeleteVehicle(vehicle.GUID, zone.Id) //call up to the main event system
|
||||
}
|
||||
|
|
@ -135,7 +147,6 @@ class DeconstructionActor extends Actor {
|
|||
def DestructionTask(entry : DeconstructionActor.VehicleEntry) : Unit = {
|
||||
val vehicle = entry.vehicle
|
||||
val zone = entry.zone
|
||||
vehicle.Position = Vector3.Zero //somewhere it will not disturb anything
|
||||
taskResolver ! DeconstructionTask(vehicle, zone)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue