(svn r17836) -Codechange: split the CargoPacket constructor for creating 'real' new CargoPackets and saveload. For saveload we do not need to set anything except two variables (the rest is always overwritten by the load), for new 'real' cargo also pass the source_xy; dereferencing st before calling is easier than resolving st->index back to st and then dereferencing. Also don't set loaded_at_xy because that is of no importance when not loaded in a vehicle.

This commit is contained in:
rubidium
2009-10-20 22:24:34 +00:00
parent b124e9e874
commit 61720eede3
3 changed files with 22 additions and 13 deletions

View File

@@ -2911,7 +2911,7 @@ void ModifyStationRatingAround(TileIndex tile, Owner owner, int amount, uint rad
static void UpdateStationWaiting(Station *st, CargoID type, uint amount, SourceType source_type, SourceID source_id)
{
st->goods[type].cargo.Append(new CargoPacket(st->index, amount, source_type, source_id));
st->goods[type].cargo.Append(new CargoPacket(st->index, st->xy, amount, source_type, source_id));
SetBit(st->goods[type].acceptance_pickup, GoodsEntry::PICKUP);
StationAnimationTrigger(st, st->xy, STAT_ANIM_NEW_CARGO, type);