los:: recompute LOS after map changes if necessary

This commit is contained in:
Zeno Rogue committed 2026-08-01 10:34:40 +02:00
1 parent 5da40f8cbc
commit c0875fa9f2
2 files changed
+7

No files matched your search

+3
View File
@@ -430,6 +430,7 @@ EX namespace elec {
drawLightning();
for(int i=2; i<isize(charges); i++) if(charges[i].fire)
affect(charges[i].c);
recompute_los = true;
}
}
@@ -2520,6 +2521,8 @@ EX void livecaves() {
if(hv < 0 && c->wall == waBoat) c->wall = waStrandedBoat;
if(hv < 0 && c->wall == waSea) c->wall = waNone;
}
if(c->wall != old) recompute_los = true;
}
for(int i=0; i<isize(bringlife); i++) {
+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;
}
}