Codechange: Make order load/unload flags value types. (#14861)
Order Load and Unload flags have complex logic to ensure that invalid combinations aren't used. In fact, apart from FullLoad and FullLoadAny, all mixed combinations are invalid. Simplify logic by removing the use of bit values and treat each option as a value.
This commit is contained in:
@@ -1020,7 +1020,7 @@ static uint32_t VehicleGetVariable(Vehicle *v, const VehicleScopeResolver *objec
|
||||
}
|
||||
|
||||
const Order &order = v->First()->current_order;
|
||||
bool not_loading = (order.GetUnloadType() & OUFB_NO_UNLOAD) && (order.GetLoadType() & OLFB_NO_LOAD);
|
||||
bool not_loading = order.GetUnloadType() == OrderUnloadType::NoUnload && order.GetLoadType() == OrderLoadType::NoLoad;
|
||||
bool in_motion = !order.IsType(OT_LOADING) || not_loading;
|
||||
|
||||
uint totalsets = static_cast<uint>(in_motion ? group.loaded.size() : group.loading.size());
|
||||
|
||||
Reference in New Issue
Block a user