Fix another short-circuit evaluation:

When clearing shroud and fog, be sure to clear both, don't stop after the first
This fix a small latency of the clearing of some fogged corner in shroud during
a unit move (no effect on gameplay, the fog was removed at the end of the move
but probably cleaner if some sighted event interrupt the move)
This commit is contained in:
Ali El Gariani 2007-12-12 10:47:31 +00:00
parent 123551785e
commit 22d5eb4c12

View file

@ -1806,13 +1806,13 @@ bool clear_shroud_loc(const gamemap& map, team& tm,
gamemap::location adj[7];
get_adjacent_tiles(loc,adj);
adj[6] = loc;
bool on_board_loc = map.on_board(loc);
for(int i = 0; i != 7; ++i) {
// We clear one past the edge of the board, so that the half-hexes
// at the edge can also be cleared of fog/shroud.
if(map.on_board(adj[i]) || map.on_board(loc)) {
const bool res = tm.clear_shroud(adj[i]) ||
tm.clear_fog(adj[i]);
if (on_board_loc || map.on_board(adj[i])) {
const bool res = tm.clear_shroud(adj[i]) | tm.clear_fog(adj[i]);
if(res && cleared != NULL) {
cleared->push_back(adj[i]);