mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-07-14 07:55:07 +00:00
Merge pull request #683 from Mazo/vehicle-contents-fix
Fix vehicle inventory unloading on mounting
This commit is contained in:
commit
bde51e9e44
2 changed files with 10 additions and 7 deletions
|
|
@ -119,10 +119,7 @@ object MiddlewareActor {
|
||||||
packet.isInstanceOf[CharacterInfoMessage]
|
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 = {
|
def keepAliveMessageGuard(packet: PlanetSidePacket): Boolean = {
|
||||||
packet.isInstanceOf[KeepAliveMessage]
|
packet.isInstanceOf[KeepAliveMessage]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3729,7 +3729,9 @@ class SessionActor(middlewareActor: typed.ActorRef[MiddlewareActor.Command], con
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
accessedContainer match {
|
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 (
|
if (
|
||||||
isMoving || veh.isMoving(1) || Vector3.DistanceSquared(
|
isMoving || veh.isMoving(1) || Vector3.DistanceSquared(
|
||||||
player.Position,
|
player.Position,
|
||||||
|
|
@ -3742,7 +3744,7 @@ class SessionActor(middlewareActor: typed.ActorRef[MiddlewareActor.Command], con
|
||||||
UnaccessContainer(veh)
|
UnaccessContainer(veh)
|
||||||
}
|
}
|
||||||
case Some(container) => //just in case
|
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
|
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 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) {
|
if (container.HasGUID) {
|
||||||
|
|
@ -4978,7 +4980,11 @@ class SessionActor(middlewareActor: typed.ActorRef[MiddlewareActor.Command], con
|
||||||
TryDisposeOfLootedCorpse(obj)
|
TryDisposeOfLootedCorpse(obj)
|
||||||
|
|
||||||
case Some(obj: Container) =>
|
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 _ => ;
|
case _ => ;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue