summaryrefslogtreecommitdiff
path: root/src/being/playerinfo.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-04-27 15:12:01 +0300
committerAndrei Karas <akaras@inbox.ru>2014-04-27 15:12:01 +0300
commitd5586e6b6d5c7b1b83b3ec681e9da62840b5adaf (patch)
tree5f9a70468149907fa15aad5b5b5e1dc6b7e11bc0 /src/being/playerinfo.cpp
parent744b6e62e1252ca50445b21f671ad8d81dd28ea1 (diff)
downloadplus-d5586e6b6d5c7b1b83b3ec681e9da62840b5adaf.tar.gz
plus-d5586e6b6d5c7b1b83b3ec681e9da62840b5adaf.tar.bz2
plus-d5586e6b6d5c7b1b83b3ec681e9da62840b5adaf.tar.xz
plus-d5586e6b6d5c7b1b83b3ec681e9da62840b5adaf.zip
Simplify triggerStat function.
Diffstat (limited to 'src/being/playerinfo.cpp')
-rw-r--r--src/being/playerinfo.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/being/playerinfo.cpp b/src/being/playerinfo.cpp
index d7652abe0..09604e971 100644
--- a/src/being/playerinfo.cpp
+++ b/src/being/playerinfo.cpp
@@ -62,8 +62,7 @@ void triggerAttr(const int id, const int old)
mData.mAttributes.find(id)->second);
}
-void triggerStat(const int id, const std::string &changed,
- const int old1, const int old2)
+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())
@@ -72,11 +71,6 @@ void triggerStat(const int id, const std::string &changed,
DepricatedEvent event(EVENT_UPDATESTAT);
event.setInt("id", id);
const Stat &stat = it->second;
- event.setInt("base", stat.base);
- event.setInt("mod", stat.mod);
- event.setInt("exp", stat.exp);
- event.setInt("expNeeded", stat.expNeed);
- event.setString("changed", changed);
event.setInt("oldValue1", old1);
event.setInt("oldValue2", old2);
DepricatedEvent::trigger(CHANNEL_ATTRIBUTES, event);
@@ -131,7 +125,7 @@ void setStatBase(const int id, const int value, const bool notify)
const int old = mData.mStats[id].base;
mData.mStats[id].base = value;
if (notify)
- triggerStat(id, "base", old);
+ triggerStat(id, old, 0);
}
int getStatMod(const int id)
@@ -148,7 +142,7 @@ void setStatMod(const int id, const int value, const bool notify)
const int old = mData.mStats[id].mod;
mData.mStats[id].mod = value;
if (notify)
- triggerStat(id, "mod", old);
+ triggerStat(id, old, 0);
}
int getStatEffective(const int id)
@@ -187,7 +181,7 @@ void setStatExperience(const int id, const int have,
stat.exp = have;
stat.expNeed = need;
if (notify)
- triggerStat(id, "exp", oldExp, oldExpNeed);
+ triggerStat(id, oldExp, oldExpNeed);
}
// --- Inventory / Equipment --------------------------------------------------