(svn r24101) -Codechange: Reverse a condition for increased readability.

This commit is contained in:
alberth 2012-04-08 17:26:01 +00:00
parent 1e817ae241
commit f607538882
1 changed files with 10 additions and 11 deletions

View File

@ -2744,18 +2744,17 @@ static CommandCost TownActionBuildStatue(Town *t, DoCommandFlag flags)
if (!Object::CanAllocateItem()) return_cmd_error(STR_ERROR_TOO_MANY_OBJECTS);
TileIndex tile = t->xy;
if (CircularTileSearch(&tile, 9, SearchTileForStatue, NULL)) {
if (flags & DC_EXEC) {
Backup<CompanyByte> cur_company(_current_company, OWNER_NONE, FILE_LINE);
DoCommand(tile, 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR);
cur_company.Restore();
BuildObject(OBJECT_STATUE, tile, _current_company, t);
SetBit(t->statues, _current_company); // Once found and built, "inform" the Town.
MarkTileDirtyByTile(tile);
}
return CommandCost();
if (!CircularTileSearch(&tile, 9, SearchTileForStatue, NULL)) return_cmd_error(STR_ERROR_STATUE_NO_SUITABLE_PLACE);
if (flags & DC_EXEC) {
Backup<CompanyByte> cur_company(_current_company, OWNER_NONE, FILE_LINE);
DoCommand(tile, 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR);
cur_company.Restore();
BuildObject(OBJECT_STATUE, tile, _current_company, t);
SetBit(t->statues, _current_company); // Once found and built, "inform" the Town.
MarkTileDirtyByTile(tile);
}
return_cmd_error(STR_ERROR_STATUE_NO_SUITABLE_PLACE);
return CommandCost();
}
static CommandCost TownActionFundBuildings(Town *t, DoCommandFlag flags)