Changeset - r16417:5cadc3733365
[Not reviewed]
master
0 1 0
rubidium - 14 years ago 2010-11-11 09:12:01
rubidium@openttd.org
(svn r21143) -Codechange: reduce the number of dereferences in UpdateStationWaiting
1 file changed with 5 insertions and 4 deletions:
0 comments (0 inline, 0 general)
src/station_cmd.cpp
Show inline comments
 
@@ -3192,15 +3192,16 @@ void ModifyStationRatingAround(TileIndex
 

	
 
static uint UpdateStationWaiting(Station *st, CargoID type, uint amount, SourceType source_type, SourceID source_id)
 
{
 
	amount += st->goods[type].amount_fract;
 
	st->goods[type].amount_fract = GB(amount, 0, 8);
 
	GoodsEntry &ge = st->goods[type];
 
	amount += ge.amount_fract;
 
	ge.amount_fract = GB(amount, 0, 8);
 

	
 
	amount >>= 8;
 
	/* No new "real" cargo item yet. */
 
	if (amount == 0) return 0;
 

	
 
	st->goods[type].cargo.Append(new CargoPacket(st->index, st->xy, amount, source_type, source_id));
 
	SetBit(st->goods[type].acceptance_pickup, GoodsEntry::PICKUP);
 
	ge.cargo.Append(new CargoPacket(st->index, st->xy, amount, source_type, source_id));
 
	SetBit(ge.acceptance_pickup, GoodsEntry::PICKUP);
 

	
 
	TriggerStationAnimation(st, st->xy, SAT_NEW_CARGO, type);
 
	AirportAnimationTrigger(st, AAT_STATION_NEW_CARGO, type);
0 comments (0 inline, 0 general)