summaryrefslogtreecommitdiff
path: root/src/actorspritemanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/actorspritemanager.cpp')
-rw-r--r--src/actorspritemanager.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/actorspritemanager.cpp b/src/actorspritemanager.cpp
index f87f84a50..a9897872b 100644
--- a/src/actorspritemanager.cpp
+++ b/src/actorspritemanager.cpp
@@ -1651,3 +1651,20 @@ bool ActorSpriteManager::checkForPickup(const FloorItem *const item) const
}
return false;
}
+
+void ActorSpriteManager::updateEffects(const std::map<int, int> &addEffects,
+ const std::set<int> removeEffects)
+{
+ for_actors
+ {
+ if (!*it || (*it)->getType() != ActorSprite::NPC)
+ continue;
+ Being *const being = static_cast<Being*>(*it);
+ const int type = being->getSubType();
+ if (removeEffects.find(type) != removeEffects.end())
+ being->removeSpecialEffect();
+ const std::map<int, int>::const_iterator idAdd = addEffects.find(type);
+ if (idAdd != addEffects.end())
+ being->addSpecialEffect((*idAdd).second);
+ }
+}