summaryrefslogtreecommitdiff
path: root/src/net/ea
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/ea')
-rw-r--r--src/net/ea/beinghandler.cpp19
-rw-r--r--src/net/ea/playerhandler.cpp4
-rw-r--r--src/net/ea/playerhandler.h2
-rw-r--r--src/net/ea/protocol.h1
4 files changed, 23 insertions, 3 deletions
diff --git a/src/net/ea/beinghandler.cpp b/src/net/ea/beinghandler.cpp
index 34a0d70a..f149f15f 100644
--- a/src/net/ea/beinghandler.cpp
+++ b/src/net/ea/beinghandler.cpp
@@ -65,6 +65,7 @@ BeingHandler::BeingHandler(bool enableSync):
SMSG_PLAYER_MOVE_TO_ATTACK,
SMSG_PLAYER_STATUS_CHANGE,
SMSG_BEING_STATUS_CHANGE,
+ SMSG_BEING_RESURRECT,
0
};
handledMessages = _messages;
@@ -260,6 +261,24 @@ void BeingHandler::handleMessage(MessageIn &msg)
break;
+ case SMSG_BEING_RESURRECT:
+ // A being changed mortality status
+ id = msg.readInt32();
+
+ dstBeing = beingManager->findBeing(id);
+
+ if (!dstBeing)
+ break;
+
+ // If this is player's current target, clear it.
+ if (dstBeing == player_node->getTarget())
+ player_node->stopAttack();
+
+ if (msg.readInt8() == 1)
+ dstBeing->setAction(Being::STAND);
+
+ break;
+
case SMSG_BEING_ACTION:
srcBeing = beingManager->findBeing(msg.readInt32());
dstBeing = beingManager->findBeing(msg.readInt32());
diff --git a/src/net/ea/playerhandler.cpp b/src/net/ea/playerhandler.cpp
index 2d953df1..c1b7cc84 100644
--- a/src/net/ea/playerhandler.cpp
+++ b/src/net/ea/playerhandler.cpp
@@ -422,10 +422,10 @@ void PlayerHandler::handleMessage(MessageIn &msg)
}
}
-void PlayerHandler::attack(Being *being)
+void PlayerHandler::attack(int id)
{
MessageOut outMsg(CMSG_PLAYER_ATTACK);
- outMsg.writeInt32(being->getId());
+ outMsg.writeInt32(id);
outMsg.writeInt8(0);
}
diff --git a/src/net/ea/playerhandler.h b/src/net/ea/playerhandler.h
index 808cd0ec..5dbc171b 100644
--- a/src/net/ea/playerhandler.h
+++ b/src/net/ea/playerhandler.h
@@ -35,7 +35,7 @@ class PlayerHandler : public MessageHandler, public Net::PlayerHandler
void handleMessage(MessageIn &msg);
- void attack(Being *being);
+ void attack(int id);
void emote(int emoteId);
diff --git a/src/net/ea/protocol.h b/src/net/ea/protocol.h
index 0373dd8a..5362ab0c 100644
--- a/src/net/ea/protocol.h
+++ b/src/net/ea/protocol.h
@@ -86,6 +86,7 @@ static const int STORAGE_OFFSET = 1;
#define SMSG_BEING_CHAT 0x008d /**< A being talks */
#define SMSG_BEING_NAME_RESPONSE 0x0095 /**< Has to be requested */
#define SMSG_BEING_CHANGE_DIRECTION 0x009c
+#define SMSG_BEING_RESURRECT 0x0148
#define SMSG_PLAYER_STATUS_CHANGE 0x0119
#define SMSG_BEING_STATUS_CHANGE 0x0196