summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-11-11 09:12:01 +0000
committerrubidium <rubidium@openttd.org>2010-11-11 09:12:01 +0000
commit6a1a4fc5bbf053465aaa74985e2418f7ae241dd9 (patch)
tree49793def70965da7e14927ef844962d1414e61c6
parented18d02e9a18f52cff79bce4d01cbfe9faae2de4 (diff)
downloadopenttd-6a1a4fc5bbf053465aaa74985e2418f7ae241dd9.tar.xz
(svn r21143) -Codechange: reduce the number of dereferences in UpdateStationWaiting
-rw-r--r--src/station_cmd.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index cee335fc1..1ce324cdf 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -3192,15 +3192,16 @@ void ModifyStationRatingAround(TileIndex tile, Owner owner, int amount, uint rad
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);