summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2011-06-07 21:23:20 +0200
committerYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2011-06-17 14:29:59 +0200
commitfaf0a45d6b8b85acd2836cf5e8e7f7c5b161931d (patch)
tree9a98a66fff1529af26823566edfdc7c271d88564
parenta387dc5d5230af3a9d0d784b946de7fd05a14416 (diff)
downloadmana-faf0a45d6b8b85acd2836cf5e8e7f7c5b161931d.tar.gz
mana-faf0a45d6b8b85acd2836cf5e8e7f7c5b161931d.tar.bz2
mana-faf0a45d6b8b85acd2836cf5e8e7f7c5b161931d.tar.xz
mana-faf0a45d6b8b85acd2836cf5e8e7f7c5b161931d.zip
Made the client officially handle attack ids.
It already was, but now the the api is clear about it. Client part of the mana issue: #363. Reviewed-by: Bjorn.
-rw-r--r--src/being.h2
-rw-r--r--src/localplayer.cpp4
-rw-r--r--src/localplayer.h2
-rw-r--r--src/net/manaserv/beinghandler.cpp4
-rw-r--r--src/net/manaserv/manaserv_protocol.h2
5 files changed, 7 insertions, 7 deletions
diff --git a/src/being.h b/src/being.h
index 895506e8..a2a78bfd 100644
--- a/src/being.h
+++ b/src/being.h
@@ -341,7 +341,7 @@ class Being : public ActorSprite, public EventListener
/**
* Sets the current action.
*/
- virtual void setAction(Action action, int attackType = 0);
+ virtual void setAction(Action action, int attackId = 1);
/**
* Get the being's action currently performed.
diff --git a/src/localplayer.cpp b/src/localplayer.cpp
index a1914c78..a375da92 100644
--- a/src/localplayer.cpp
+++ b/src/localplayer.cpp
@@ -173,7 +173,7 @@ void LocalPlayer::logic()
Being::logic();
}
-void LocalPlayer::setAction(Action action, int attackType)
+void LocalPlayer::setAction(Action action, int attackId)
{
if (action == DEAD)
{
@@ -181,7 +181,7 @@ void LocalPlayer::setAction(Action action, int attackType)
setTarget(NULL);
}
- Being::setAction(action, attackType);
+ Being::setAction(action, attackId);
}
void LocalPlayer::setGMLevel(int level)
diff --git a/src/localplayer.h b/src/localplayer.h
index b906ec53..ab309d8f 100644
--- a/src/localplayer.h
+++ b/src/localplayer.h
@@ -76,7 +76,7 @@ class LocalPlayer : public Being
virtual void logic();
- virtual void setAction(Action action, int attackType = 0);
+ virtual void setAction(Action action, int attackId = 1);
/**
* Compute the next pathnode location when walking using keyboard.
diff --git a/src/net/manaserv/beinghandler.cpp b/src/net/manaserv/beinghandler.cpp
index cff0ff71..4d45da8a 100644
--- a/src/net/manaserv/beinghandler.cpp
+++ b/src/net/manaserv/beinghandler.cpp
@@ -270,14 +270,14 @@ void BeingHandler::handleBeingAttackMessage(Net::MessageIn &msg)
{
Being *being = actorSpriteManager->findBeing(msg.readInt16());
const BeingDirection direction = (BeingDirection) msg.readInt8();
- const int attackType = msg.readInt8();
+ const int attackId = msg.readInt8();
if (!being)
return;
being->setDirection(direction);
- being->setAction(Being::ATTACK, attackType);
+ being->setAction(Being::ATTACK, attackId);
}
void BeingHandler::handleBeingsDamageMessage(Net::MessageIn &msg)
diff --git a/src/net/manaserv/manaserv_protocol.h b/src/net/manaserv/manaserv_protocol.h
index 180e9810..2b99bf41 100644
--- a/src/net/manaserv/manaserv_protocol.h
+++ b/src/net/manaserv/manaserv_protocol.h
@@ -121,7 +121,7 @@ enum {
GPMSG_BEINGS_MOVE = 0x0280, // { W being id, B flags [, [W*2 position,] W*2 destination, B speed] }*
GPMSG_ITEMS = 0x0281, // { W item id, W*2 position }*
PGMSG_ATTACK = 0x0290, // W being id
- GPMSG_BEING_ATTACK = 0x0291, // W being id, B direction, B attacktype
+ GPMSG_BEING_ATTACK = 0x0291, // W being id, B direction, B attack id
PGMSG_USE_SPECIAL = 0x0292, // B specialID
GPMSG_SPECIAL_STATUS = 0x0293, // { B specialID, D current, D max, D recharge }
PGMSG_SAY = 0x02A0, // S text