Every station has fixed-size GoodsEntry
Code: Select all
GoodsEntry goods[NUM_CARGO];
Code: Select all
typedef struct GoodsEntry {
uint16 waiting_acceptance;
byte days_since_pickup;
byte rating;
StationID enroute_from;
byte enroute_time;
byte last_speed;
byte last_age;
int32 feeder_profit;
} GoodsEntry;
Then here is one fucntion that reset ‹enroute_from› and ‹enroute_time›, so our valuable cargo get transferred unpayed.
Code: Select all
static void UpdateStationWaiting(Station *st, int type, uint amount)
{
SB(st->goods[type].waiting_acceptance, 0, 12,
min(0xFFF, GB(st->goods[type].waiting_acceptance, 0, 12) + amount)
);
st->goods[type].enroute_time = 0;
st->goods[type].enroute_from = st->index;
InvalidateWindow(WC_STATION_VIEW, st->index);
MarkStationTilesDirty(st);
}
Also ‹enroute_from› is reseting when new cargo is unloaded with new ‹enroute_from› value in LoadUnloadVehicle
So we can done with it? At least we can pay for tranfer when reseting ‹enroute_from› and ‹enroute_time› values, so industry will «buy» that cargo, but it isn't most correct solution anyway.