Partial fix for bug #10831,

works properly if the code is clearing the shroud, still fails if a
unit moves near the border.
This commit is contained in:
Mark de Wever 2008-02-04 19:16:17 +00:00
parent e224a594b4
commit 4af9f37759

View File

@ -1843,7 +1843,7 @@ bool clear_shroud_loc(const gamemap& map, team& tm,
// 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 (on_board_loc || map.on_board(adj[i])) {
if (on_board_loc || map.on_board(adj[i], true)) {
// Both functions should be executed so don't use || which
// uses short-cut evaluation.
const bool res = tm.clear_shroud(adj[i]) | tm.clear_fog(adj[i]);
@ -1859,7 +1859,7 @@ bool clear_shroud_loc(const gamemap& map, team& tm,
return result;
}
//! Returns true iff some shroud is cleared.
//! Returns true if some shroud is cleared.
//! seen_units will return new units that have been seen by this unit.
//! If known_units is NULL, seen_units can be NULL and will not be changed.
bool clear_shroud_unit(const gamemap& map,
@ -1890,7 +1890,7 @@ bool clear_shroud_unit(const gamemap& map,
if(sighted != units.end() &&
(sighted->second.invisible(*it,units,teams) == false
|| teams[team].is_enemy(sighted->second.side()) == false)) {
//check if we know this unit, but we always know oursefl
//check if we know this unit, but we always know ourself
//just in case we managed to move on a fogged hex (teleport)
if(!(seen_units == NULL || known_units == NULL)
&& known_units->count(*it) == 0 && *it != loc) {