summaryrefslogtreecommitdiff
path: root/src/town_cmd.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2011-11-08 17:24:43 +0000
committerfrosch <frosch@openttd.org>2011-11-08 17:24:43 +0000
commitd8f8909f859eb900ceaf8897537b2f46d970b308 (patch)
tree6a7c1eec6508195356926d1859b78305f959aafb /src/town_cmd.cpp
parentcd029465e1d6413453cb16224d5000fa9689fa79 (diff)
downloadopenttd-d8f8909f859eb900ceaf8897537b2f46d970b308.tar.xz
(svn r23142) -Change: [NewGRF v8] Unify the return values of callbacks returning D0xx texts.
Diffstat (limited to 'src/town_cmd.cpp')
-rw-r--r--src/town_cmd.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp
index 9fde9163a..eb741923b 100644
--- a/src/town_cmd.cpp
+++ b/src/town_cmd.cpp
@@ -650,10 +650,14 @@ static void GetTileDesc_Town(TileIndex tile, TileDesc *td)
td->str = hs->building_name;
uint16 callback_res = GetHouseCallback(CBID_HOUSE_CUSTOM_NAME, house_completed ? 1 : 0, 0, house, Town::GetByTile(tile), tile);
- if (callback_res != CALLBACK_FAILED) {
- StringID new_name = GetGRFStringID(hs->grf_prop.grffile->grfid, 0xD000 + callback_res);
- if (new_name != STR_NULL && new_name != STR_UNDEFINED) {
- td->str = new_name;
+ if (callback_res != CALLBACK_FAILED && callback_res != 0x400) {
+ if (callback_res > 0x400) {
+ ErrorUnknownCallbackResult(hs->grf_prop.grffile->grfid, CBID_HOUSE_CUSTOM_NAME, callback_res);
+ } else {
+ StringID new_name = GetGRFStringID(hs->grf_prop.grffile->grfid, 0xD000 + callback_res);
+ if (new_name != STR_NULL && new_name != STR_UNDEFINED) {
+ td->str = new_name;
+ }
}
}