mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-07-11 14:34:40 +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
1 changed files with 4 additions and 1 deletions
|
|
@ -38,8 +38,11 @@ class DoorCloseActor() extends Actor {
|
||||||
val (doorsToClose2, doorsLeftOpen2) = doorsToClose1.partition(entry => {
|
val (doorsToClose2, doorsLeftOpen2) = doorsToClose1.partition(entry => {
|
||||||
entry.door.Open match {
|
entry.door.Open match {
|
||||||
case Some(player) =>
|
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 =>
|
case None =>
|
||||||
|
// Door should not be open. Mark it to be closed.
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue