1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-20 21:19:10 +00:00

Codechange: Suppress warnings when asserts are disabled (#8917)

This commit is contained in:
Patric Stout
2021-04-01 11:16:19 +02:00
committed by GitHub
parent 9eb6c78a02
commit fece1c57ca
14 changed files with 31 additions and 7 deletions

View File

@@ -549,6 +549,7 @@ void SetupEngines()
* in any case, and we just cleaned the pool. */
assert(Engine::CanAllocateItem());
const Engine *e = new Engine(eid.type, eid.internal_id);
(void)e; // assert only
assert(e->index == index);
index++;
}
@@ -1003,8 +1004,7 @@ static void NewVehicleAvailable(Engine *e)
if (e->type == VEH_TRAIN) {
/* maybe make another rail type available */
RailType railtype = e->u.rail.railtype;
assert(railtype < RAILTYPE_END);
assert(e->u.rail.railtype < RAILTYPE_END);
for (Company *c : Company::Iterate()) c->avail_railtypes = AddDateIntroducedRailTypes(c->avail_railtypes | GetRailTypeInfo(e->u.rail.railtype)->introduces_railtypes, _date);
} else if (e->type == VEH_ROAD) {
/* maybe make another road type available */