summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/newgrf.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/newgrf.cpp b/src/newgrf.cpp
index 9c28118c6..cd772f5d5 100644
--- a/src/newgrf.cpp
+++ b/src/newgrf.cpp
@@ -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 */