diff options
Diffstat (limited to 'src/engine.cpp')
-rw-r--r-- | src/engine.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/engine.cpp b/src/engine.cpp index d08fbef32..8774b0b3e 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -497,6 +497,9 @@ void SetCachedEngineCounts() } } +/** + * Initialise the engine pool with the data from the original vehicles. + */ void SetupEngines() { DeleteWindowByClass(WC_ENGINE_PREVIEW); @@ -506,6 +509,9 @@ void SetupEngines() const EngineIDMapping *end = _engine_mngr.End(); uint index = 0; for (const EngineIDMapping *eid = _engine_mngr.Begin(); eid != end; eid++, index++) { + /* Assert is safe; there won't be more than 256 original vehicles + * in any case, and we just cleaned the pool. */ + assert(Engine::CanAllocateItem()); const Engine *e = new Engine(eid->type, eid->internal_id); assert(e->index == index); } |