(svn r5201) - NewGRF: add loading of default refit costs. This information is not yet used
authorpeter1138
Fri, 09 Jun 2006 16:35:07 +0000
changeset 3997 29c77eab14a4
parent 3996 5a1d1fc1bd07
child 3998 5fc47ff2538c
(svn r5201) - NewGRF: add loading of default refit costs. This information is not yet used
engine.h
newgrf.c
table/engines.h
--- a/engine.h	Fri Jun 09 15:27:17 2006 +0000
+++ b/engine.h	Fri Jun 09 16:35:07 2006 +0000
@@ -75,6 +75,7 @@
 	byte railtype:4;
 	byte climates:4;
 	uint32 refit_mask;
+	byte refit_cost;
 	byte misc_flags;
 	byte callbackmask;
 } EngineInfo;
--- a/newgrf.c	Fri Jun 09 15:27:17 2006 +0000
+++ b/newgrf.c	Fri Jun 09 16:35:07 2006 +0000
@@ -406,6 +406,10 @@
 			FOR_EACH_OBJECT rvi[i].pow_wag_power = grf_load_word(&buf);
 			break;
 
+		case 0x1C: /* Refit cost */
+			FOR_EACH_OBJECT ei[i].refit_cost = grf_load_byte(&buf);
+			break;
+
 		case 0x1D: /* Refit cargo */
 			FOR_EACH_OBJECT ei[i].refit_mask = grf_load_dword(&buf);
 			break;
@@ -457,7 +461,6 @@
 
 		/* TODO */
 		/* Fall-through for unimplemented one byte long properties. */
-		case 0x1C: /* Refit cost */
 		case 0x1F: /* Tractive effort */
 		case 0x20: /* Air drag */
 		case 0x26: /* Retire vehicle early */
@@ -552,6 +555,10 @@
 			FOR_EACH_OBJECT ei[i].callbackmask = grf_load_byte(&buf);
 			break;
 
+		case 0x1A: /* Refit cost */
+			FOR_EACH_OBJECT ei[i].refit_cost = grf_load_byte(&buf);
+			break;
+
 		case 0x1C: /* Miscellaneous flags */
 			FOR_EACH_OBJECT ei[i].misc_flags = grf_load_byte(&buf);
 			break;
@@ -566,7 +573,6 @@
 
 		case 0x18: /* Tractive effort */
 		case 0x19: /* Air drag */
-		case 0x1A: /* Refit cost */
 		case 0x1B: /* Retire vehicle early */
 			/* TODO */
 			FOR_EACH_OBJECT grf_load_byte(&buf);
@@ -656,6 +662,10 @@
 			FOR_EACH_OBJECT ei[i].callbackmask = grf_load_byte(&buf);
 			break;
 
+		case 0x13: /* Refit cost */
+			FOR_EACH_OBJECT ei[i].refit_cost = grf_load_byte(&buf);
+			break;
+
 		case 0x17: /* Miscellaneous flags */
 			FOR_EACH_OBJECT ei[i].misc_flags = grf_load_byte(&buf);
 			break;
@@ -668,7 +678,6 @@
 			FOR_EACH_OBJECT cargo_disallowed[SHIP_ENGINES_INDEX + engine + i] = grf_load_word(&buf);
 			break;
 
-		case 0x13: /* Refit cost */
 		case 0x14: /* Ocean speed fraction */
 		case 0x15: /* Canal speed fraction */
 		case 0x16: /* Retire vehicle early */
@@ -753,6 +762,10 @@
 			FOR_EACH_OBJECT ei[i].callbackmask = grf_load_byte(&buf);
 			break;
 
+		case 0x15: /* Refit cost */
+			FOR_EACH_OBJECT ei[i].refit_cost = grf_load_byte(&buf);
+			break;
+
 		case 0x17: /* Miscellaneous flags */
 			FOR_EACH_OBJECT ei[i].misc_flags = grf_load_byte(&buf);
 			break;
@@ -765,7 +778,6 @@
 			FOR_EACH_OBJECT cargo_disallowed[AIRCRAFT_ENGINES_INDEX + engine + i] = grf_load_word(&buf);
 			break;
 
-		case 0x15: /* Refit cost */
 		case 0x16: /* Retire vehicle early */
 			/* TODO */
 			FOR_EACH_OBJECT grf_load_byte(&buf);
--- a/table/engines.h	Fri Jun 09 15:27:17 2006 +0000
+++ b/table/engines.h	Fri Jun 09 16:35:07 2006 +0000
@@ -15,7 +15,7 @@
   * @param e Rail Type of the vehicle
   * @param f Bitmask of the climates
   */
-#define MK(a, b, c, d, e, f) { a, b, c, d, e, f, 0, 0, 0 }
+#define MK(a, b, c, d, e, f) { a, b, c, d, e, f, 0, 0, 0, 0 }
 /** Writes the properties of a train carriage into the EngineInfo struct.
   * @see EngineInfo
   * @param a Introduction date
@@ -23,7 +23,7 @@
   * @param f Bitmask of the climates
   * @note the 0x80 in parameter b sets the "is carriage bit"
   */
-#define MW(a, b, c, d, e, f) { a, b | 0x80, c, d, e, f, 0, 0, 0 }
+#define MW(a, b, c, d, e, f) { a, b | 0x80, c, d, e, f, 0, 0, 0, 0 }
 
 // Rail types
 // R = Conventional railway