mirror of https://github.com/OpenTTD/OpenTTD.git
(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.
This commit is contained in:
parent
9c97eb32ba
commit
f2143b3d9b
|
@ -2449,7 +2449,7 @@ static void UpdateStationRating(Station *st)
|
|||
|
||||
{
|
||||
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) ||
|
||||
|
|
Loading…
Reference in New Issue