summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/station_cmd.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index ea89c45f9..e0e508923 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -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;
}
}