1
0
Fork 0

Codechange: simplify code (#13822)

pull/13829/head
rubidium42 2025-03-15 21:49:07 +01:00 committed by GitHub
parent c13226cdf8
commit 2fed4b0059
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -3926,7 +3926,7 @@ static void UpdateStationRating(Station *st)
int or_ = ge->rating; // old rating
/* only modify rating in steps of -2, -1, 0, 1 or 2 */
ge->rating = rating = or_ + Clamp(ClampTo<uint8_t>(rating) - or_, -2, 2);
ge->rating = rating = ClampTo<uint8_t>(or_ + Clamp(rating - or_, -2, 2));
/* if rating is <= 64 and more than 100 items waiting on average per destination,
* remove some random amount of goods from the station */