(svn r8120) -Fix (r8055): Station cargo waiting value clamp should be signed not unsigned. This resulted in cargo magically appearing...

This commit is contained in:
peter1138 2007-01-14 18:38:40 +00:00
parent 54b88bc8e6
commit bfa618ef89
1 changed files with 2 additions and 2 deletions

View File

@ -2524,8 +2524,8 @@ static void UpdateStationRating(Station *st)
// if rating is <= 127 and there are any items waiting, maybe remove some goods.
if (rating <= 127 && waiting != 0) {
uint32 r = Random();
if ( (uint)rating <= (r & 0x7F) ) {
waiting = max(waiting - ((r >> 8)&3) - 1, 0U);
if (rating <= (int)GB(r, 0, 7)) {
waiting = max(waiting - (int)GB(r, 8, 2) - 1, 0);
waiting_changed = true;
}
}