mirror of
https://github.com/psforever/PSF-LoginServer.git
synced 2026-01-20 02:54:46 +00:00
Merge pull request #683 from Mazo/vehicle-contents-fix
Fix vehicle inventory unloading on mounting
This commit is contained in:
commit
bde51e9e44
|
|
@ -119,10 +119,7 @@ object MiddlewareActor {
|
|||
packet.isInstanceOf[CharacterInfoMessage]
|
||||
}
|
||||
|
||||
/**
|
||||
* `KeepAliveMessage` packets are bundled by themselves.
|
||||
* They're special.
|
||||
*/
|
||||
/** `KeepAliveMessage` packets are bundled by themselves. They're special. */
|
||||
def keepAliveMessageGuard(packet: PlanetSidePacket): Boolean = {
|
||||
packet.isInstanceOf[KeepAliveMessage]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3729,7 +3729,9 @@ class SessionActor(middlewareActor: typed.ActorRef[MiddlewareActor.Command], con
|
|||
}
|
||||
}
|
||||
accessedContainer match {
|
||||
case Some(veh: Vehicle) =>
|
||||
// Ensure we don't unload the contents of the vehicle trunk for players seated in the vehicle.
|
||||
// This can happen if PSUM arrives during the mounting process
|
||||
case Some(veh: Vehicle) if player.VehicleSeated.isEmpty || player.VehicleSeated.get != veh.GUID =>
|
||||
if (
|
||||
isMoving || veh.isMoving(1) || Vector3.DistanceSquared(
|
||||
player.Position,
|
||||
|
|
@ -3742,7 +3744,7 @@ class SessionActor(middlewareActor: typed.ActorRef[MiddlewareActor.Command], con
|
|||
UnaccessContainer(veh)
|
||||
}
|
||||
case Some(container) => //just in case
|
||||
if (isMovingPlus) {
|
||||
if (isMovingPlus && (player.VehicleSeated.isEmpty || player.VehicleSeated.get != container.GUID)) { // Ensure we don't close the container if the player is seated in it
|
||||
val guid = player.GUID
|
||||
// If the container is a corpse and gets removed just as this runs it can cause a client disconnect, so we'll check the container has a GUID first.
|
||||
if (container.HasGUID) {
|
||||
|
|
@ -4978,7 +4980,11 @@ class SessionActor(middlewareActor: typed.ActorRef[MiddlewareActor.Command], con
|
|||
TryDisposeOfLootedCorpse(obj)
|
||||
|
||||
case Some(obj: Container) =>
|
||||
UnaccessContainer(obj)
|
||||
// Make sure we don't unload the contents of the vehicle the player is seated in
|
||||
// An example scenario of this would be closing the trunk contents when rearming at a landing pad
|
||||
if (player.VehicleSeated.isEmpty || player.VehicleSeated.get != obj.GUID) {
|
||||
UnaccessContainer(obj)
|
||||
}
|
||||
|
||||
case _ => ;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue