Skip to content

Commit

Permalink
use a cheaper version of get_visible_unit when we only want bool
Browse files Browse the repository at this point in the history
In src/actions/create, move
  • Loading branch information
cbeck88 committed Jun 17, 2014
1 parent 05d2fdf commit 1aed8cb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/actions/create.cpp
Expand Up @@ -324,7 +324,7 @@ bool can_recruit_on(const map_location& leader_loc, const map_location& recruit_
if ( view_team.shrouded(recruit_loc) )
return false;

if ( resources::gameboard->get_visible_unit(recruit_loc, view_team) != NULL )
if ( resources::gameboard->has_visible_unit(recruit_loc, view_team) != NULL )
return false;

castle_cost_calculator calc(map, view_team);
Expand Down
2 changes: 1 addition & 1 deletion src/actions/move.cpp
Expand Up @@ -769,7 +769,7 @@ namespace { // Private helpers for move_unit()
if ( !is_replay_ ) {
// Avoiding stopping on a (known) unit.
route_iterator min_end = start == begin_ ? start : start + 1;
while ( end != min_end && resources::gameboard->get_visible_unit(*(end-1), *current_team_) )
while ( end != min_end && resources::gameboard->has_visible_unit(*(end-1), *current_team_) )
// Backtrack.
--end;
}
Expand Down

0 comments on commit 1aed8cb

Please sign in to comment.