diff options
Diffstat (limited to 'src/game-server/monster.h')
-rw-r--r-- | src/game-server/monster.h | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/src/game-server/monster.h b/src/game-server/monster.h index 73fec6aa..3313345c 100644 --- a/src/game-server/monster.h +++ b/src/game-server/monster.h @@ -22,7 +22,6 @@ #define MONSTER_H #include "game-server/being.h" -#include "game-server/eventlistener.h" #include "common/defines.h" #include "scripting/script.h" #include "utils/string.h" @@ -31,6 +30,9 @@ #include <vector> #include <string> +#include <sigc++/connection.h> + +class Character; class ItemClass; class Script; @@ -315,8 +317,7 @@ class Monster : public Being */ void changeAnger(Actor *target, int amount); - const std::map<Being *, int> &getAngerList() const - { return mAnger; } + std::map<Being *, int> getAngerList() const; /** * Calls the damage function in Being and updates the aggro list @@ -326,7 +327,7 @@ class Monster : public Being /** * Removes a being from the anger list. */ - void forgetTarget(Entity *being); + void forgetTarget(Entity *entity); /** * Called when an attribute modifier is changed. @@ -351,10 +352,16 @@ class Monster : public Being MonsterClass *mSpecy; /** Aggression towards other beings. */ - std::map<Being *, int> mAnger; - - /** Listener for updating the anger list. */ - EventListener mTargetListener; + struct AggressionInfo { + AggressionInfo() + : anger(0) + {} + + int anger; + sigc::connection removedConnection; + sigc::connection diedConnection; + }; + std::map<Being *, AggressionInfo> mAnger; /** * Character who currently owns this monster (killsteal protection). |