mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-17 21:25:40 +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
571dfb9055
commit
7d90c06eb9
@ -355,7 +355,11 @@ static Engine *GetNewEngine(const GRFFile *file, VehicleType type, uint16 intern
|
|||||||
|
|
||||||
/* Check if the engine is registered in the override manager */
|
/* Check if the engine is registered in the override manager */
|
||||||
EngineID engine = _engine_mngr.GetID(type, internal_id, scope_grfid);
|
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 */
|
/* Check if there is an unreserved slot */
|
||||||
|
Loading…
Reference in New Issue
Block a user