mirror of
https://github.com/psforever/PSF-LoginServer.git
synced 2026-07-15 16:34:42 +00:00
removed the separation for vehicles with custom wreckage from vehicles with typical zero health wreckage because the former was causing loading and crashes (#1362)
This commit is contained in:
parent
5d28fe54cf
commit
927c062a5a
1 changed files with 24 additions and 35 deletions
|
|
@ -35,7 +35,7 @@ import net.psforever.objects.avatar.Avatar
|
||||||
import net.psforever.objects.avatar.{Award, AwardCategory, PlayerControl, Shortcut => AvatarShortcut}
|
import net.psforever.objects.avatar.{Award, AwardCategory, PlayerControl, Shortcut => AvatarShortcut}
|
||||||
import net.psforever.objects.ce.{Deployable, DeployableCategory, DeployedItem, TelepadLike}
|
import net.psforever.objects.ce.{Deployable, DeployableCategory, DeployedItem, TelepadLike}
|
||||||
import net.psforever.objects.definition.SpecialExoSuitDefinition
|
import net.psforever.objects.definition.SpecialExoSuitDefinition
|
||||||
import net.psforever.objects.definition.converter.{CorpseConverter, DestroyedVehicleConverter}
|
import net.psforever.objects.definition.converter.CorpseConverter
|
||||||
import net.psforever.objects.equipment.JammableUnit
|
import net.psforever.objects.equipment.JammableUnit
|
||||||
import net.psforever.objects.guid.{GUIDTask, StraightforwardTask, TaskBundle, TaskWorkflow}
|
import net.psforever.objects.guid.{GUIDTask, StraightforwardTask, TaskBundle, TaskWorkflow}
|
||||||
import net.psforever.objects.serverobject.affinity.FactionAffinity
|
import net.psforever.objects.serverobject.affinity.FactionAffinity
|
||||||
|
|
@ -354,31 +354,30 @@ class ZoningOperations(
|
||||||
spawn.DepictPlayerAsCorpse
|
spawn.DepictPlayerAsCorpse
|
||||||
}
|
}
|
||||||
//load vehicles in zone (put separate the one we may be using)
|
//load vehicles in zone (put separate the one we may be using)
|
||||||
val (wreckages, (vehicles, usedVehicle)) = {
|
val allActiveVehicles = continent.Vehicles
|
||||||
val (a, b) = continent.Vehicles.partition(vehicle => {
|
val (vehicles, usedVehicle) = {
|
||||||
vehicle.Destroyed && vehicle.Definition.DestroyedModel.nonEmpty
|
continent.GUID(player.VehicleSeated) match {
|
||||||
})
|
case Some(ourVehicle: Vehicle) if ourVehicle.PassengerInSeat(player).isDefined =>
|
||||||
(
|
val vehicleGuid = ourVehicle.GUID
|
||||||
a,
|
allActiveVehicles.indexWhere(_.GUID == vehicleGuid) match {
|
||||||
continent.GUID(player.VehicleSeated) match {
|
case -1 =>
|
||||||
case Some(vehicle: Vehicle) if vehicle.PassengerInSeat(player).isDefined =>
|
//todo our vehicle is missing from the list of vehicles; what now?
|
||||||
b.partition {
|
(allActiveVehicles, List.empty[Vehicle])
|
||||||
_.GUID != vehicle.GUID
|
case index =>
|
||||||
}
|
(allActiveVehicles.take(index) ++ allActiveVehicles.drop(index + 1), List(ourVehicle))
|
||||||
case Some(_) =>
|
}
|
||||||
log.warn(
|
case Some(_) =>
|
||||||
s"BeginZoningMessage: ${player.Name} thought ${player.Sex.pronounSubject} was sitting in a vehicle, but it just evaporated around ${player.Sex.pronounObject}"
|
log.warn(
|
||||||
)
|
s"BeginZoningMessage: ${player.Name} thought ${player.Sex.pronounSubject} was sitting in a vehicle, but it just evaporated around ${player.Sex.pronounObject}"
|
||||||
player.VehicleSeated = None
|
)
|
||||||
(b, List.empty[Vehicle])
|
player.VehicleSeated = None
|
||||||
case None =>
|
(allActiveVehicles, List.empty[Vehicle])
|
||||||
player.VehicleSeated = None
|
case None =>
|
||||||
(b, List.empty[Vehicle])
|
player.VehicleSeated = None
|
||||||
}
|
(allActiveVehicles, List.empty[Vehicle])
|
||||||
)
|
}
|
||||||
}
|
}
|
||||||
val allActiveVehicles = vehicles ++ usedVehicle
|
//active vehicles (and wreckage)
|
||||||
//active vehicles (and some wreckage)
|
|
||||||
vehicles.foreach { vehicle =>
|
vehicles.foreach { vehicle =>
|
||||||
val vguid = vehicle.GUID
|
val vguid = vehicle.GUID
|
||||||
sendResponse(OCM.apply(vehicle))
|
sendResponse(OCM.apply(vehicle))
|
||||||
|
|
@ -442,16 +441,6 @@ class ZoningOperations(
|
||||||
sendResponse(PlanetsideAttributeMessage(vguid, vehicle.Definition.shieldUiAttribute, vehicle.Shields))
|
sendResponse(PlanetsideAttributeMessage(vguid, vehicle.Definition.shieldUiAttribute, vehicle.Shields))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//vehicle wreckages
|
|
||||||
wreckages.foreach { vehicle =>
|
|
||||||
sendResponse(
|
|
||||||
ObjectCreateMessage(
|
|
||||||
vehicle.Definition.DestroyedModel.get.id,
|
|
||||||
vehicle.GUID,
|
|
||||||
DestroyedVehicleConverter.converter.ConstructorData(vehicle).get
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
//cargo occupants (including our own vehicle as cargo)
|
//cargo occupants (including our own vehicle as cargo)
|
||||||
allActiveVehicles.collect {
|
allActiveVehicles.collect {
|
||||||
case vehicle if vehicle.CargoHolds.nonEmpty =>
|
case vehicle if vehicle.CargoHolds.nonEmpty =>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue