(svn r19670) -Codechange: Add CeilDiv() and RoundDiv() to simplify integer divisions with rounding.
This commit is contained in:
@@ -1165,7 +1165,7 @@ static void LoadUnloadVehicle(Vehicle *v, int *cargo_left)
|
||||
byte load_amount = e->info.load_amount;
|
||||
|
||||
/* The default loadamount for mail is 1/4 of the load amount for passengers */
|
||||
if (v->type == VEH_AIRCRAFT && !Aircraft::From(v)->IsNormalAircraft()) load_amount = (load_amount + 3) / 4;
|
||||
if (v->type == VEH_AIRCRAFT && !Aircraft::From(v)->IsNormalAircraft()) load_amount = CeilDiv(load_amount, 4);
|
||||
|
||||
if (_settings_game.order.gradual_loading && HasBit(e->info.callback_mask, CBM_VEHICLE_LOAD_AMOUNT)) {
|
||||
uint16 cb_load_amount = GetVehicleCallback(CBID_VEHICLE_LOAD_AMOUNT, 0, 0, v->engine_type, v);
|
||||
|
Reference in New Issue
Block a user