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
This commit is contained in:
Guillaume Dupuy 2017-07-11 00:27:04 +02:00
parent cdf648fd4f
commit 63138ba784

View file

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