Limit variable scope.

Issue found by cppcheck.
This commit is contained in:
Mark de Wever 2014-02-08 22:24:55 +01:00
parent 35961bd4b6
commit 97eb5ab8c9

View File

@ -137,7 +137,6 @@ map_location unit_creator::find_location(const config &cfg, const unit* pass_che
BOOST_FOREACH(const std::string& place, placements) {
map_location loc;
bool pass((place == "leader_passable") || (place == "map_passable"));
if ( place == "recall" ) {
return map_location::null_location;
@ -159,6 +158,7 @@ map_location unit_creator::find_location(const config &cfg, const unit* pass_che
}
if(loc.valid() && resources::game_map->on_board(loc)) {
const bool pass((place == "leader_passable") || (place == "map_passable"));
if ( place != "map_overwrite" ) {
loc = find_vacant_tile(loc, pathfind::VACANT_ANY,
pass ? pass_check : NULL);