diff options
author | frosch <frosch@openttd.org> | 2011-11-08 17:24:31 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2011-11-08 17:24:31 +0000 |
commit | cd029465e1d6413453cb16224d5000fa9689fa79 (patch) | |
tree | 70ab763e3537eb056be0ddd15c673b2b6090faf1 /src | |
parent | 56e5144f716fb98ef8facde8b18631452188df6e (diff) | |
download | openttd-cd029465e1d6413453cb16224d5000fa9689fa79.tar.xz |
(svn r23141) -Change: [NewGRF v8] Invert result bit 10 of callbacks 149 and 157 to make them consistent with other slope check callbacks. (michi_cc)
Diffstat (limited to 'src')
-rw-r--r-- | src/newgrf_station.cpp | 5 | ||||
-rw-r--r-- | src/object_cmd.cpp | 7 |
2 files changed, 7 insertions, 5 deletions
diff --git a/src/newgrf_station.cpp b/src/newgrf_station.cpp index e86d40214..8ef375c4c 100644 --- a/src/newgrf_station.cpp +++ b/src/newgrf_station.cpp @@ -694,8 +694,9 @@ CommandCost PerformStationTileSlopeCheck(TileIndex north_tile, TileIndex cur_til /* Failed callback means success. */ if (cb_res == CALLBACK_FAILED) return CommandCost(); - /* The meaning of bit 10 is inverted in the result of this callback. */ - return GetErrorMessageFromLocationCallbackResult(ToggleBit(cb_res, 10), statspec->grf_prop.grffile->grfid, STR_ERROR_LAND_SLOPED_IN_WRONG_DIRECTION); + /* The meaning of bit 10 is inverted for a grf version < 8. */ + if (statspec->grf_prop.grffile->grf_version < 8) ToggleBit(cb_res, 10); + return GetErrorMessageFromLocationCallbackResult(cb_res, statspec->grf_prop.grffile->grfid, STR_ERROR_LAND_SLOPED_IN_WRONG_DIRECTION); } diff --git a/src/object_cmd.cpp b/src/object_cmd.cpp index d07385214..e613c7705 100644 --- a/src/object_cmd.cpp +++ b/src/object_cmd.cpp @@ -241,9 +241,10 @@ CommandCost CmdBuildObject(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3 if (callback == CALLBACK_FAILED) { cost.AddCost(CheckBuildableTile(t, 0, allowed_z, false, false)); - } else if (callback != 0) { - /* The meaning of bit 10 is inverted in the result of this callback. */ - return GetErrorMessageFromLocationCallbackResult(ToggleBit(callback, 10), spec->grf_prop.grffile->grfid, STR_ERROR_LAND_SLOPED_IN_WRONG_DIRECTION); + } else { + /* The meaning of bit 10 is inverted for a grf version < 8. */ + if (spec->grf_prop.grffile->grf_version < 8) ToggleBit(callback, 10); + return GetErrorMessageFromLocationCallbackResult(callback, spec->grf_prop.grffile->grfid, STR_ERROR_LAND_SLOPED_IN_WRONG_DIRECTION); } } |