From c7dbb1fca0bc81b1df04133baba9e8e39309eb86 Mon Sep 17 00:00:00 2001 From: rubidium Date: Sun, 9 Sep 2007 16:59:56 +0000 Subject: [PATCH] (svn r11071) [0.5] -Fix [FS#1218]: crash when quiting the game in one of the end score windows. --- main_gui.c | 7 ++++--- vehicle.c | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/main_gui.c b/main_gui.c index 1f6876891a..87e386dab2 100644 --- a/main_gui.c +++ b/main_gui.c @@ -1864,9 +1864,10 @@ static void MainToolbarWndProc(Window *w, WindowEvent *e) break; } - case WE_MESSAGE: - HandleZoomMessage(w, FindWindowById(WC_MAIN_WINDOW, 0)->viewport, 17, 18); - break; + case WE_MESSAGE: { + Window *w2 = FindWindowById(WC_MAIN_WINDOW, 0); + if (w2 != NULL) HandleZoomMessage(w, w2->viewport, 17, 18); + } break; } } diff --git a/vehicle.c b/vehicle.c index 472e2d148a..f1985013a3 100644 --- a/vehicle.c +++ b/vehicle.c @@ -2098,6 +2098,7 @@ static int32 ReplaceVehicle(Vehicle **w, byte flags, int32 total_cost) new_v->profit_this_year = old_v->profit_this_year; new_v->profit_last_year = old_v->profit_last_year; new_v->service_interval = old_v->service_interval; + new_v->load_status = old_v->load_status; new_front = true; new_v->unitnumber = old_v->unitnumber; // use the same unit number new_v->dest_tile = old_v->dest_tile;