Mercurial > hg > openttd
changeset 1968:612b06511120 draft
(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)
author | hackykid <hackykid@openttd.org> |
---|---|
date | Thu, 23 Jun 2005 01:26:54 +0000 |
parents | 4abec8c70409 |
children | aa42cc2e3527 |
files | newgrf.c |
diffstat | 1 files changed, 11 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/newgrf.c +++ b/newgrf.c @@ -416,18 +416,18 @@ 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 @@ 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 @@ } 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 */