diff options
author | darkvater <darkvater@openttd.org> | 2004-08-16 13:54:37 +0000 |
---|---|---|
committer | darkvater <darkvater@openttd.org> | 2004-08-16 13:54:37 +0000 |
commit | d33c833a82808c256562b7f3a7e07251613d14ca (patch) | |
tree | 95176fb6993ec7b8e9eaccaf00ec4da70cfd5742 | |
parent | f98482d45abe6d86e44a6d79e2b74176dd2fd5db (diff) | |
download | openttd-d33c833a82808c256562b7f3a7e07251613d14ca.tar.xz |
(svn r65) -Fix [1009567] problem with transferred cargo crashes game. Invalid st->xy on deleted station.
-rw-r--r-- | lang/english.txt | 1 | ||||
-rw-r--r-- | strings.c | 5 |
2 files changed, 5 insertions, 1 deletions
diff --git a/lang/english.txt b/lang/english.txt index ddc5903b1..83c9deb1b 100644 --- a/lang/english.txt +++ b/lang/english.txt @@ -2179,6 +2179,7 @@ STR_SERVICE_NON_STOP_AT_TRAIN_DEPOT :Service non-stop at {TOWN} Train Depot STR_HEADING_FOR_TRAIN_DEPOT :{LTBLUE}Heading for {TOWN} Train Depot STR_HEADING_FOR_TRAIN_DEPOT_VEL :{LTBLUE}Heading for {TOWN} Train Depot, {VELOCITY} +STR_UNKNOWN_DESTINATION :unknown destination STR_8812_EMPTY :{LTBLUE}Empty STR_8813_FROM :{LTBLUE}{CARGO} from {STATION} STR_8814_TRAIN_IS_WAITING_IN_DEPOT :{WHITE}Train {COMMA16} is waiting in depot @@ -496,7 +496,10 @@ static byte *DecodeString(byte *buff, const byte *str) Station *st; InjectDparam(1); st = DEREF_STATION(GET_DPARAM16(1)); - assert(st->xy); + if (!st->xy) { // station doesn't exist anymore + buff = GetString(buff, STR_UNKNOWN_DESTINATION); + break; + } SET_DPARAM16(0, st->town->townnametype); SET_DPARAM32(1, st->town->townnameparts); buff = GetString(buff, st->string_id); |