Use correct comparison between enum

Was previously (badly) relying on int as boolean behaviour
Solves a bug where remove slot was not working with headdress (value 0 in enum TSlotEquipment)

--HG--
branch : develop
hg/compatibility-develop
Guillaume Dupuy 7 years ago
parent cdf648fd4f
commit 63138ba784

@ -94,8 +94,8 @@ void CItemGroup::addItem(sint32 createTime, sint32 serial, SLOT_EQUIPMENT::TSlot
void CItemGroup::addRemove(std::string slotName) void CItemGroup::addRemove(std::string slotName)
{ {
SLOT_EQUIPMENT::TSlotEquipment slot = SLOT_EQUIPMENT::stringToSlotEquipment(NLMISC::toUpper(slotName)); SLOT_EQUIPMENT::TSlotEquipment slot = SLOT_EQUIPMENT::stringToSlotEquipment(NLMISC::toUpper(slotName));
if(slot) if(slot != SLOT_EQUIPMENT::UNDEFINED)
removeBeforeEquip.push_back(slot); addRemove(slot);
} }
void CItemGroup::addRemove(SLOT_EQUIPMENT::TSlotEquipment slot) void CItemGroup::addRemove(SLOT_EQUIPMENT::TSlotEquipment slot)

Loading…
Cancel
Save