diff options
Diffstat (limited to 'src/net/tmwa')
-rw-r--r-- | src/net/tmwa/beinghandler.cpp | 14 | ||||
-rw-r--r-- | src/net/tmwa/charserverhandler.cpp | 10 | ||||
-rw-r--r-- | src/net/tmwa/chathandler.cpp | 6 | ||||
-rw-r--r-- | src/net/tmwa/gamehandler.cpp | 6 | ||||
-rw-r--r-- | src/net/tmwa/gui/partytab.cpp | 2 | ||||
-rw-r--r-- | src/net/tmwa/guildhandler.cpp | 2 | ||||
-rw-r--r-- | src/net/tmwa/inventoryhandler.cpp | 10 | ||||
-rw-r--r-- | src/net/tmwa/npchandler.cpp | 4 | ||||
-rw-r--r-- | src/net/tmwa/partyhandler.cpp | 6 | ||||
-rw-r--r-- | src/net/tmwa/playerhandler.cpp | 26 |
10 files changed, 43 insertions, 43 deletions
diff --git a/src/net/tmwa/beinghandler.cpp b/src/net/tmwa/beinghandler.cpp index 41345acb..e3e92a0b 100644 --- a/src/net/tmwa/beinghandler.cpp +++ b/src/net/tmwa/beinghandler.cpp @@ -318,8 +318,8 @@ void BeingHandler::handleMessage(Net::MessageIn &msg) break; // If this is player's current target, clear it. - if (dstBeing == player_node->getTarget()) - player_node->stopAttack(); + if (dstBeing == local_player->getTarget()) + local_player->stopAttack(); if (msg.readInt8() == 1) dstBeing->setAction(Being::DEAD); @@ -336,8 +336,8 @@ void BeingHandler::handleMessage(Net::MessageIn &msg) break; // If this is player's current target, clear it. - if (dstBeing == player_node->getTarget()) - player_node->stopAttack(); + if (dstBeing == local_player->getTarget()) + local_player->stopAttack(); if (msg.readInt8() == 1) dstBeing->setAction(Being::STAND); @@ -356,7 +356,7 @@ void BeingHandler::handleMessage(Net::MessageIn &msg) msg.readInt16(); // Skill level msg.readInt16(); // Div msg.readInt8(); // Skill hit/type (?) - if (attackSpeed && srcBeing && srcBeing != player_node) + if (attackSpeed && srcBeing && srcBeing != local_player) srcBeing->setAttackSpeed(attackSpeed); if (dstBeing) dstBeing->takeDamage(srcBeing, param1, Being::HIT); // Perhaps a new skill attack type should be created and used? @@ -566,7 +566,7 @@ void BeingHandler::handleMessage(Net::MessageIn &msg) break; } - if (Party *party = player_node->getParty()){ + if (Party *party = local_player->getParty()){ if (party->isMember(id)) { dstBeing->setParty(party); @@ -674,7 +674,7 @@ void BeingHandler::handleMessage(Net::MessageIn &msg) */ id = msg.readInt32(); - if (mSync || id != player_node->getId()) + if (mSync || id != local_player->getId()) { dstBeing = actorSpriteManager->findBeing(id); if (dstBeing) diff --git a/src/net/tmwa/charserverhandler.cpp b/src/net/tmwa/charserverhandler.cpp index 2b7d5381..83682efe 100644 --- a/src/net/tmwa/charserverhandler.cpp +++ b/src/net/tmwa/charserverhandler.cpp @@ -153,13 +153,13 @@ void CharServerHandler::handleMessage(Net::MessageIn &msg) case SMSG_CHAR_MAP_INFO: { - msg.skip(4); // CharID, must be the same as player_node->charID + msg.skip(4); // CharID, must be the same as local_player->charID GameHandler *gh = static_cast<GameHandler*>(Net::getGameHandler()); gh->setMap(msg.readString(16)); mapServer.hostname = ipToString(msg.readInt32()); mapServer.port = msg.readInt16(); - player_node = mSelectedCharacter->dummy; + local_player = mSelectedCharacter->dummy; PlayerInfo::setBackend(mSelectedCharacter->data); // Prevent the selected local player from being deleted @@ -185,12 +185,12 @@ void CharServerHandler::handleMessage(Net::MessageIn &msg) mNetwork->disconnect(); Client::setState(STATE_CHANGE_MAP); - Map *map = player_node->getMap(); + Map *map = local_player->getMap(); const int tileWidth = map->getTileWidth(); const int tileHeight = map->getTileHeight(); - player_node->setPosition(Vector(x * tileWidth + tileWidth / 2, + local_player->setPosition(Vector(x * tileWidth + tileWidth / 2, y * tileHeight + tileHeight / 2)); - player_node->setMap(0); + local_player->setMap(0); } break; } diff --git a/src/net/tmwa/chathandler.cpp b/src/net/tmwa/chathandler.cpp index 97304c28..e1c6c6ea 100644 --- a/src/net/tmwa/chathandler.cpp +++ b/src/net/tmwa/chathandler.cpp @@ -208,8 +208,8 @@ void ChatHandler::handleMessage(Net::MessageIn &msg) Event event(Event::Player); event.setString("message", mes); event.setString("text", chatMsg); - event.setString("nick", player_node->getName()); - event.setInt("beingId", player_node->getId()); + event.setString("nick", local_player->getName()); + event.setInt("beingId", local_player->getId()); event.setInt("permissions", player_relations.getDefault() & (PlayerRelation::SPEECH_LOG | PlayerRelation::SPEECH_FLOAT)); @@ -234,7 +234,7 @@ void ChatHandler::handleMessage(Net::MessageIn &msg) void ChatHandler::talk(const std::string &text) { - std::string mes = player_node->getName() + " : " + text; + std::string mes = local_player->getName() + " : " + text; MessageOut outMsg(CMSG_CHAT_MESSAGE); // Added + 1 in order to let eAthena parse admin commands correctly diff --git a/src/net/tmwa/gamehandler.cpp b/src/net/tmwa/gamehandler.cpp index 6430b476..9e2c6fa4 100644 --- a/src/net/tmwa/gamehandler.cpp +++ b/src/net/tmwa/gamehandler.cpp @@ -113,7 +113,7 @@ void GameHandler::event(Event::Channel channel, const Event &event) const int tileHeight = map->getTileHeight(); if (mTileX && mTileY) { - player_node->setPosition(Vector(mTileX * tileWidth + tileWidth / 2, + local_player->setPosition(Vector(mTileX * tileWidth + tileWidth / 2, mTileY * tileHeight + tileHeight / 2)); mTileX = mTileY = 0; } @@ -135,9 +135,9 @@ void GameHandler::connect() if (Client::getState() == STATE_CONNECT_GAME) { - mCharID = player_node->getId(); + mCharID = local_player->getId(); // Change the player's ID to the account ID to match what eAthena uses - player_node->setId(token.account_ID); + local_player->setId(token.account_ID); } // Send login infos diff --git a/src/net/tmwa/gui/partytab.cpp b/src/net/tmwa/gui/partytab.cpp index 6833831c..660a0a59 100644 --- a/src/net/tmwa/gui/partytab.cpp +++ b/src/net/tmwa/gui/partytab.cpp @@ -200,7 +200,7 @@ bool PartyTab::handleCommand(const std::string &type, const std::string &args) void PartyTab::getAutoCompleteList(std::vector<std::string> &names) const { - Party *p = player_node->getParty(); + Party *p = local_player->getParty(); if (p) p->getNames(names); diff --git a/src/net/tmwa/guildhandler.cpp b/src/net/tmwa/guildhandler.cpp index 00167d61..ade11c9a 100644 --- a/src/net/tmwa/guildhandler.cpp +++ b/src/net/tmwa/guildhandler.cpp @@ -425,7 +425,7 @@ void GuildHandler::leave(int guildId) MessageOut msg(CMSG_GUILD_LEAVE); msg.writeInt32(guildId); msg.writeInt32(0); // Account ID - msg.writeInt32(player_node->getId()); + msg.writeInt32(local_player->getId()); msg.writeString("", 30); // Message } diff --git a/src/net/tmwa/inventoryhandler.cpp b/src/net/tmwa/inventoryhandler.cpp index 76eb85f5..191266bc 100644 --- a/src/net/tmwa/inventoryhandler.cpp +++ b/src/net/tmwa/inventoryhandler.cpp @@ -230,11 +230,11 @@ void InventoryHandler::handleMessage(Net::MessageIn &msg) unsigned char err = msg.readInt8(); if (err) { - player_node->pickedUp(itemInfo, 0, err); + local_player->pickedUp(itemInfo, 0, err); } else { - player_node->pickedUp(itemInfo, amount, PICKUP_OKAY); + local_player->pickedUp(itemInfo, amount, PICKUP_OKAY); Item *item = inventory->getItem(index); @@ -420,7 +420,7 @@ void InventoryHandler::handleMessage(Net::MessageIn &msg) { mEquips.setEquipment(getSlot(equipType), -1); // Reset the attack range to unarmed. - player_node->setAttackRange(ATTACK_RANGE_NOT_SET); + local_player->setAttackRange(ATTACK_RANGE_NOT_SET); } break; @@ -430,14 +430,14 @@ void InventoryHandler::handleMessage(Net::MessageIn &msg) Map *map = Game::instance()->getCurrentMap(); if (map) { - player_node->setAttackRange(msg.readInt16() + local_player->setAttackRange(msg.readInt16() * map->getTileWidth()); } else { logger->log("Couldn't set attacke range due to the lack" "of an initialized map."); - player_node->setAttackRange(ATTACK_RANGE_NOT_SET); + local_player->setAttackRange(ATTACK_RANGE_NOT_SET); } } break; diff --git a/src/net/tmwa/npchandler.cpp b/src/net/tmwa/npchandler.cpp index 904fe388..3a50b6d4 100644 --- a/src/net/tmwa/npchandler.cpp +++ b/src/net/tmwa/npchandler.cpp @@ -125,8 +125,8 @@ void NpcHandler::handleMessage(Net::MessageIn &msg) delete event; - if (player_node->getCurrentAction() != Being::SIT) - player_node->setAction(Being::STAND); + if (local_player->getCurrentAction() != Being::SIT) + local_player->setAction(Being::STAND); } void NpcHandler::startShopping(int beingId) diff --git a/src/net/tmwa/partyhandler.cpp b/src/net/tmwa/partyhandler.cpp index 2cfc2037..47182121 100644 --- a/src/net/tmwa/partyhandler.cpp +++ b/src/net/tmwa/partyhandler.cpp @@ -104,7 +104,7 @@ void PartyHandler::handleMessage(Net::MessageIn &msg) member->setOnline(online); } - player_node->setParty(taParty); + local_player->setParty(taParty); } break; case SMSG_PARTY_INVITE_RESPONSE: @@ -229,7 +229,7 @@ void PartyHandler::handleMessage(Net::MessageIn &msg) int id = msg.readInt32(); std::string nick = msg.readString(24); msg.readInt8(); // fail - if (id == player_node->getId()) + if (id == local_player->getId()) { taParty->removeFromMembers(); taParty->clearMembers(); @@ -344,7 +344,7 @@ void PartyHandler::invite(const std::string &name) void PartyHandler::inviteResponse(const std::string &inviter, bool accept) { MessageOut outMsg(CMSG_PARTY_INVITED); - outMsg.writeInt32(player_node->getId()); + outMsg.writeInt32(local_player->getId()); outMsg.writeInt32(accept ? 1 : 0); } diff --git a/src/net/tmwa/playerhandler.cpp b/src/net/tmwa/playerhandler.cpp index a6f80d0b..ad27a868 100644 --- a/src/net/tmwa/playerhandler.cpp +++ b/src/net/tmwa/playerhandler.cpp @@ -161,7 +161,7 @@ PlayerHandler::PlayerHandler() void PlayerHandler::handleMessage(Net::MessageIn &msg) { - if (!player_node) + if (!local_player) return; switch (msg.getId()) @@ -186,7 +186,7 @@ void PlayerHandler::handleMessage(Net::MessageIn &msg) * We must clear the local player's target *before* the call * to changeMap, as it deletes all beings. */ - player_node->stopAttack(); + local_player->stopAttack(); Game *game = Game::instance(); @@ -202,8 +202,8 @@ void PlayerHandler::handleMessage(Net::MessageIn &msg) /* Scroll if necessary */ Map *map = game->getCurrentMap(); - int tileX = player_node->getTileX(); - int tileY = player_node->getTileY(); + int tileX = local_player->getTileX(); + int tileY = local_player->getTileY(); if (!sameMap || (abs(x - tileX) > MAP_TELEPORT_SCROLL_DISTANCE) || (abs(y - tileY) > MAP_TELEPORT_SCROLL_DISTANCE)) @@ -212,11 +212,11 @@ void PlayerHandler::handleMessage(Net::MessageIn &msg) scrollOffsetY = (y - tileY) * map->getTileHeight(); } - player_node->setAction(Being::STAND); + local_player->setAction(Being::STAND); Vector pos = map->getTileCenter(x, y); - player_node->setPosition(pos); + local_player->setPosition(pos); // Stop movement - player_node->setDestination(pos.x, pos.y); + local_player->setDestination(pos.x, pos.y); logger->log("Adjust scrolling by %d:%d", (int) scrollOffsetX, (int) scrollOffsetY); @@ -227,7 +227,7 @@ void PlayerHandler::handleMessage(Net::MessageIn &msg) case SMSG_PLAYER_STAT_UPDATE_1: { - if (!player_node) + if (!local_player) break; int type = msg.readInt16(); int value = msg.readInt32(); @@ -235,7 +235,7 @@ void PlayerHandler::handleMessage(Net::MessageIn &msg) switch (type) { case 0x0000: - player_node->setMoveSpeed(Vector(value / 10, + local_player->setMoveSpeed(Vector(value / 10, value / 10, 0)); break; case 0x0004: break; // manner @@ -281,11 +281,11 @@ void PlayerHandler::handleMessage(Net::MessageIn &msg) case 0x0034: PlayerInfo::setStatBase(CRIT, value); break; - case 0x0035: player_node->setAttackSpeed(value); break; + case 0x0035: local_player->setAttackSpeed(value); break; case 0x0037: PlayerInfo::setStatBase(JOB, value); break; - case 500: player_node->setGMLevel(value); break; + case 500: local_player->setGMLevel(value); break; } if (PlayerInfo::getAttribute(HP) == 0 && !deathNotice) @@ -295,7 +295,7 @@ void PlayerHandler::handleMessage(Net::MessageIn &msg) randomDeathMessage(), false); deathNotice->addActionListener(&deathListener); - player_node->setAction(Being::DEAD); + local_player->setAction(Being::DEAD); } } @@ -329,7 +329,7 @@ void PlayerHandler::handleMessage(Net::MessageIn &msg) Units::formatCurrency(newMoney - oldMoney).c_str())) if (config.getBoolValue("showpickupparticle")) - player_node->addMessageToQueue(money, + local_player->addMessageToQueue(money, UserPalette::PICKUP_INFO); } } |