mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-04 07:05:38 +00:00
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:
parent
123551785e
commit
22d5eb4c12
@ -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]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user