summaryrefslogtreecommitdiff
path: root/src/net/beinghandler.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2007-03-11 19:59:55 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2007-03-11 19:59:55 +0000
commitfc63e88f869919a8b035a5c41db8d05626526bde (patch)
tree8f1928d082ebbffc549c712a3f406c2141f43e01 /src/net/beinghandler.cpp
parent7b0f0ec315e66dcbdda58ada8b09a59bc5dcf6c9 (diff)
downloadmana-fc63e88f869919a8b035a5c41db8d05626526bde.tar.gz
mana-fc63e88f869919a8b035a5c41db8d05626526bde.tar.bz2
mana-fc63e88f869919a8b035a5c41db8d05626526bde.tar.xz
mana-fc63e88f869919a8b035a5c41db8d05626526bde.zip
Merged 0.0 changes from revision 3065 to 3177 to trunk.
Diffstat (limited to 'src/net/beinghandler.cpp')
-rw-r--r--src/net/beinghandler.cpp33
1 files changed, 15 insertions, 18 deletions
diff --git a/src/net/beinghandler.cpp b/src/net/beinghandler.cpp
index 32c78b39..53746671 100644
--- a/src/net/beinghandler.cpp
+++ b/src/net/beinghandler.cpp
@@ -215,29 +215,26 @@ void BeingHandler::handleMessage(MessageIn &msg)
switch (type)
{
case 0: // Damage
- if (dstBeing == NULL) break;
-
- dstBeing->setDamage(param1, SPEECH_TIME);
-
- if (srcBeing != NULL &&
- srcBeing != player_node)
- {
- srcBeing->setAction(Being::ATTACK);
- srcBeing->mFrame = 0;
- srcBeing->mWalkTime = tick_time;
+ if (dstBeing) {
+ dstBeing->takeDamage(param1);
+ }
+ if (srcBeing) {
+ srcBeing->handleAttack(dstBeing, param1);
}
break;
case 2: // Sit
- if (srcBeing == NULL) break;
- srcBeing->mFrame = 0;
- srcBeing->setAction(Being::SIT);
+ if (srcBeing) {
+ srcBeing->mFrame = 0;
+ srcBeing->setAction(Being::SIT);
+ }
break;
case 3: // Stand up
- if (srcBeing == NULL) break;
- srcBeing->mFrame = 0;
- srcBeing->setAction(Being::STAND);
+ if (srcBeing) {
+ srcBeing->mFrame = 0;
+ srcBeing->setAction(Being::STAND);
+ }
break;
}
break;
@@ -525,7 +522,7 @@ void BeingHandler::handleBeingsDamageMessage(MessageIn &msg)
int damage = msg.readShort();
if (being)
{
- being->setDamage(damage, 0);
+ being->takeDamage(damage);
}
}
}
@@ -535,5 +532,5 @@ void BeingHandler::handleBeingActionChangeMessage(MessageIn &msg)
Being* being = beingManager->findBeing(msg.readShort());
if (!being) return;
- being->setAction((Being::Action)msg.readByte());
+ being->setAction((Being::Action) msg.readByte());
}