mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-11 03:18:55 +00:00
Limit variable scope.
Issue found by cppcheck.
This commit is contained in:
parent
35961bd4b6
commit
97eb5ab8c9
@ -137,7 +137,6 @@ map_location unit_creator::find_location(const config &cfg, const unit* pass_che
|
|||||||
|
|
||||||
BOOST_FOREACH(const std::string& place, placements) {
|
BOOST_FOREACH(const std::string& place, placements) {
|
||||||
map_location loc;
|
map_location loc;
|
||||||
bool pass((place == "leader_passable") || (place == "map_passable"));
|
|
||||||
|
|
||||||
if ( place == "recall" ) {
|
if ( place == "recall" ) {
|
||||||
return map_location::null_location;
|
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)) {
|
if(loc.valid() && resources::game_map->on_board(loc)) {
|
||||||
|
const bool pass((place == "leader_passable") || (place == "map_passable"));
|
||||||
if ( place != "map_overwrite" ) {
|
if ( place != "map_overwrite" ) {
|
||||||
loc = find_vacant_tile(loc, pathfind::VACANT_ANY,
|
loc = find_vacant_tile(loc, pathfind::VACANT_ANY,
|
||||||
pass ? pass_check : NULL);
|
pass ? pass_check : NULL);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user