mirror of
https://github.com/psforever/PSF-LoginServer.git
synced 2026-01-20 02:54:46 +00:00
Door closing modifications (#255)
* Increase the distance on the door close check to stop doors bouncing open/closed and add a check to make sure the player is alive when holding the door open * Dead players hold doors open, zone is now checked if the player is a backpack instead of the player object itself
This commit is contained in:
parent
5209f9ec21
commit
78eb7906c9
|
|
@ -38,8 +38,11 @@ class DoorCloseActor() extends Actor {
|
|||
val (doorsToClose2, doorsLeftOpen2) = doorsToClose1.partition(entry => {
|
||||
entry.door.Open match {
|
||||
case Some(player) =>
|
||||
Vector3.MagnitudeSquared(entry.door.Position - player.Position) > 15
|
||||
// If the player that opened the door is far enough away, or they're dead / backpacked, close the door
|
||||
var playerIsBackpackInZone = entry.zone.Corpses.contains(player)
|
||||
Vector3.MagnitudeSquared(entry.door.Position - player.Position) > 25.5 || playerIsBackpackInZone
|
||||
case None =>
|
||||
// Door should not be open. Mark it to be closed.
|
||||
true
|
||||
}
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in a new issue