summaryrefslogtreecommitdiff
path: root/strings.c
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2005-03-24 17:03:37 +0000
committertruelight <truelight@openttd.org>2005-03-24 17:03:37 +0000
commit83637d164e8be15166aeb39134170ecbe02173d3 (patch)
tree45d160ba77950eea4f380bd7ff3bbcf6644f651a /strings.c
parentf86318407ca89cecce23128f34c61f9fa4f078b7 (diff)
downloadopenttd-83637d164e8be15166aeb39134170ecbe02173d3.tar.xz
(svn r2046) -Codechange: moved all waypoint code to waypoint.c/waypoint.h
-Codechange: rewrote some functions while moving waypoint-stuff -Add: added support for 64k waypoints -Fix: made the waypoint struct a bit more logic (no bit-fucking)
Diffstat (limited to 'strings.c')
-rw-r--r--strings.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/strings.c b/strings.c
index 75c5401e5..52404aaf3 100644
--- a/strings.c
+++ b/strings.c
@@ -9,6 +9,7 @@
#include "vehicle.h"
#include "news.h"
#include "screenshot.h"
+#include "waypoint.h"
static char *StationGetSpecialString(char *buff);
static char *GetSpecialTownNameString(char *buff, int ind);
@@ -545,14 +546,14 @@ static char *DecodeString(char *buff, const char *str)
}
case 0x9D: { // {WAYPOINT}
- Waypoint *cp = &_waypoints[GetDParam(0)];
+ Waypoint *wp = GetWaypoint(GetDParam(0));
StringID str;
int idx;
- if (~cp->town_or_string & 0xC000) {
+ if (wp->string != STR_NULL) {
GetParamInt32(); // skip it
- str = cp->town_or_string;
+ str = wp->string;
} else {
- idx = (cp->town_or_string >> 8) & 0x3F;
+ idx = wp->town_cn;
if (idx == 0) {
str = STR_WAYPOINTNAME_CITY;
} else {
@@ -560,7 +561,7 @@ static char *DecodeString(char *buff, const char *str)
SetDParam(1, idx + 1);
str = STR_WAYPOINTNAME_CITY_SERIAL;
}
- SetDParam(0, cp->town_or_string & 0xFF);
+ SetDParam(0, wp->town_index);
}
buff = GetString(buff, str);