summaryrefslogtreecommitdiff
path: root/src/net/tmwserv/playerhandler.cpp
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2009-07-07 11:23:14 -0600
committerJared Adams <jaxad0127@gmail.com>2009-07-07 11:23:14 -0600
commit5662b7d9ad9eb6927df7ca83713d3b6108f59ddc (patch)
tree1e962203f7bf2440b558045967d0f93ccf21bbe4 /src/net/tmwserv/playerhandler.cpp
parent851f67cd9975b090b051decb1deab6b0489d14c5 (diff)
downloadmana-client-5662b7d9ad9eb6927df7ca83713d3b6108f59ddc.tar.gz
mana-client-5662b7d9ad9eb6927df7ca83713d3b6108f59ddc.tar.bz2
mana-client-5662b7d9ad9eb6927df7ca83713d3b6108f59ddc.tar.xz
mana-client-5662b7d9ad9eb6927df7ca83713d3b6108f59ddc.zip
Use tmw-skills.xml instead of hardcoding
Diffstat (limited to 'src/net/tmwserv/playerhandler.cpp')
-rw-r--r--src/net/tmwserv/playerhandler.cpp27
1 files changed, 3 insertions, 24 deletions
diff --git a/src/net/tmwserv/playerhandler.cpp b/src/net/tmwserv/playerhandler.cpp
index 69a2bdb4..bbce3ae1 100644
--- a/src/net/tmwserv/playerhandler.cpp
+++ b/src/net/tmwserv/playerhandler.cpp
@@ -133,7 +133,7 @@ void PlayerHandler::handleMessage(MessageIn &msg)
logger->log("ATTRIBUTE UPDATE:");
while (msg.getUnreadLength())
{
- int stat = msg.readInt8();
+ int stat = msg.readInt16();
int base = msg.readInt16();
int value = msg.readInt16();
logger->log("%d set to %d %d", stat, base, value);
@@ -143,24 +143,11 @@ void PlayerHandler::handleMessage(MessageIn &msg)
player_node->setMaxHp(base);
player_node->setHp(value);
}
- else if (stat < NB_CHARACTER_ATTRIBUTES)
+ else
{
- if (stat >= CHAR_SKILL_BEGIN && stat < CHAR_SKILL_END
- && player_node->getAttributeBase(stat) < base
- && player_node->getAttributeBase(stat) > -1)
- {
- Particle* effect = particleEngine->addEffect("graphics/particles/skillup.particle.xml", 0, 0);
- player_node->controlParticle(effect);
- }
-
player_node->setAttributeBase(stat, base);
player_node->setAttributeEffective(stat, value);
}
- else
- {
- logger->log("Warning: server wants to update unknown "
- "attribute %d to %d", stat, value);
- }
}
} break;
@@ -173,15 +160,7 @@ void PlayerHandler::handleMessage(MessageIn &msg)
int current = msg.readInt32();
int next = msg.readInt32();
- if (skill < CHAR_SKILL_NB)
- {
- player_node->setExperience(skill, current, next);
- }
- else
- {
- logger->log("Warning: server wants to update experience of unknown "
- "skill %d to %d / %d", skill, current, next);
- }
+ player_node->setExperience(skill, current, next);
}
} break;