From c7212c4d207121cfc2a679f2ecc2a931b85e73fa Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Tue, 23 May 2023 15:45:36 +0800 Subject: [PATCH] 1 --- server/gameserver/creature.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/server/gameserver/creature.cc b/server/gameserver/creature.cc index 86848ac8..badca857 100644 --- a/server/gameserver/creature.cc +++ b/server/gameserver/creature.cc @@ -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)