(svn r13482) -Codechange: Use "extended bytes" in Actions 3 and 4 for vehicles
authorpeter1138
Thu, 12 Jun 2008 09:25:04 +0000
changeset 10929 4989211616f8
parent 10928 e88d40758667
child 10932 379576f9f8d5
(svn r13482) -Codechange: Use "extended bytes" in Actions 3 and 4 for vehicles
src/newgrf.cpp
--- a/src/newgrf.cpp	Wed Jun 11 21:37:36 2008 +0000
+++ b/src/newgrf.cpp	Thu Jun 12 09:25:04 2008 +0000
@@ -2948,7 +2948,7 @@
 
 	EngineID *engines = AllocaM(EngineID, idcount);
 	for (uint i = 0; i < idcount; i++) {
-		engines[i] = GetNewEngine(_cur_grffile, (VehicleType)feature, grf_load_byte(&buf))->index;
+		engines[i] = GetNewEngine(_cur_grffile, (VehicleType)feature, grf_load_extended(&buf))->index;
 		if (!wagover) last_engines[i] = engines[i];
 	}
 
@@ -3281,7 +3281,14 @@
 	uint8 lang     = grf_load_byte(&buf);
 	uint8 num      = grf_load_byte(&buf);
 	bool generic   = HasBit(lang, 7);
-	uint16 id      = generic ? grf_load_word(&buf) : grf_load_byte(&buf);
+	uint16 id;
+	if (generic) {
+		id = grf_load_word(&buf);
+	} else if (feature <= GSF_AIRCRAFT) {
+		id = grf_load_extended(&buf);
+	} else {
+		id = grf_load_byte(&buf);
+	}
 
 	ClrBit(lang, 7);