(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)

This commit is contained in:
frosch 2009-07-04 12:20:42 +00:00
parent c5a44ce99e
commit da1628d0b5

View File

@ -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 */