summaryrefslogtreecommitdiff
path: root/newgrf.c
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2006-05-11 16:27:46 +0000
committerpeter1138 <peter1138@openttd.org>2006-05-11 16:27:46 +0000
commitbdcbe2af5c5067021a26bff2391537d1abfab8e4 (patch)
treecc6714fccc50f05852522ec700f928b4645b38f1 /newgrf.c
parentca20c1fa90c90c3385b06d4847ea892be6d7ba35 (diff)
downloadopenttd-bdcbe2af5c5067021a26bff2391537d1abfab8e4.tar.xz
(svn r4832) - NewGRF: add support for original string ID to newgrf text handling. So far, this is used for vehicles when no English or American translation is provided.
Diffstat (limited to 'newgrf.c')
-rw-r--r--newgrf.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/newgrf.c b/newgrf.c
index 613ad55d0..989c14dd4 100644
--- a/newgrf.c
+++ b/newgrf.c
@@ -16,6 +16,7 @@
#include "newgrf.h"
#include "variables.h"
#include "string.h"
+#include "table/strings.h"
#include "bridge.h"
#include "economy.h"
#include "newgrf_engine.h"
@@ -1788,8 +1789,12 @@ static void VehicleNewName(byte *buf, int len)
case GSF_ROAD:
case GSF_SHIP:
case GSF_AIRCRAFT: {
- StringID string = AddGRFString(_cur_grffile->grfid, id, lang, new_scheme, name);
- if (id < TOTAL_NUM_ENGINES) SetCustomEngineName(id, string);
+ if (id < TOTAL_NUM_ENGINES) {
+ StringID string = AddGRFString(_cur_grffile->grfid, id, lang, new_scheme, name, STR_8000_KIRBY_PAUL_TANK_STEAM + id);
+ SetCustomEngineName(id, string);
+ } else {
+ AddGRFString(_cur_grffile->grfid, id, lang, new_scheme, name, id);
+ }
break;
}
@@ -1800,7 +1805,7 @@ static void VehicleNewName(byte *buf, int len)
grfmsg(GMS_WARN, "VehicleNewName: Attempt to name undefined station 0x%X, ignoring.", GB(id, 0, 8));
} else {
StationClassID sclass = _cur_grffile->stations[GB(id, 0, 8)]->sclass;
- SetStationClassName(sclass, AddGRFString(_cur_grffile->grfid, id, lang, new_scheme, name));
+ SetStationClassName(sclass, AddGRFString(_cur_grffile->grfid, id, lang, new_scheme, name, STR_UNDEFINED));
}
break;
@@ -1808,7 +1813,7 @@ static void VehicleNewName(byte *buf, int len)
if (_cur_grffile->stations == NULL || _cur_grffile->stations[GB(id, 0, 8)] == NULL) {
grfmsg(GMS_WARN, "VehicleNewName: Attempt to name undefined station 0x%X, ignoring.", GB(id, 0, 8));
} else {
- _cur_grffile->stations[GB(id, 0, 8)]->name = AddGRFString(_cur_grffile->grfid, id, lang, new_scheme, name);
+ _cur_grffile->stations[GB(id, 0, 8)]->name = AddGRFString(_cur_grffile->grfid, id, lang, new_scheme, name, STR_UNDEFINED);
}
break;