summaryrefslogtreecommitdiff
path: root/src/game-server/item.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game-server/item.cpp')
-rw-r--r--src/game-server/item.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/game-server/item.cpp b/src/game-server/item.cpp
index cfb1cd9a..d568fb29 100644
--- a/src/game-server/item.cpp
+++ b/src/game-server/item.cpp
@@ -100,7 +100,12 @@ void ItemEffectScript::dispell(Being *itemUser)
ItemClass::~ItemClass()
{
- resetEffects();
+ while (mEffects.begin() != mEffects.end())
+ {
+ delete mEffects.begin()->second;
+ mEffects.erase(mEffects.begin());
+ }
+
for (std::vector<AttackInfo *>::iterator it = mAttackInfos.begin(),
it_end = mAttackInfos.end();
it != it_end; ++it)
@@ -109,6 +114,15 @@ ItemClass::~ItemClass()
}
}
+void ItemClass::addEffect(ItemEffectInfo *effect,
+ ItemTriggerType id,
+ ItemTriggerType dispell)
+{
+ mEffects.insert(std::make_pair(id, effect));
+ if (dispell)
+ mDispells.insert(std::make_pair(dispell, effect));
+}
+
bool ItemClass::useTrigger(Being *itemUser, ItemTriggerType trigger)
{
if (!trigger)