diff options
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/beinghandler.cpp | 38 | ||||
-rw-r--r-- | src/net/charserverhandler.cpp | 6 | ||||
-rw-r--r-- | src/net/playerhandler.cpp | 4 |
3 files changed, 24 insertions, 24 deletions
diff --git a/src/net/beinghandler.cpp b/src/net/beinghandler.cpp index 58660094..cd5653fc 100644 --- a/src/net/beinghandler.cpp +++ b/src/net/beinghandler.cpp @@ -96,7 +96,7 @@ void BeingHandler::handleMessage(MessageIn *msg) dstBeing->clearPath(); dstBeing->mFrame = 0; dstBeing->mWalkTime = tick_time; - dstBeing->mAction = Being::STAND; + dstBeing->setAction(Being::STAND); } // Prevent division by 0 when calculating frame @@ -106,7 +106,7 @@ void BeingHandler::handleMessage(MessageIn *msg) dstBeing->mJob = job; dstBeing->setHairStyle(msg->readInt16()); dstBeing->setWeapon(msg->readInt16()); - dstBeing->mVisibleEquipment[3] = msg->readInt16(); // head (bottom) + dstBeing->setVisibleEquipment(3, msg->readInt16()); // head bottom if (msg->getId() == SMSG_BEING_MOVE) { @@ -114,8 +114,8 @@ void BeingHandler::handleMessage(MessageIn *msg) } msg->readInt16(); // shield - dstBeing->mVisibleEquipment[4] = msg->readInt16(); // head (top) - dstBeing->mVisibleEquipment[5] = msg->readInt16(); // head (mid) + dstBeing->setVisibleEquipment(4, msg->readInt16()); // head top + dstBeing->setVisibleEquipment(5, msg->readInt16()); // head mid dstBeing->setHairColor(msg->readInt16()); msg->readInt16(); // unknown msg->readInt16(); // head dir @@ -131,7 +131,7 @@ void BeingHandler::handleMessage(MessageIn *msg) { Uint16 srcX, srcY, dstX, dstY; msg->readCoordinatePair(srcX, srcY, dstX, dstY); - dstBeing->mAction = Being::STAND; + dstBeing->setAction(Being::STAND); dstBeing->mX = srcX; dstBeing->mY = srcY; dstBeing->setDestination(dstX, dstY); @@ -160,13 +160,13 @@ void BeingHandler::handleMessage(MessageIn *msg) switch (dstBeing->getType()) { case Being::MONSTER: - dstBeing->mAction = Being::MONSTER_DEAD; + dstBeing->setAction(Being::MONSTER_DEAD); dstBeing->mFrame = 0; dstBeing->mWalkTime = tick_time; break; default: - dstBeing->mAction = Being::DEAD; + dstBeing->setAction(Being::DEAD); break; } } @@ -205,11 +205,11 @@ void BeingHandler::handleMessage(MessageIn *msg) // buggy if (srcBeing->getType() == Being::MONSTER) { - srcBeing->mAction = Being::MONSTER_ATTACK; + srcBeing->setAction(Being::MONSTER_ATTACK); } else { - srcBeing->mAction = Being::ATTACK; + srcBeing->setAction(Being::ATTACK); } srcBeing->mFrame = 0; srcBeing->mWalkTime = tick_time; @@ -219,13 +219,13 @@ void BeingHandler::handleMessage(MessageIn *msg) case 2: // Sit if (srcBeing == NULL) break; srcBeing->mFrame = 0; - srcBeing->mAction = Being::SIT; + srcBeing->setAction(Being::SIT); break; case 3: // Stand up if (srcBeing == NULL) break; srcBeing->mFrame = 0; - srcBeing->mAction = Being::STAND; + srcBeing->setAction(Being::STAND); break; } break; @@ -269,8 +269,8 @@ void BeingHandler::handleMessage(MessageIn *msg) case 3: case 4: case 5: - // Equip/unequip head 3. Bottom 4. Top 5. Bottom - dstBeing->mVisibleEquipment[type] = msg->readInt8(); + // Equip/unequip head 3. Bottom 4. Top 5. Middle + dstBeing->setVisibleEquipment(type, msg->readInt8()); // First 3 slots of mVisibleEquipments are reserved for // later use, probably accessories. break; @@ -314,15 +314,15 @@ void BeingHandler::handleMessage(MessageIn *msg) dstBeing->setHairStyle(msg->readInt16()); dstBeing->setWeaponById(msg->readInt16()); // item id 1 msg->readInt16(); // item id 2 - dstBeing->mVisibleEquipment[3] = msg->readInt16(); // head (bottom) + dstBeing->setVisibleEquipment(3, msg->readInt16()); // head bottom if (msg->getId() == SMSG_PLAYER_MOVE) { msg->readInt32(); // server tick } - dstBeing->mVisibleEquipment[4] = msg->readInt16(); // head (top) - dstBeing->mVisibleEquipment[5] = msg->readInt16(); // head (mid) + dstBeing->setVisibleEquipment(4, msg->readInt16()); // head top + dstBeing->setVisibleEquipment(5, msg->readInt16()); // head mid dstBeing->setHairColor(msg->readInt16()); msg->readInt16(); // unknown msg->readInt16(); // head dir @@ -353,7 +353,7 @@ void BeingHandler::handleMessage(MessageIn *msg) { if (msg->readInt8() == 2) { - dstBeing->mAction = Being::SIT; + dstBeing->setAction(Being::SIT); } } else if (msg->getId() == SMSG_PLAYER_MOVE) @@ -371,8 +371,8 @@ void BeingHandler::handleMessage(MessageIn *msg) case 0x0119: // Change in players look printf("0x0119 %i %i %i %x %i\n", msg->readInt32(), - msg->readInt16(), msg->readInt16(), msg->readInt16(), - msg->readInt8()); + msg->readInt16(), msg->readInt16(), msg->readInt16(), + msg->readInt8()); break; } } diff --git a/src/net/charserverhandler.cpp b/src/net/charserverhandler.cpp index 9857ddc0..06ec78c1 100644 --- a/src/net/charserverhandler.cpp +++ b/src/net/charserverhandler.cpp @@ -191,10 +191,10 @@ LocalPlayer* CharServerHandler::readPlayerData(MessageIn *msg, int &slot) tempPlayer->setWeapon(weapon); tempPlayer->mLevel = msg->readInt16(); msg->readInt16(); // skill point - tempPlayer->mVisibleEquipment[3] = msg->readInt16(); // head bottom + tempPlayer->setVisibleEquipment(3, msg->readInt16()); // head bottom msg->readInt16(); // shield - tempPlayer->mVisibleEquipment[4] = msg->readInt16(); // head option top - tempPlayer->mVisibleEquipment[5] = msg->readInt16(); // head option mid + tempPlayer->setVisibleEquipment(4, msg->readInt16()); // head option top + tempPlayer->setVisibleEquipment(5, msg->readInt16()); // head option mid tempPlayer->setHairColor(msg->readInt16()); msg->readInt16(); // unknown tempPlayer->setName(msg->readString(24)); diff --git a/src/net/playerhandler.cpp b/src/net/playerhandler.cpp index 070fb112..94788333 100644 --- a/src/net/playerhandler.cpp +++ b/src/net/playerhandler.cpp @@ -104,7 +104,7 @@ void PlayerHandler::handleMessage(MessageIn *msg) current_npc = 0; - player_node->mAction = Being::STAND; + player_node->setAction(Being::STAND); player_node->stopAttack(); player_node->mFrame = 0; player_node->mX = x; @@ -163,7 +163,7 @@ void PlayerHandler::handleMessage(MessageIn *msg) deathNotice = new OkDialog("Message", "You're now dead, press ok to restart"); deathNotice->addActionListener(&deathListener); - player_node->mAction = Being::DEAD; + player_node->setAction(Being::DEAD); } } break; |