mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2026-07-24 03:56:43 +00:00
Codechange: remove size_t indexer from TypedIndexContainer
Makes container index even stronger.
This commit is contained in:
committed by
Peter Nelson
parent
1d10e8ee64
commit
736ed61c1c
+3
-3
@@ -2047,7 +2047,7 @@ static void DoCreateTown(Town *t, TileIndex tile, uint32_t townnameparts, TownSi
|
||||
|
||||
t->fund_buildings_months = 0;
|
||||
|
||||
for (uint i = 0; i != MAX_COMPANIES; i++) t->ratings[i] = RATING_INITIAL;
|
||||
t->ratings.fill(RATING_INITIAL);
|
||||
|
||||
t->have_ratings = {};
|
||||
t->exclusivity = CompanyID::Invalid();
|
||||
@@ -3826,8 +3826,8 @@ static void UpdateTownRating(Town *t)
|
||||
});
|
||||
|
||||
/* clamp all ratings to valid values */
|
||||
for (uint i = 0; i < MAX_COMPANIES; i++) {
|
||||
t->ratings[i] = Clamp(t->ratings[i], RATING_MINIMUM, RATING_MAXIMUM);
|
||||
for (auto it = t->ratings.begin(); it != t->ratings.end(); ++it) {
|
||||
*it = Clamp(*it, RATING_MINIMUM, RATING_MAXIMUM);
|
||||
}
|
||||
|
||||
SetWindowDirty(WC_TOWN_AUTHORITY, t->index);
|
||||
|
||||
Reference in New Issue
Block a user