This commit is contained in:
aozhiwei 2023-05-23 15:45:36 +08:00
parent 3edc830214
commit c7212c4d20

View File

@ -1505,11 +1505,12 @@ void Creature::AddInventory(int slot_id, int num)
void Creature::DecInventory(int slot_id, int num)
{
assert(num > 0);
if (!IsValidSlotId(slot_id)) {
A8_ABORT();
if (num > 0) {
if (!IsValidSlotId(slot_id)) {
A8_ABORT();
}
inventory_[slot_id].num -= num;
}
inventory_[slot_id].num -= num;
}
void Creature::CheckSpecObject(int new_poly_flags)