From cdd6fa5fe9627780a281f420c1a3f5ba5248aa72 Mon Sep 17 00:00:00 2001 From: Jared Adams Date: Sat, 18 Apr 2009 13:39:34 -0600 Subject: Make sure every eAthena packet has a #define --- src/net/ea/playerhandler.cpp | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'src/net/ea/playerhandler.cpp') diff --git a/src/net/ea/playerhandler.cpp b/src/net/ea/playerhandler.cpp index 5d2a4829..c0c0fe20 100644 --- a/src/net/ea/playerhandler.cpp +++ b/src/net/ea/playerhandler.cpp @@ -435,14 +435,14 @@ void PlayerHandler::handleMessage(MessageIn &msg) void PlayerHandler::attack(Being *being) { - MessageOut outMsg(0x0089); + MessageOut outMsg(CMSG_PLAYER_ATTACK); outMsg.writeInt32(being->getId()); outMsg.writeInt8(0); } void PlayerHandler::emote(int emoteId) { - MessageOut outMsg(0x00bf); + MessageOut outMsg(CMSG_PLAYER_EMOTE); outMsg.writeInt8(emoteId); } @@ -501,20 +501,28 @@ void PlayerHandler::setDestination(int x, int y, int direction) { char temp[4] = ""; set_coordinates(temp, x, y, direction); - MessageOut outMsg(0x0085); + MessageOut outMsg(CMSG_PLAYER_CHANGE_DEST); outMsg.writeString(temp, 3); } void PlayerHandler::changeAction(Being::Action action) { - MessageOut outMsg(0x0089); + char type; + switch (action) + { + case Being::SIT: type = 2; break; + case Being::STAND: type = 3; break; + default: return; + } + + MessageOut outMsg(CMSG_PLAYER_CHANGE_ACT); outMsg.writeInt32(0); - outMsg.writeInt8((action == Being::SIT) ? 2 : 3); + outMsg.writeInt8(type); } void PlayerHandler::respawn() { - MessageOut outMsg(0x00b2); + MessageOut outMsg(CMSG_PLAYER_RESPAWN); outMsg.writeInt8(0); } -- cgit v1.2.3-70-g09d2