Skip to content

Commit

Permalink
wb: fix planned units under fog cannot be selected
Browse files Browse the repository at this point in the history
(cherry-picked from commit aa3a357)
  • Loading branch information
gfgtdf authored and Vultraz committed Oct 7, 2018
1 parent a97b939 commit 8398cd9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/units/unit.cpp
Expand Up @@ -2383,6 +2383,15 @@ bool unit::is_visible_to_team(const team& team, bool const see_all) const
return true;
}

// when the whiteboard planned unit map is applied, it uses moved the _real_ unit so
// underlying_id_.is_fake() will be false and the check above will not apply.
// TODO: improve this check so that is also works for allied planned units but without
// breaking sp campaigns with allies under fog. We probably need an explicit flag
// is_planned_ in unit that is set by the whiteboard.
if(team.side() == side()) {
return true;
}

if(team.fogged(loc)) {
return false;
}
Expand Down

0 comments on commit 8398cd9

Please sign in to comment.