mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-04 06:00:15 +00:00
(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:
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…
Reference in New Issue
Block a user