newgrf_engine.c
changeset 3648 d234c46bb37a
parent 3630 13278b8ed023
child 3668 42325f12e7d8
--- a/newgrf_engine.c	Sun Apr 23 22:06:52 2006 +0000
+++ b/newgrf_engine.c	Sun Apr 23 22:25:33 2006 +0000
@@ -99,6 +99,7 @@
 // may appear in future - however it's more convenient to store it like this in
 // memory. --pasky)
 static SpriteGroup *engine_custom_sprites[TOTAL_NUM_ENGINES][NUM_GLOBAL_CID];
+static uint32 _engine_grf[TOTAL_NUM_ENGINES];
 
 void SetCustomEngineSprites(EngineID engine, byte cargo, SpriteGroup *group)
 {
@@ -121,9 +122,23 @@
 		for (cargo = 0; cargo < NUM_GLOBAL_CID; cargo++) {
 			engine_custom_sprites[engine][cargo] = NULL;
 		}
+		_engine_grf[engine] = 0;
 	}
 }
 
+void SetEngineGRF(EngineID engine, uint32 grfid)
+{
+	assert(engine < TOTAL_NUM_ENGINES);
+	_engine_grf[engine] = grfid;
+}
+
+uint32 GetEngineGRFID(EngineID engine)
+{
+	assert(engine < TOTAL_NUM_ENGINES);
+	return _engine_grf[engine];
+}
+
+
 static int MapOldSubType(const Vehicle *v)
 {
 	if (v->type != VEH_Train) return v->subtype;