Fix compilation on MSVC due to ambiguous overload:
OverflowSafeInt<T,T_MAX,T_MIN>::operator /
This commit is contained in:
@@ -123,7 +123,9 @@ void VehicleServiceInDepot(Vehicle *v)
|
|||||||
NOT_REACHED();
|
NOT_REACHED();
|
||||||
}
|
}
|
||||||
assert(type != INVALID_EXPENSES);
|
assert(type != INVALID_EXPENSES);
|
||||||
Money repair_cost = (v->breakdowns_since_last_service * v->repair_cost / _settings_game.vehicle.repair_cost) + 1;
|
|
||||||
|
// The static cast is to fix compilation on (old) MSVC as the overload for OverflowSafeInt operator / is ambiguous.
|
||||||
|
Money repair_cost = (v->breakdowns_since_last_service * v->repair_cost / static_cast<uint>(_settings_game.vehicle.repair_cost)) + 1;
|
||||||
CommandCost cost(type, repair_cost);
|
CommandCost cost(type, repair_cost);
|
||||||
v->First()->profit_this_year -= cost.GetCost() << 8;
|
v->First()->profit_this_year -= cost.GetCost() << 8;
|
||||||
SubtractMoneyFromCompany(cost);
|
SubtractMoneyFromCompany(cost);
|
||||||
|
Reference in New Issue
Block a user