# HG changeset patch # User darkvater # Date 1092664477 0 # Node ID 93656f16d50af943eb12fa27cac1601274d1a4d9 # Parent 53cc59601b3c6edc74fc2a9c249ddce4c6e7e89a (svn r65) -Fix [1009567] problem with transferred cargo crashes game. Invalid st->xy on deleted station. diff -r 53cc59601b3c -r 93656f16d50a lang/english.txt --- a/lang/english.txt Mon Aug 16 13:31:18 2004 +0000 +++ b/lang/english.txt Mon Aug 16 13:54:37 2004 +0000 @@ -2179,6 +2179,7 @@ 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 diff -r 53cc59601b3c -r 93656f16d50a strings.c --- a/strings.c Mon Aug 16 13:31:18 2004 +0000 +++ b/strings.c Mon Aug 16 13:54:37 2004 +0000 @@ -496,7 +496,10 @@ 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);