summaryrefslogtreecommitdiff
path: root/src/being/playerinfo.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-04-27 16:24:12 +0300
committerAndrei Karas <akaras@inbox.ru>2014-04-27 16:24:12 +0300
commita6f6dc9c2db87ed852cac1f8a3047f9b1d3efac0 (patch)
treebd1e6b6a1cdb42b5e6d4489158d438fe8c05f533 /src/being/playerinfo.cpp
parentaf0ae4d0b7c56d540639bb1f4ba7cc458ec718c1 (diff)
downloadManaVerse-a6f6dc9c2db87ed852cac1f8a3047f9b1d3efac0.tar.gz
ManaVerse-a6f6dc9c2db87ed852cac1f8a3047f9b1d3efac0.tar.bz2
ManaVerse-a6f6dc9c2db87ed852cac1f8a3047f9b1d3efac0.tar.xz
ManaVerse-a6f6dc9c2db87ed852cac1f8a3047f9b1d3efac0.zip
Add StatListener.
Diffstat (limited to 'src/being/playerinfo.cpp')
-rw-r--r--src/being/playerinfo.cpp13
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 -------------------------------------------------------------