diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-04-27 16:24:12 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-04-27 16:24:12 +0300 |
commit | a6f6dc9c2db87ed852cac1f8a3047f9b1d3efac0 (patch) | |
tree | bd1e6b6a1cdb42b5e6d4489158d438fe8c05f533 /src/being/playerinfo.cpp | |
parent | af0ae4d0b7c56d540639bb1f4ba7cc458ec718c1 (diff) | |
download | plus-a6f6dc9c2db87ed852cac1f8a3047f9b1d3efac0.tar.gz plus-a6f6dc9c2db87ed852cac1f8a3047f9b1d3efac0.tar.bz2 plus-a6f6dc9c2db87ed852cac1f8a3047f9b1d3efac0.tar.xz plus-a6f6dc9c2db87ed852cac1f8a3047f9b1d3efac0.zip |
Add StatListener.
Diffstat (limited to 'src/being/playerinfo.cpp')
-rw-r--r-- | src/being/playerinfo.cpp | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/being/playerinfo.cpp b/src/being/playerinfo.cpp index 09604e971..ed52df6c0 100644 --- a/src/being/playerinfo.cpp +++ b/src/being/playerinfo.cpp @@ -39,6 +39,8 @@ #include "utils/delete2.h" +#include "listeners/statlistener.h" + #include "debug.h" namespace PlayerInfo @@ -64,16 +66,7 @@ void triggerAttr(const int id, const int old) void triggerStat(const int id, const int old1, const int old2) { - const StatMap::const_iterator it = mData.mStats.find(id); - if (it == mData.mStats.end()) - return; - - DepricatedEvent event(EVENT_UPDATESTAT); - event.setInt("id", id); - const Stat &stat = it->second; - event.setInt("oldValue1", old1); - event.setInt("oldValue2", old2); - DepricatedEvent::trigger(CHANNEL_ATTRIBUTES, event); + StatListener::distributeEvent(id, old1, old2); } // --- Attributes ------------------------------------------------------------- |