summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhackykid <hackykid@openttd.org>2005-06-23 01:26:54 +0000
committerhackykid <hackykid@openttd.org>2005-06-23 01:26:54 +0000
commit7b0c7672383cc00612b801607f7db771a3bc2190 (patch)
treee32a4678b91a922a3f450eb202c27970a2e3afb4
parent7549cb52714014a10f62c6d04fd8bcad21e09a33 (diff)
downloadopenttd-7b0c7672383cc00612b801607f7db771a3bc2190.tar.xz
(svn r2474) - Fix: [newgrf] Some road vehicle action 0 properties were loaded as the wrong type (int8,int16,int32) causing undefined results. (like cargo types being wrong)
-rw-r--r--newgrf.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/newgrf.c b/newgrf.c
index 4803acd27..98a44e349 100644
--- a/newgrf.c
+++ b/newgrf.c
@@ -416,18 +416,18 @@ static bool RoadVehicleChangeInfo(uint engine, int numinfo, int prop, byte **buf
rvi[i].max_speed = speed; // ?? units
}
- } break;
+ } break;
case 0x09: { /* Running cost factor */
FOR_EACH_OBJECT {
uint8 runcost = grf_load_byte(&buf);
rvi[i].running_cost = runcost;
}
- } break;
+ } break;
case 0x0A: { /* Running cost base */
/* TODO: I have no idea. --pasky */
FOR_EACH_OBJECT {
- grf_load_byte(&buf);
+ grf_load_dword(&buf);
}
ret = true;
} break;
@@ -445,35 +445,35 @@ static bool RoadVehicleChangeInfo(uint engine, int numinfo, int prop, byte **buf
rvi[i].image_index = spriteid;
}
- } break;
+ } break;
case 0x0F: { /* Cargo capacity */
FOR_EACH_OBJECT {
- uint16 capacity = grf_load_word(&buf);
+ uint16 capacity = grf_load_byte(&buf);
rvi[i].capacity = capacity;
}
- } break;
+ } break;
case 0x10: { /* Cargo type */
FOR_EACH_OBJECT {
uint8 cargo = grf_load_byte(&buf);
rvi[i].cargo_type = cargo;
}
- } break;
+ } break;
case 0x11: { /* Cost factor */
FOR_EACH_OBJECT {
uint8 cost_factor = grf_load_byte(&buf);
rvi[i].base_cost = cost_factor; // ?? is it base_cost?
}
- } break;
+ } break;
case 0x12: { /* SFX */
FOR_EACH_OBJECT {
uint8 sfx = grf_load_byte(&buf);
rvi[i].sfx = sfx;
}
- } break;
+ } break;
case 0x13: /* Power in 10hp */
case 0x14: /* Weight in 1/4 tons */
case 0x15: /* Speed in mph*0.8 */
@@ -485,13 +485,13 @@ static bool RoadVehicleChangeInfo(uint engine, int numinfo, int prop, byte **buf
}
ret = true;
break;
- case 0x16: { /* Cargos available for refitting */
+ case 0x16: { /* Cargos available for refitting */
FOR_EACH_OBJECT {
uint32 refit_mask = grf_load_dword(&buf);
_engine_refit_masks[ROAD_ENGINES_INDEX + engine + i] = refit_mask;
}
- } break;
+ } break;
case 0x17: /* Callback */
case 0x18: /* Tractive effort */
case 0x19: /* Air drag */