1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2025-12-10 06:52:05 +01:00

Fix 741c431: Miscalculated cargo penalty for poor station rating (#14712)

This commit is contained in:
davidxn
2025-11-18 15:18:02 -05:00
committed by GitHub
parent 98700eee43
commit 4e24c205d6

View File

@@ -4073,7 +4073,7 @@ static void UpdateStationRating(Station *st)
uint32_t r = Random();
if (rating <= (int)GB(r, 0, 7)) {
/* Need to have int, otherwise it will just overflow etc. */
waiting = std::max((int)waiting - (int)((GB(r, 8, 2) - 1) * num_dests), 0);
waiting = std::max((int)waiting - (int)((GB(r, 8, 2) + 1) * num_dests), 0);
waiting_changed = true;
}
}