1
0
Fork 0

Fix: NewGRF vehicles display loading sprites when not actually loading

pull/13554/head
enveeed 2025-02-14 11:20:13 +01:00
parent 6b493714aa
commit cb2d1e22fe
2 changed files with 9 additions and 1 deletions

View File

@ -987,7 +987,9 @@ static uint32_t VehicleGetVariable(Vehicle *v, const VehicleScopeResolver *objec
return nullptr;
}
bool in_motion = !v->First()->current_order.IsType(OT_LOADING);
const Order &order = v->First()->current_order;
bool not_loading = (order.GetUnloadType() & OUFB_NO_UNLOAD) && (order.GetLoadType() & OLFB_NO_LOAD);
bool in_motion = !order.IsType(OT_LOADING) || not_loading;
uint totalsets = in_motion ? (uint)group->loaded.size() : (uint)group->loading.size();

View File

@ -211,6 +211,12 @@ uint16_t Order::MapOldOrder() const
break;
case OT_LOADING:
if (this->GetLoadType() & OLFB_FULL_LOAD) SetBit(order, 6);
/* If both "no load" and "no unload" are set, return nothing order instead */
if ((this->GetLoadType() & OLFB_NO_LOAD) && (this->GetUnloadType() & OUFB_NO_UNLOAD)) {
order = OT_NOTHING;
}
break;
default:
break;
}
return order;