(svn r4717) - Backport from trunk (r4466): 0.4
authorDarkvater
Wed, 03 May 2006 20:09:28 +0000
branch0.4
changeset 10004 0b8b1b4b2c30
parent 10003 2f1f579a2486
child 10005 fb5d623e692c
(svn r4717) - Backport from trunk (r4466):
Fix: Game no longer crashes when the last vehicle serving a station has been
deleted. This is not exactly the same fix as in trunk/ where it might still
accept types of invalid types but it doesn't crash anymore. The true fix is
not possible without a savegame bump.
station_cmd.c
--- a/station_cmd.c	Tue May 02 21:19:48 2006 +0000
+++ b/station_cmd.c	Wed May 03 20:09:28 2006 +0000
@@ -2449,7 +2449,7 @@
 
 			{
 				byte days = ge->days_since_pickup;
-				if (st->last_vehicle != INVALID_VEHICLE &&
+				if (st->last_vehicle != INVALID_VEHICLE && IsVehicleIndex(st->last_vehicle) &&
 						GetVehicle(st->last_vehicle)->type == VEH_Ship)
 							days >>= 2;
 				(days > 21) ||