summaryrefslogtreecommitdiff
path: root/src/game-server/being.cpp
diff options
context:
space:
mode:
authorYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2011-04-17 14:23:23 +0200
committerYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2011-04-17 20:50:40 +0200
commitb019b80414ad5027d8284e495d350c956dad9eac (patch)
tree3626c877e22b3815510ab589278483aa1c6debd4 /src/game-server/being.cpp
parentfec5bce5b6485aaee7cb31cb74cbb06aef2a8ebd (diff)
downloadmanaserv-b019b80414ad5027d8284e495d350c956dad9eac.tar.gz
manaserv-b019b80414ad5027d8284e495d350c956dad9eac.tar.bz2
manaserv-b019b80414ad5027d8284e495d350c956dad9eac.tar.xz
manaserv-b019b80414ad5027d8284e495d350c956dad9eac.zip
Added of precised some info I found very useful while debugging.
Reviewed-by: Jaxad0127.
Diffstat (limited to 'src/game-server/being.cpp')
-rw-r--r--src/game-server/being.cpp25
1 files changed, 20 insertions, 5 deletions
diff --git a/src/game-server/being.cpp b/src/game-server/being.cpp
index 1e54853d..f7206e4d 100644
--- a/src/game-server/being.cpp
+++ b/src/game-server/being.cpp
@@ -476,7 +476,12 @@ void Being::setAttribute(unsigned int id, double value)
double Being::getAttribute(unsigned int id) const
{
AttributeMap::const_iterator ret = mAttributes.find(id);
- if (ret == mAttributes.end()) return 0;
+ if (ret == mAttributes.end())
+ {
+ LOG_DEBUG("Being::getAttribute: Attribute "
+ << id << " not found! Returning 0.");
+ return 0;
+ }
return ret->second.getBase();
}
@@ -484,7 +489,12 @@ double Being::getAttribute(unsigned int id) const
double Being::getModifiedAttribute(unsigned int id) const
{
AttributeMap::const_iterator ret = mAttributes.find(id);
- if (ret == mAttributes.end()) return 0;
+ if (ret == mAttributes.end())
+ {
+ LOG_DEBUG("Being::getModifiedAttribute: Attribute "
+ << id << " not found! Returning 0.");
+ return 0;
+ }
return ret->second.getModifiedAttribute();
}
@@ -497,9 +507,13 @@ void Being::setModAttribute(unsigned int, double)
bool Being::recalculateBaseAttribute(unsigned int attr)
{
- LOG_DEBUG("Received update attribute recalculation request at Being for "
+ LOG_DEBUG("Being: Received update attribute recalculation request for "
<< attr << ".");
- if (!mAttributes.count(attr)) return false;
+ if (!mAttributes.count(attr))
+ {
+ LOG_DEBUG("Being::recalculateBaseAttribute: " << attr << " not found!");
+ return false;
+ }
double newBase = getAttribute(attr);
switch (attr)
@@ -537,12 +551,13 @@ bool Being::recalculateBaseAttribute(unsigned int attr)
setAttribute(attr, newBase);
return true;
}
- LOG_DEBUG("No changes to sync for attribute '" << attr << "'.");
+ LOG_DEBUG("Being: No changes to sync for attribute '" << attr << "'.");
return false;
}
void Being::updateDerivedAttributes(unsigned int attr)
{
+ LOG_DEBUG("Being: Updating derived attribute(s) of: " << attr);
switch (attr)
{
case ATTR_MAX_HP: