don't allow constant zone to count as an adjacent zone for the purposes of closing it, since it will just get re-opened.

This commit is contained in:
Rob Pearce 2024-06-29 08:56:57 +10:00
parent ee7751ffd5
commit 9a6043f72b
1 changed files with 5 additions and 0 deletions

View File

@ -379,6 +379,11 @@ function find_nearby_zones() { # zone_idx filter1 filter2 ... filter is: o
if [[ $conditions == *noaction* && ${zaction[$zi]} != "n/a" ]]; then if [[ $conditions == *noaction* && ${zaction[$zi]} != "n/a" ]]; then
ok=0 ok=0
fi fi
if [[ $conditions == *open* && $constant == ${zname[$zi]} ]]; then
# the constant zone never counts as an adjacent 'open' zone, because
# if we were to close it, it would just get opened again.
ok=0
fi
if [[ $ok -eq 1 ]]; then if [[ $ok -eq 1 ]]; then
nearbyzones="$nearbyzones $thisone" nearbyzones="$nearbyzones $thisone"
fi fi