(svn r16737) -Fix (r15645): When loading a savegame Engine::grffile might be left NULL in certain cases. (dynamic_engines enabled, articulated vehicle with only wagon-override action3s)

pull/155/head
frosch 15 years ago
parent c5a44ce99e
commit da1628d0b5

@ -355,7 +355,11 @@ static Engine *GetNewEngine(const GRFFile *file, VehicleType type, uint16 intern
/* Check if the engine is registered in the override manager */
EngineID engine = _engine_mngr.GetID(type, internal_id, scope_grfid);
if (engine != INVALID_ENGINE) return Engine::Get(engine);
if (engine != INVALID_ENGINE) {
Engine *e = Engine::Get(engine);
if (e->grffile == NULL) e->grffile = file;
return e;
}
}
/* Check if there is an unreserved slot */

Loading…
Cancel
Save