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

pull/155/head
peter1138 18 years ago
parent 5b19111817
commit b4dbfe5e59

@ -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;
}
}

Loading…
Cancel
Save