diff options
Diffstat (limited to 'src/equipment.cpp')
-rw-r--r-- | src/equipment.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/equipment.cpp b/src/equipment.cpp index 0a285447..08e6fad1 100644 --- a/src/equipment.cpp +++ b/src/equipment.cpp @@ -41,6 +41,13 @@ Equipment::removeEquipment(Item *item) if (i != mEquipment + EQUIPMENT_SIZE) { *i = 0; } + item->setEquipped(false); +} + +void Equipment::removeEquipment(int index) +{ + mEquipment[index]->setEquipped(false); + mEquipment[index] = 0; } void Equipment::setEquipment(int index, Item *item) @@ -48,3 +55,14 @@ void Equipment::setEquipment(int index, Item *item) mEquipment[index] = item; item->setEquipped(true); } + +void Equipment::setArrows(Item *arrows) +{ + if (mArrows) + mArrows->setEquipped(false); + + mArrows = arrows; + + if (arrows) + arrows->setEquipped(true); +} |