Codechange: Early continue for cargos not moved by this station
This commit is contained in:
@@ -3962,15 +3962,18 @@ static void UpdateStationRating(Station *st)
|
||||
|
||||
for (const CargoSpec *cs : CargoSpec::Iterate()) {
|
||||
GoodsEntry *ge = &st->goods[cs->Index()];
|
||||
|
||||
/* The station might not currently be moving this cargo. */
|
||||
if (!ge->HasRating()) {
|
||||
/* Slowly increase the rating back to its original level in the case we
|
||||
* didn't deliver cargo yet to this station. This happens when a bribe
|
||||
* failed while you didn't moved that cargo yet to a station. */
|
||||
if (!ge->HasRating() && ge->rating < INITIAL_STATION_RATING) {
|
||||
ge->rating++;
|
||||
if (ge->rating < INITIAL_STATION_RATING) ge->rating++;
|
||||
|
||||
/* Nothing else to do with this cargo. */
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Only change the rating if we are moving this cargo */
|
||||
if (ge->HasRating()) {
|
||||
byte_inc_sat(&ge->time_since_pickup);
|
||||
if (ge->time_since_pickup == 255 && _settings_game.order.selectgoods) {
|
||||
ge->status.Reset(GoodsEntry::State::Rating);
|
||||
@@ -4102,7 +4105,6 @@ static void UpdateStationRating(Station *st)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
StationID index = st->index;
|
||||
if (waiting_changed) {
|
||||
|
||||
Reference in New Issue
Block a user