summaryrefslogtreecommitdiff
path: root/src/town_cmd.cpp
diff options
context:
space:
mode:
authorPatric Stout <truebrain@openttd.org>2021-04-01 11:16:19 +0200
committerGitHub <noreply@github.com>2021-04-01 11:16:19 +0200
commitfece1c57cab1d148e15775f3e10ba474dcfc1360 (patch)
tree864829048f995a13c2ada0a6f731404a7de0bab7 /src/town_cmd.cpp
parent9eb6c78a0245317f8dc68ad1034b66019e1bf14f (diff)
downloadopenttd-fece1c57cab1d148e15775f3e10ba474dcfc1360.tar.xz
Codechange: Suppress warnings when asserts are disabled (#8917)
Diffstat (limited to 'src/town_cmd.cpp')
-rw-r--r--src/town_cmd.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp
index a37c36ed7..023063c1f 100644
--- a/src/town_cmd.cpp
+++ b/src/town_cmd.cpp
@@ -107,10 +107,12 @@ Town::~Town()
DeleteWindowById(WC_TOWN_VIEW, this->index);
/* Check no industry is related to us. */
+#ifndef NDEBUG
for (const Industry *i : Industry::Iterate()) assert(i->town != this);
/* ... and no object is related to us. */
for (const Object *o : Object::Iterate()) assert(o->town != this);
+#endif
/* Check no tile is related to us. */
for (TileIndex tile = 0; tile < MapSize(); ++tile) {
@@ -2176,6 +2178,7 @@ static Town *CreateRandomTown(uint attempts, uint32 townnameparts, TownSize size
Backup<CompanyID> cur_company(_current_company, OWNER_TOWN, FILE_LINE);
CommandCost rc = DoCommand(t->xy, t->index, 0, DC_EXEC, CMD_DELETE_TOWN);
+ (void)rc; // assert only
cur_company.Restore();
assert(rc.Succeeded());
@@ -2277,7 +2280,7 @@ HouseZonesBits GetTownRadiusGroup(const Town *t, TileIndex tile)
static inline void ClearMakeHouseTile(TileIndex tile, Town *t, byte counter, byte stage, HouseID type, byte random_bits)
{
CommandCost cc = DoCommand(tile, 0, 0, DC_EXEC | DC_AUTO | DC_NO_WATER, CMD_LANDSCAPE_CLEAR);
-
+ (void)cc; // assert only
assert(cc.Succeeded());
IncreaseBuildingCount(t, type);