diff --git a/common/patches/rof2.cpp b/common/patches/rof2.cpp index 0406225ba..38106fd2a 100644 --- a/common/patches/rof2.cpp +++ b/common/patches/rof2.cpp @@ -6365,9 +6365,18 @@ namespace RoF2 //sprintf(hdr.unknown000, "06e0002Y1W00"); strn0cpy(hdr.unknown000, fmt::format("{:016}\0", inst->GetSerialNumber()).c_str(),sizeof(hdr.unknown000)); - hdr.stacksize = - item->ID == PARCEL_MONEY_ITEM_ID ? inst->GetPrice() : (inst->IsStackable() ? ((inst->GetCharges() > 1000) - ? 0xFFFFFFFF : inst->GetCharges()) : 1); + hdr.stacksize = 1; + + if (item->ID == PARCEL_MONEY_ITEM_ID) { + hdr.stacksize = inst->GetPrice(); + } else if (inst->IsStackable()) { + if (inst->GetCharges() > std::numeric_limits::max()) { + hdr.stacksize = std::numeric_limits::max(); + } else { + hdr.stacksize = inst->GetCharges(); + } + } + hdr.unknown004 = 0; structs::InventorySlot_Struct slot_id{};