mirror of
https://github.com/GabsPuNs/Project-Zenith-Main.git
synced 2026-06-22 01:38:23 +00:00
TU24
This commit is contained in:
@@ -263,23 +263,4 @@ Icon *ArmorItem::getEmptyIcon(int slot)
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// TU25 Addition
|
||||
shared_ptr<ItemInstance> ArmorItem::use(shared_ptr<ItemInstance> itemInstance, Level *level, shared_ptr<Player> player)
|
||||
{
|
||||
if ((player->getArmor(Mob::getEquipmentSlotForItem(itemInstance) - 1)) == nullptr)
|
||||
{
|
||||
shared_ptr<ItemInstance> equip = itemInstance->copy();
|
||||
equip->count = 1;
|
||||
player->setEquippedSlot(Mob::getEquipmentSlotForItem(itemInstance) - 1, equip);
|
||||
itemInstance->count--;
|
||||
}
|
||||
|
||||
return itemInstance;
|
||||
}
|
||||
|
||||
bool ArmorItem::TestUse(shared_ptr<ItemInstance> itemInstance, Level *level, shared_ptr<Player> player)
|
||||
{
|
||||
return ((player->getArmor(Mob::getEquipmentSlotForItem(itemInstance) - 1)) == nullptr);
|
||||
}
|
||||
Reference in New Issue
Block a user