(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)

This commit is contained in:
rubidium
2014-05-11 18:02:11 +00:00
parent efa70e7a7c
commit fb9dbf30fa
11 changed files with 36 additions and 36 deletions

View File

@@ -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);