From d33c833a82808c256562b7f3a7e07251613d14ca Mon Sep 17 00:00:00 2001 From: darkvater Date: Mon, 16 Aug 2004 13:54:37 +0000 Subject: (svn r65) -Fix [1009567] problem with transferred cargo crashes game. Invalid st->xy on deleted station. --- strings.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'strings.c') diff --git a/strings.c b/strings.c index a017c9d20..da6038c70 100644 --- a/strings.c +++ b/strings.c @@ -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); -- cgit v1.2.3-54-g00ecf