diff options
author | frosch <frosch@openttd.org> | 2008-03-11 12:55:41 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2008-03-11 12:55:41 +0000 |
commit | ec59843136972c00edf8cad48c319f337ee3a693 (patch) | |
tree | e5df166b12ad3d52a8d80efe081b2a7b2f92f236 | |
parent | 51bbf0c84fb9f34317b9f1d7e724ef8cd40aadee (diff) | |
download | openttd-ec59843136972c00edf8cad48c319f337ee3a693.tar.xz |
(svn r12358) -Fix: Callback 2F returns 15 bit results starting from grf version 7.
-rw-r--r-- | src/newgrf_industrytiles.cpp | 2 | ||||
-rw-r--r-- | src/newgrf_spritegroup.cpp | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/newgrf_industrytiles.cpp b/src/newgrf_industrytiles.cpp index 2ca61fd01..4b229f7e3 100644 --- a/src/newgrf_industrytiles.cpp +++ b/src/newgrf_industrytiles.cpp @@ -275,7 +275,7 @@ bool PerformIndustryTileSlopeCheck(TileIndex ind_base_tile, TileIndex ind_tile, return !IsSlopeRefused(GetTileSlope(ind_tile, NULL), its->slopes_refused); } if (its->grf_prop.grffile->grf_version < 7) { - return callback_res != 0; + return (callback_res & 0xFF) != 0; // mask to 8 bit callback result } /* Copy some parameters from the registers to the error message text ref. stack */ diff --git a/src/newgrf_spritegroup.cpp b/src/newgrf_spritegroup.cpp index b64c784b3..056d949a2 100644 --- a/src/newgrf_spritegroup.cpp +++ b/src/newgrf_spritegroup.cpp @@ -83,7 +83,7 @@ TemporaryStorageArray<uint32, 0x110> _temp_store; static inline bool Is8BitCallback(const ResolverObject *object) { /* Var 0x7E procedure results are always 15 bit */ - if (object == NULL | object->procedure_call) return false; + if (object == NULL || object->procedure_call) return false; switch (object->callback) { /* All these functions are 15 bit callbacks */ @@ -96,6 +96,7 @@ static inline bool Is8BitCallback(const ResolverObject *object) case CBID_INDTILE_ACCEPT_CARGO: case CBID_VEHICLE_COLOUR_MAPPING: case CBID_HOUSE_PRODUCE_CARGO: + case CBID_INDTILE_SHAPE_CHECK: // depends on grf version, masked to 8 bit in PerformIndustryTileSlopeCheck() if needed case CBID_VEHICLE_SOUND_EFFECT: case CBID_VEHICLE_MODIFY_PROPERTY: // depends on queried property case CBID_CARGO_PROFIT_CALC: |