los:: recompute LOS after map changes if necessary

This commit is contained in:
Zeno Rogue
2026-08-01 10:34:40 +02:00
parent 5da40f8cbc
commit c0875fa9f2
2 changed files with 7 additions and 0 deletions
+4
View File
@@ -912,6 +912,8 @@ EX void monstersTurn() {
for(cell *pc: player_positions())
history::movehistory.push_back(pc);
#endif
if(recompute_los) create_los();
}
/** check if whirlline is looped, if yes, remove the repeat; may not detect loops immediately */
@@ -945,6 +947,7 @@ enum class los { none, geodesic, geometric };
EX los lineofsight;
/** when did we switch the lineofsight mode */
EX int lineofsightAt;
EX bool recompute_los = false;
EX map<cell*, int> current_fov; // 1 == seen, 2 = see through
@@ -1013,6 +1016,7 @@ EX void create_los() {
}
}
}
recompute_los = false;
}
}