summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/town_cmd.cpp21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp
index 8731a5d78..99b58f3e6 100644
--- a/src/town_cmd.cpp
+++ b/src/town_cmd.cpp
@@ -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)