summaryrefslogtreecommitdiff
path: root/src/being/playerinfo.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-09-27 01:34:49 +0300
committerAndrei Karas <akaras@inbox.ru>2017-09-27 01:34:49 +0300
commit68a7dd225969fcdfb9c07b99db43756a2b1dec7c (patch)
tree644c14f9b178a968a53e742fb5f37aaf29fc062d /src/being/playerinfo.cpp
parentd3f3ec92d583fcaecccb500c8940f33d7228ff89 (diff)
downloadmv-68a7dd225969fcdfb9c07b99db43756a2b1dec7c.tar.gz
mv-68a7dd225969fcdfb9c07b99db43756a2b1dec7c.tar.bz2
mv-68a7dd225969fcdfb9c07b99db43756a2b1dec7c.tar.xz
mv-68a7dd225969fcdfb9c07b99db43756a2b1dec7c.zip
Change attributes value type to int64.
Diffstat (limited to 'src/being/playerinfo.cpp')
-rw-r--r--src/being/playerinfo.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/being/playerinfo.cpp b/src/being/playerinfo.cpp
index 33541a465..f24d97331 100644
--- a/src/being/playerinfo.cpp
+++ b/src/being/playerinfo.cpp
@@ -72,7 +72,7 @@ std::set<int> mProtectedItems;
// --- Triggers ---------------------------------------------------------------
void triggerAttr(const AttributesT id,
- const int old)
+ const int64_t old)
{
AttributeListener::distributeEvent(id, old,
mData.mAttributes.find(id)->second);
@@ -87,7 +87,7 @@ void triggerStat(const AttributesT id,
// --- Attributes -------------------------------------------------------------
-int getAttribute(const AttributesT id)
+int64_t getAttribute64(const AttributesT id)
{
const AtrIntMap::const_iterator it = mData.mAttributes.find(id);
if (it != mData.mAttributes.end())
@@ -95,11 +95,19 @@ int getAttribute(const AttributesT id)
return 0;
}
+int32_t getAttribute(const AttributesT id)
+{
+ const AtrIntMap::const_iterator it = mData.mAttributes.find(id);
+ if (it != mData.mAttributes.end())
+ return CAST_S32(it->second);
+ return 0;
+}
+
void setAttribute(const AttributesT id,
- const int value,
+ const int64_t value,
const Notify notify)
{
- const int old = mData.mAttributes[id];
+ const int64_t old = mData.mAttributes[id];
mData.mAttributes[id] = value;
if (notify == Notify_true)
triggerAttr(id, old);