diff options
author | rubidium <rubidium@openttd.org> | 2014-05-11 18:02:11 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2014-05-11 18:02:11 +0000 |
commit | 89c25b955e636efa46d65ebf5b4782b77f30f764 (patch) | |
tree | df0d3aacb099edb188c2cab71394604569707af8 /src/station_cmd.cpp | |
parent | 62378e098b008d41fa4f428b212bc238d33c5aad (diff) | |
download | openttd-89c25b955e636efa46d65ebf5b4782b77f30f764.tar.xz |
(svn r26580) -Codechange: s/GES_PICKUP/GES_RATING/ (it has nothing to do with actual pickup), s/acceptance_pickup/status/ (the enum isn't called GoodEntryStatus for a reason; it's not only acceptance and pickup anymore)
Diffstat (limited to 'src/station_cmd.cpp')
-rw-r--r-- | src/station_cmd.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index 8546c4be6..480618965 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -438,7 +438,7 @@ static uint GetAcceptanceMask(const Station *st) uint mask = 0; for (CargoID i = 0; i < NUM_CARGO; i++) { - if (HasBit(st->goods[i].acceptance_pickup, GoodsEntry::GES_ACCEPTANCE)) mask |= 1 << i; + if (HasBit(st->goods[i].status, GoodsEntry::GES_ACCEPTANCE)) mask |= 1 << i; } return mask; } @@ -581,7 +581,7 @@ void UpdateStationAcceptance(Station *st, bool show_msg) } GoodsEntry &ge = st->goods[i]; - SB(ge.acceptance_pickup, GoodsEntry::GES_ACCEPTANCE, 1, amt >= 8); + SB(ge.status, GoodsEntry::GES_ACCEPTANCE, 1, amt >= 8); if (LinkGraph::IsValidID(ge.link_graph)) { (*LinkGraph::Get(ge.link_graph))[ge.node].SetDemand(amt / 8); } @@ -3191,7 +3191,7 @@ void TriggerWatchedCargoCallbacks(Station *st) /* Collect cargoes accepted since the last big tick. */ uint cargoes = 0; for (CargoID cid = 0; cid < NUM_CARGO; cid++) { - if (HasBit(st->goods[cid].acceptance_pickup, GoodsEntry::GES_ACCEPTED_BIGTICK)) SetBit(cargoes, cid); + if (HasBit(st->goods[cid].status, GoodsEntry::GES_ACCEPTED_BIGTICK)) SetBit(cargoes, cid); } /* Anything to do? */ @@ -3224,7 +3224,7 @@ static bool StationHandleBigTick(BaseStation *st) TriggerWatchedCargoCallbacks(Station::From(st)); for (CargoID i = 0; i < NUM_CARGO; i++) { - ClrBit(Station::From(st)->goods[i].acceptance_pickup, GoodsEntry::GES_ACCEPTED_BIGTICK); + ClrBit(Station::From(st)->goods[i].status, GoodsEntry::GES_ACCEPTED_BIGTICK); } } @@ -3621,8 +3621,8 @@ void StationMonthlyLoop() FOR_ALL_STATIONS(st) { for (CargoID i = 0; i < NUM_CARGO; i++) { GoodsEntry *ge = &st->goods[i]; - SB(ge->acceptance_pickup, GoodsEntry::GES_LAST_MONTH, 1, GB(ge->acceptance_pickup, GoodsEntry::GES_CURRENT_MONTH, 1)); - ClrBit(ge->acceptance_pickup, GoodsEntry::GES_CURRENT_MONTH); + SB(ge->status, GoodsEntry::GES_LAST_MONTH, 1, GB(ge->status, GoodsEntry::GES_CURRENT_MONTH, 1)); + ClrBit(ge->status, GoodsEntry::GES_CURRENT_MONTH); } } } @@ -3638,7 +3638,7 @@ void ModifyStationRatingAround(TileIndex tile, Owner owner, int amount, uint rad for (CargoID i = 0; i < NUM_CARGO; i++) { GoodsEntry *ge = &st->goods[i]; - if (ge->acceptance_pickup != 0) { + if (ge->status != 0) { ge->rating = Clamp(ge->rating + amount, 0, 255); } } @@ -3679,7 +3679,7 @@ static uint UpdateStationWaiting(Station *st, CargoID type, uint amount, SourceT if (!ge.HasRating()) { InvalidateWindowData(WC_STATION_LIST, st->index); - SetBit(ge.acceptance_pickup, GoodsEntry::GES_PICKUP); + SetBit(ge.status, GoodsEntry::GES_RATING); } TriggerStationRandomisation(st, st->xy, SRT_NEW_CARGO, type); |