diff --git a/src/newgrf.cpp b/src/newgrf.cpp --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -657,7 +657,7 @@ static Engine *GetNewEngine(const GRFFil _engine_mngr.push_back({ scope_grfid, // Note: this is INVALID_GRFID if dynamic_engines is disabled, so no reservation internal_id, - {static_cast(type)}, + type, static_cast(min(internal_id, _engine_counts[type])) // substitute_id == _engine_counts[subtype] means "no substitute" });