diff options
author | frosch <frosch@openttd.org> | 2011-11-08 17:24:43 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2011-11-08 17:24:43 +0000 |
commit | d8f8909f859eb900ceaf8897537b2f46d970b308 (patch) | |
tree | 6a7c1eec6508195356926d1859b78305f959aafb /src/newgrf_airport.cpp | |
parent | cd029465e1d6413453cb16224d5000fa9689fa79 (diff) | |
download | openttd-d8f8909f859eb900ceaf8897537b2f46d970b308.tar.xz |
(svn r23142) -Change: [NewGRF v8] Unify the return values of callbacks returning D0xx texts.
Diffstat (limited to 'src/newgrf_airport.cpp')
-rw-r--r-- | src/newgrf_airport.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/newgrf_airport.cpp b/src/newgrf_airport.cpp index 05e54ab23..9137bf865 100644 --- a/src/newgrf_airport.cpp +++ b/src/newgrf_airport.cpp @@ -273,7 +273,12 @@ StringID GetAirportTextCallback(const AirportSpec *as, byte layout, uint16 callb object.callback = (CallbackID)callback; group = SpriteGroup::Resolve(as->grf_prop.spritegroup[0], &object); - if (group == NULL) return STR_UNDEFINED; + uint16 cb_res = (group != NULL) ? group->GetCallbackResult() : CALLBACK_FAILED; + if (cb_res == CALLBACK_FAILED || cb_res == 0x400) return STR_UNDEFINED; + if (cb_res > 0x400) { + ErrorUnknownCallbackResult(as->grf_prop.grffile->grfid, callback, cb_res); + return STR_UNDEFINED; + } - return GetGRFStringID(as->grf_prop.grffile->grfid, 0xD000 + group->GetCallbackResult()); + return GetGRFStringID(as->grf_prop.grffile->grfid, 0xD000 + cb_res); } |