diff src/station.cpp @ 7453:5f9154acc3c0 draft

(svn r10931) -Fix [FS#1131]: when a station was destroyed and a vehicle was still loading, changing the current order of the loading vehicle caused a crash. This could happen with removing docks and oil rigs.
author rubidium <rubidium@openttd.org>
date Sat, 18 Aug 2007 22:56:58 +0000
parents edb2c250e91c
children 8dba8e21984f
line wrap: on
line diff
--- a/src/station.cpp
+++ b/src/station.cpp
@@ -69,6 +69,10 @@
 
 	if (CleaningPool()) return;
 
+	while (!loading_vehicles.empty()) {
+		loading_vehicles.front()->LeaveStation();
+	}
+
 	MarkDirty();
 	RebuildStationLists();
 	InvalidateWindowClasses(WC_STATION_LIST);