diff src/station_cmd.cpp @ 5683:809a5610092f draft

(svn r8144) -Fix: [FS#163] When a station is removed, vehicles do not get excessive payment any longer, as the origin TILE is now stored as long as the origin STATION for the transported cargos. Basically this is only a temporary fix until cargopackets are implemented, but it fixes one of the oldest known bugs (Special Thanks to Darkvater for lots of testing)
author celestar <celestar@openttd.org>
date Mon, 15 Jan 2007 14:42:24 +0000 (2007-01-15)
parents 228edec89cae
children 532db432b390
line wrap: on
line diff
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -2533,6 +2533,7 @@
 
 	st->goods[type].enroute_time = 0;
 	st->goods[type].enroute_from = st->index;
+	st->goods[type].enroute_from_xy = st->xy;
 	InvalidateWindow(WC_STATION_VIEW, st->index);
 	st->MarkTilesDirty();
 }
@@ -2748,6 +2749,7 @@
 		st->goods[j].waiting_acceptance = 0;
 		st->goods[j].days_since_pickup = 0;
 		st->goods[j].enroute_from = INVALID_STATION;
+		st->goods[j].enroute_from_xy = INVALID_TILE;
 		st->goods[j].rating = 175;
 		st->goods[j].last_speed = 0;
 		st->goods[j].last_age = 255;
@@ -2958,6 +2960,7 @@
 	    SLE_VAR(GoodsEntry, rating,             SLE_UINT8),
 	SLE_CONDVAR(GoodsEntry, enroute_from,       SLE_FILE_U8 | SLE_VAR_U16,  0, 6),
 	SLE_CONDVAR(GoodsEntry, enroute_from,       SLE_UINT16,                 7, SL_MAX_VERSION),
+	SLE_CONDVAR(GoodsEntry, enroute_from_xy,    SLE_UINT32,                44, SL_MAX_VERSION),
 	    SLE_VAR(GoodsEntry, enroute_time,       SLE_UINT8),
 	    SLE_VAR(GoodsEntry, last_speed,         SLE_UINT8),
 	    SLE_VAR(GoodsEntry, last_age,           SLE_UINT8),