diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-07-30 12:25:16 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-07-30 12:25:16 +0300 |
commit | 1680d159ecbf75591d2dab1416ff8144c27d4de5 (patch) | |
tree | cd34ad27487036265f08d7aa63476c160280d899 /src/net/ea | |
parent | 9913b4b481ddcaf0fa8499f3554c85bb588be7f0 (diff) | |
download | manaverse-1680d159ecbf75591d2dab1416ff8144c27d4de5.tar.gz manaverse-1680d159ecbf75591d2dab1416ff8144c27d4de5.tar.bz2 manaverse-1680d159ecbf75591d2dab1416ff8144c27d4de5.tar.xz manaverse-1680d159ecbf75591d2dab1416ff8144c27d4de5.zip |
Rename player_node variable into localPlayer.
Diffstat (limited to 'src/net/ea')
-rw-r--r-- | src/net/ea/beinghandler.cpp | 62 | ||||
-rw-r--r-- | src/net/ea/charserverhandler.cpp | 10 | ||||
-rw-r--r-- | src/net/ea/chathandler.cpp | 4 | ||||
-rw-r--r-- | src/net/ea/gamehandler.cpp | 4 | ||||
-rw-r--r-- | src/net/ea/gui/partytab.cpp | 4 | ||||
-rw-r--r-- | src/net/ea/guildhandler.cpp | 18 | ||||
-rw-r--r-- | src/net/ea/inventoryhandler.cpp | 24 | ||||
-rw-r--r-- | src/net/ea/partyhandler.cpp | 24 | ||||
-rw-r--r-- | src/net/ea/playerhandler.cpp | 58 | ||||
-rw-r--r-- | src/net/ea/skillhandler.cpp | 4 |
10 files changed, 106 insertions, 106 deletions
diff --git a/src/net/ea/beinghandler.cpp b/src/net/ea/beinghandler.cpp index f5df5c55c..8750efcf0 100644 --- a/src/net/ea/beinghandler.cpp +++ b/src/net/ea/beinghandler.cpp @@ -87,8 +87,8 @@ Being *BeingHandler::createBeing(const int id, const int16_t job) const { being->updateFromCache(); requestNameById(id); - if (player_node) - player_node->checkNewName(being); + if (localPlayer) + localPlayer->checkNewName(being); } if (type == ActorType::PLAYER) { @@ -141,7 +141,7 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg, statusEffects |= (static_cast<uint32_t>(msg.readInt16())) << 16; // option const int16_t job = msg.readInt16(); // class int disguiseId = 0; - if (id == player_node->getId() && job >= 1000) + if (id == localPlayer->getId() && job >= 1000) disguiseId = job; Being *dstBeing = actorManager->findBeing(id); @@ -212,8 +212,8 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg, const uint8_t hairStyle = msg.readUInt8(); const uint8_t look = msg.readUInt8(); dstBeing->setSubtype(job, look); - if (dstBeing->getType() == ActorType::MONSTER && player_node) - player_node->checkNewName(dstBeing); + if (dstBeing->getType() == ActorType::MONSTER && localPlayer) + localPlayer->checkNewName(dstBeing); dstBeing->setWalkSpeed(Vector(speed, speed, 0)); const uint16_t weapon = msg.readInt16(); const uint16_t headBottom = msg.readInt16(); @@ -412,7 +412,7 @@ void BeingHandler::processBeingSpawn(Net::MessageIn &msg) void BeingHandler::processBeingRemove(Net::MessageIn &msg) const { BLOCK_START("BeingHandler::processBeingRemove") - if (!actorManager || !player_node) + if (!actorManager || !localPlayer) { BLOCK_END("BeingHandler::processBeingRemove") return; @@ -428,12 +428,12 @@ void BeingHandler::processBeingRemove(Net::MessageIn &msg) const return; } - player_node->followMoveTo(dstBeing, player_node->getNextDestX(), - player_node->getNextDestY()); + localPlayer->followMoveTo(dstBeing, localPlayer->getNextDestX(), + localPlayer->getNextDestY()); // If this is player's current target, clear it. - if (dstBeing == player_node->getTarget()) - player_node->stopAttack(true); + if (dstBeing == localPlayer->getTarget()) + localPlayer->stopAttack(true); if (msg.readUInt8() == 1U) { @@ -462,7 +462,7 @@ void BeingHandler::processBeingRemove(Net::MessageIn &msg) const void BeingHandler::processBeingResurrect(Net::MessageIn &msg) const { BLOCK_START("BeingHandler::processBeingResurrect") - if (!actorManager || !player_node) + if (!actorManager || !localPlayer) { BLOCK_END("BeingHandler::processBeingResurrect") return; @@ -479,8 +479,8 @@ void BeingHandler::processBeingResurrect(Net::MessageIn &msg) const } // If this is player's current target, clear it. - if (dstBeing == player_node->getTarget()) - player_node->stopAttack(); + if (dstBeing == localPlayer->getTarget()) + localPlayer->stopAttack(); if (msg.readUInt8() == 1U) dstBeing->setAction(BeingAction::STAND, 0); @@ -569,8 +569,8 @@ void BeingHandler::processBeingAction(Net::MessageIn &msg) const if (srcBeing->getType() == ActorType::PLAYER) { srcBeing->setMoveTime(); - if (player_node) - player_node->imitateAction(srcBeing, BeingAction::SIT); + if (localPlayer) + localPlayer->imitateAction(srcBeing, BeingAction::SIT); } } break; @@ -582,9 +582,9 @@ void BeingHandler::processBeingAction(Net::MessageIn &msg) const if (srcBeing->getType() == ActorType::PLAYER) { srcBeing->setMoveTime(); - if (player_node) + if (localPlayer) { - player_node->imitateAction(srcBeing, + localPlayer->imitateAction(srcBeing, BeingAction::STAND); } } @@ -636,7 +636,7 @@ void BeingHandler::processBeingSelfEffect(Net::MessageIn &msg) const void BeingHandler::processBeingEmotion(Net::MessageIn &msg) const { BLOCK_START("BeingHandler::processBeingEmotion") - if (!player_node || !actorManager) + if (!localPlayer || !actorManager) { BLOCK_END("BeingHandler::processBeingEmotion") return; @@ -655,7 +655,7 @@ void BeingHandler::processBeingEmotion(Net::MessageIn &msg) const if (emote) { dstBeing->setEmote(emote, 0); - player_node->imitateEmote(dstBeing, emote); + localPlayer->imitateEmote(dstBeing, emote); } } if (dstBeing->getType() == ActorType::PLAYER) @@ -666,7 +666,7 @@ void BeingHandler::processBeingEmotion(Net::MessageIn &msg) const void BeingHandler::processNameResponse(Net::MessageIn &msg) const { BLOCK_START("BeingHandler::processNameResponse") - if (!player_node || !actorManager) + if (!localPlayer || !actorManager) { BLOCK_END("BeingHandler::processNameResponse") return; @@ -677,9 +677,9 @@ void BeingHandler::processNameResponse(Net::MessageIn &msg) const if (dstBeing) { - if (beingId == player_node->getId()) + if (beingId == localPlayer->getId()) { - player_node->pingResponse(); + localPlayer->pingResponse(); } else { @@ -690,9 +690,9 @@ void BeingHandler::processNameResponse(Net::MessageIn &msg) const if (dstBeing->getType() == ActorType::PLAYER) dstBeing->updateColors(); - if (player_node) + if (localPlayer) { - const Party *const party = player_node->getParty(); + const Party *const party = localPlayer->getParty(); if (party && party->isMember(dstBeing->getId())) { PartyMember *const member = party->getMember( @@ -701,7 +701,7 @@ void BeingHandler::processNameResponse(Net::MessageIn &msg) const if (member) member->setName(dstBeing->getName()); } - player_node->checkNewName(dstBeing); + localPlayer->checkNewName(dstBeing); } } } @@ -773,15 +773,15 @@ void BeingHandler::processBeingChangeDirection(Net::MessageIn &msg) const const uint8_t dir = static_cast<uint8_t>(msg.readUInt8() & 0x0FU); dstBeing->setDirection(dir); - if (player_node) - player_node->imitateDirection(dstBeing, dir); + if (localPlayer) + localPlayer->imitateDirection(dstBeing, dir); BLOCK_END("BeingHandler::processBeingChangeDirection") } void BeingHandler::processPlayerStop(Net::MessageIn &msg) const { BLOCK_START("BeingHandler::processPlayerStop") - if (!actorManager || !player_node) + if (!actorManager || !localPlayer) { BLOCK_END("BeingHandler::processPlayerStop") return; @@ -789,7 +789,7 @@ void BeingHandler::processPlayerStop(Net::MessageIn &msg) const const int id = msg.readInt32(); - if (mSync || id != player_node->getId()) + if (mSync || id != localPlayer->getId()) { Being *const dstBeing = actorManager->findBeing(id); if (dstBeing) @@ -814,8 +814,8 @@ void BeingHandler::processPlayerMoveToAttack(Net::MessageIn &msg A_UNUSED) * a target (out of range, obstruction in line of fire). * We can safely ignore this... */ - if (player_node) - player_node->fixAttackTarget(); + if (localPlayer) + localPlayer->fixAttackTarget(); BLOCK_END("BeingHandler::processPlayerStop") } diff --git a/src/net/ea/charserverhandler.cpp b/src/net/ea/charserverhandler.cpp index a0358dbb4..bb89a10e6 100644 --- a/src/net/ea/charserverhandler.cpp +++ b/src/net/ea/charserverhandler.cpp @@ -241,7 +241,7 @@ void CharServerHandler::processCharMapInfo(Net::MessageIn &restrict msg, ServerInfo &restrict server) { BLOCK_START("CharServerHandler::processCharMapInfo") -// msg.skip(4); // CharID, must be the same as player_node->charID +// msg.skip(4); // CharID, must be the same as localPlayer->charID PlayerInfo::setCharId(msg.readInt32()); GameHandler *const gh = static_cast<GameHandler*>(Net::getGameHandler()); gh->setMap(msg.readString(16)); @@ -257,7 +257,7 @@ void CharServerHandler::processCharMapInfo(Net::MessageIn &restrict msg, server.port = msg.readInt16(); // Prevent the selected local player from being deleted - player_node = mSelectedCharacter->dummy; + localPlayer = mSelectedCharacter->dummy; PlayerInfo::setBackend(mSelectedCharacter->data); mSelectedCharacter->dummy = nullptr; @@ -291,10 +291,10 @@ void CharServerHandler::processChangeMapServer(Net::MessageIn &restrict msg, network->disconnect(); client->setState(STATE_CHANGE_MAP); - if (player_node) + if (localPlayer) { - player_node->setTileCoords(x, y); - player_node->setMap(nullptr); + localPlayer->setTileCoords(x, y); + localPlayer->setMap(nullptr); } BLOCK_END("CharServerHandler::processChangeMapServer") } diff --git a/src/net/ea/chathandler.cpp b/src/net/ea/chathandler.cpp index 4bbff5081..2f7e0f661 100644 --- a/src/net/ea/chathandler.cpp +++ b/src/net/ea/chathandler.cpp @@ -401,10 +401,10 @@ void ChatHandler::processChat(Net::MessageIn &msg, const bool normalChat, trim(chatMsg); - if (player_node) + if (localPlayer) { if ((chatWindow || mShowMotd) && allow) - player_node->setSpeech(chatMsg, channel); + localPlayer->setSpeech(chatMsg, channel); } } else if (localChatTab) diff --git a/src/net/ea/gamehandler.cpp b/src/net/ea/gamehandler.cpp index 028ad8937..244b2190f 100644 --- a/src/net/ea/gamehandler.cpp +++ b/src/net/ea/gamehandler.cpp @@ -70,8 +70,8 @@ void GameHandler::processMapLogin(Net::MessageIn &msg) const // Switch now or we'll have problems client->setState(STATE_GAME); - if (player_node) - player_node->setTileCoords(x, y); + if (localPlayer) + localPlayer->setTileCoords(x, y); } void GameHandler::processWhoAnswer(Net::MessageIn &msg) const diff --git a/src/net/ea/gui/partytab.cpp b/src/net/ea/gui/partytab.cpp index 15ef5fc80..dfb4b9dcc 100644 --- a/src/net/ea/gui/partytab.cpp +++ b/src/net/ea/gui/partytab.cpp @@ -206,10 +206,10 @@ bool PartyTab::handleCommand(const std::string &restrict type, void PartyTab::getAutoCompleteList(StringVect &names) const { - if (!player_node) + if (!localPlayer) return; - const Party *const p = player_node->getParty(); + const Party *const p = localPlayer->getParty(); if (p) p->getNames(names); diff --git a/src/net/ea/guildhandler.cpp b/src/net/ea/guildhandler.cpp index 42c6b0ec5..de1d2763c 100644 --- a/src/net/ea/guildhandler.cpp +++ b/src/net/ea/guildhandler.cpp @@ -127,15 +127,15 @@ void GuildHandler::processGuildPositionInfo(Net::MessageIn &msg) const guildTab = new GuildTab(chatWindow); if (config.getBoolValue("showChatHistory")) guildTab->loadFromLogFile("#Guild"); - if (player_node) - player_node->addGuild(taGuild); + if (localPlayer) + localPlayer->addGuild(taGuild); memberList(guildId); } - if (player_node) + if (localPlayer) { - player_node->setGuild(g); - player_node->setGuildName(g->getName()); + localPlayer->setGuild(g); + localPlayer->setGuildName(g->getName()); } logger->log("Guild position info: %d %d %d %s\n", guildId, @@ -457,10 +457,10 @@ void GuildHandler::processGuildLeave(Net::MessageIn &msg) const if (taGuild) taGuild->removeMember(nick); - if (!player_node) + if (!localPlayer) return; - if (nick == player_node->getName()) + if (nick == localPlayer->getName()) { if (taGuild) { @@ -500,10 +500,10 @@ void GuildHandler::processGuildExpulsion(Net::MessageIn &msg) const if (taGuild) taGuild->removeMember(nick); - if (!player_node) + if (!localPlayer) return; - if (nick == player_node->getName()) + if (nick == localPlayer->getName()) { if (taGuild) { diff --git a/src/net/ea/inventoryhandler.cpp b/src/net/ea/inventoryhandler.cpp index b7c827a4d..432f4eb5c 100644 --- a/src/net/ea/inventoryhandler.cpp +++ b/src/net/ea/inventoryhandler.cpp @@ -177,7 +177,7 @@ void InventoryHandler::processPlayerInventory(Net::MessageIn &msg, const bool playerInvintory) { BLOCK_START("InventoryHandler::processPlayerInventory") - Inventory *const inventory = player_node + Inventory *const inventory = localPlayer ? PlayerInfo::getInventory() : nullptr; if (playerInvintory) { @@ -286,7 +286,7 @@ void InventoryHandler::processPlayerStorageEquip(Net::MessageIn &msg) void InventoryHandler::processPlayerInventoryAdd(Net::MessageIn &msg) { BLOCK_START("InventoryHandler::processPlayerInventoryAdd") - Inventory *const inventory = player_node + Inventory *const inventory = localPlayer ? PlayerInfo::getInventory() : nullptr; if (PlayerInfo::getEquipment() @@ -321,14 +321,14 @@ void InventoryHandler::processPlayerInventoryAdd(Net::MessageIn &msg) if (err) { - if (player_node) - player_node->pickedUp(itemInfo, 0, identified, floorId, err); + if (localPlayer) + localPlayer->pickedUp(itemInfo, 0, identified, floorId, err); } else { - if (player_node) + if (localPlayer) { - player_node->pickedUp(itemInfo, amount, + localPlayer->pickedUp(itemInfo, amount, identified, floorId, Pickup::OKAY); } @@ -353,7 +353,7 @@ void InventoryHandler::processPlayerInventoryAdd(Net::MessageIn &msg) void InventoryHandler::processPlayerInventoryRemove(Net::MessageIn &msg) { BLOCK_START("InventoryHandler::processPlayerInventoryRemove") - Inventory *const inventory = player_node + Inventory *const inventory = localPlayer ? PlayerInfo::getInventory() : nullptr; const int index = msg.readInt16() - INVENTORY_OFFSET; @@ -374,7 +374,7 @@ void InventoryHandler::processPlayerInventoryRemove(Net::MessageIn &msg) void InventoryHandler::processPlayerInventoryUse(Net::MessageIn &msg) { BLOCK_START("InventoryHandler::processPlayerInventoryUse") - Inventory *const inventory = player_node + Inventory *const inventory = localPlayer ? PlayerInfo::getInventory() : nullptr; const int index = msg.readInt16() - INVENTORY_OFFSET; @@ -399,7 +399,7 @@ void InventoryHandler::processPlayerInventoryUse(Net::MessageIn &msg) void InventoryHandler::processItemUseResponse(Net::MessageIn &msg) { BLOCK_START("InventoryHandler::processItemUseResponse") - Inventory *const inventory = player_node + Inventory *const inventory = localPlayer ? PlayerInfo::getInventory() : nullptr; const int index = msg.readInt16() - INVENTORY_OFFSET; @@ -526,7 +526,7 @@ void InventoryHandler::processPlayerStorageClose(Net::MessageIn &msg A_UNUSED) void InventoryHandler::processPlayerEquipment(Net::MessageIn &msg) { BLOCK_START("InventoryHandler::processPlayerEquipment") - Inventory *const inventory = player_node + Inventory *const inventory = localPlayer ? PlayerInfo::getInventory() : nullptr; msg.readInt16(); // length @@ -604,8 +604,8 @@ void InventoryHandler::processPlayerAttackRange(Net::MessageIn &msg) { BLOCK_START("InventoryHandler::processPlayerAttackRange") const int range = msg.readInt16(); - if (player_node) - player_node->setAttackRange(range); + if (localPlayer) + localPlayer->setAttackRange(range); PlayerInfo::setStatBase(Attributes::ATTACK_RANGE, range); PlayerInfo::setStatMod(Attributes::ATTACK_RANGE, 0); BLOCK_END("InventoryHandler::processPlayerAttackRange") diff --git a/src/net/ea/partyhandler.cpp b/src/net/ea/partyhandler.cpp index 2b83d9eb8..d1e682e43 100644 --- a/src/net/ea/partyhandler.cpp +++ b/src/net/ea/partyhandler.cpp @@ -103,12 +103,12 @@ void PartyHandler::processPartyInfo(Net::MessageIn &msg) const if ((*it)->getOnline()) onlineNames.insert((*it)->getName()); } - onlineNames.insert(player_node->getName()); + onlineNames.insert(localPlayer->getName()); } } - if (!player_node) - logger->log1("error: player_node==0 in SMSG_PARTY_INFO"); + if (!localPlayer) + logger->log1("error: localPlayer==0 in SMSG_PARTY_INFO"); if (Ea::taParty) Ea::taParty->clearMembers(); @@ -118,10 +118,10 @@ void PartyHandler::processPartyInfo(Net::MessageIn &msg) const Ea::taParty->setName(msg.readString(24)); const int count = (length - 28) / 46; - if (player_node && Ea::taParty) + if (localPlayer && Ea::taParty) { - player_node->setParty(Ea::taParty); - player_node->setPartyName(Ea::taParty->getName()); + localPlayer->setParty(Ea::taParty); + localPlayer->setPartyName(Ea::taParty->getName()); } for (int i = 0; i < count; i++) @@ -175,10 +175,10 @@ void PartyHandler::processPartyInfo(Net::MessageIn &msg) const if (Ea::taParty) Ea::taParty->sort(); - if (player_node && Ea::taParty) + if (localPlayer && Ea::taParty) { - player_node->setParty(Ea::taParty); - player_node->setPartyName(Ea::taParty->getName()); + localPlayer->setParty(Ea::taParty); + localPlayer->setPartyName(Ea::taParty->getName()); if (socialWindow) socialWindow->updateParty(); } @@ -339,10 +339,10 @@ void PartyHandler::processPartyLeave(Net::MessageIn &msg) const const int id = msg.readInt32(); const std::string nick = msg.readString(24); msg.readUInt8(); // fail - if (!player_node) + if (!localPlayer) return; - if (id == player_node->getId()) + if (id == localPlayer->getId()) { if (Ea::taParty) { @@ -354,7 +354,7 @@ void PartyHandler::processPartyLeave(Net::MessageIn &msg) const if (socialWindow && Ea::taParty) socialWindow->removeTab(Ea::taParty); - player_node->setPartyName(""); + localPlayer->setPartyName(""); } else { diff --git a/src/net/ea/playerhandler.cpp b/src/net/ea/playerhandler.cpp index 28f9bf876..4f5200573 100644 --- a/src/net/ea/playerhandler.cpp +++ b/src/net/ea/playerhandler.cpp @@ -110,8 +110,8 @@ void PlayerHandler::processWalkResponse(Net::MessageIn &msg) uint16_t srcX, srcY, dstX, dstY; msg.readInt32(); // tick msg.readCoordinatePair(srcX, srcY, dstX, dstY); - if (player_node) - player_node->setRealPos(dstX, dstY); + if (localPlayer) + localPlayer->setRealPos(dstX, dstY); BLOCK_END("PlayerHandler::processWalkResponse") } @@ -124,15 +124,15 @@ void PlayerHandler::processPlayerWarp(Net::MessageIn &msg) logger->log("Warping to %s (%d, %d)", mapPath.c_str(), x, y); - if (!player_node) - logger->log1("SMSG_PLAYER_WARP player_node null"); + if (!localPlayer) + logger->log1("SMSG_PLAYER_WARP localPlayer null"); /* * We must clear the local player's target *before* the call * to changeMap, as it deletes all beings. */ - if (player_node) - player_node->stopAttack(); + if (localPlayer) + localPlayer->stopAttack(); Game *const game = Game::instance(); @@ -146,7 +146,7 @@ void PlayerHandler::processPlayerWarp(Net::MessageIn &msg) int scrollOffsetX = 0; int scrollOffsetY = 0; - if (player_node) + if (localPlayer) { const Map *const map = game->getCurrentMap(); if (map) @@ -161,22 +161,22 @@ void PlayerHandler::processPlayerWarp(Net::MessageIn &msg) y = 0; /* Scroll if neccessary */ if (!sameMap - || (abs(x - player_node->getTileX()) + || (abs(x - localPlayer->getTileX()) > MAP_TELEPORT_SCROLL_DISTANCE) - || (abs(y - player_node->getTileY()) + || (abs(y - localPlayer->getTileY()) > MAP_TELEPORT_SCROLL_DISTANCE)) { - scrollOffsetX = (x - player_node->getTileX()) + scrollOffsetX = (x - localPlayer->getTileX()) * map->getTileWidth(); - scrollOffsetY = (y - player_node->getTileY()) + scrollOffsetY = (y - localPlayer->getTileY()) * map->getTileHeight(); } } - player_node->setAction(BeingAction::STAND, 0); - player_node->setTileCoords(x, y); - player_node->updatePets(); - player_node->navigateClean(); + localPlayer->setAction(BeingAction::STAND, 0); + localPlayer->setTileCoords(x, y); + localPlayer->updatePets(); + localPlayer->navigateClean(); } logger->log("Adjust scrolling by %d:%d", scrollOffsetX, scrollOffsetY); @@ -194,7 +194,7 @@ void PlayerHandler::processPlayerStatUpdate1(Net::MessageIn &msg) BLOCK_START("PlayerHandler::processPlayerStatUpdate1") const int type = msg.readInt16(); const int value = msg.readInt32(); - if (!player_node) + if (!localPlayer) { BLOCK_END("PlayerHandler::processPlayerStatUpdate1") return; @@ -203,7 +203,7 @@ void PlayerHandler::processPlayerStatUpdate1(Net::MessageIn &msg) switch (type) { case 0x0000: - player_node->setWalkSpeed(Vector(static_cast<float>( + localPlayer->setWalkSpeed(Vector(static_cast<float>( value), static_cast<float>(value), 0)); PlayerInfo::setStatBase(Attributes::WALK_SPEED, value); PlayerInfo::setStatMod(Attributes::WALK_SPEED, 0); @@ -212,10 +212,10 @@ void PlayerHandler::processPlayerStatUpdate1(Net::MessageIn &msg) break; // manner case 0x0005: PlayerInfo::setAttribute(Attributes::HP, value); - if (player_node->isInParty() && Party::getParty(1)) + if (localPlayer->isInParty() && Party::getParty(1)) { PartyMember *const m = Party::getParty(1) - ->getMember(player_node->getId()); + ->getMember(localPlayer->getId()); if (m) { m->setHp(value); @@ -226,10 +226,10 @@ void PlayerHandler::processPlayerStatUpdate1(Net::MessageIn &msg) case 0x0006: PlayerInfo::setAttribute(Attributes::MAX_HP, value); - if (player_node->isInParty() && Party::getParty(1)) + if (localPlayer->isInParty() && Party::getParty(1)) { PartyMember *const m = Party::getParty(1)->getMember( - player_node->getId()); + localPlayer->getId()); if (m) { m->setHp(PlayerInfo::getAttribute(Attributes::HP)); @@ -248,10 +248,10 @@ void PlayerHandler::processPlayerStatUpdate1(Net::MessageIn &msg) break; case 0x000b: PlayerInfo::setAttribute(Attributes::LEVEL, value); - if (player_node) + if (localPlayer) { - player_node->setLevel(value); - player_node->updateName(); + localPlayer->setLevel(value); + localPlayer->updateName(); } break; case 0x000c: @@ -343,7 +343,7 @@ void PlayerHandler::processPlayerStatUpdate1(Net::MessageIn &msg) break; case 0x0035: - player_node->setAttackSpeed(value); + localPlayer->setAttackSpeed(value); PlayerInfo::setStatBase(Attributes::ATTACK_DELAY, value); PlayerInfo::setStatMod(Attributes::ATTACK_DELAY, 0); PlayerInfo::updateAttrs(); @@ -354,7 +354,7 @@ void PlayerHandler::processPlayerStatUpdate1(Net::MessageIn &msg) break; case 500: - player_node->setGMLevel(value); + localPlayer->setGMLevel(value); break; default: @@ -369,10 +369,10 @@ void PlayerHandler::processPlayerStatUpdate1(Net::MessageIn &msg) deathNotice = new OkDialog(_("Message"), DeadDB::getRandomString(), DialogType::OK, false); deathNotice->addActionListener(&deathListener); - if (player_node->getCurrentAction() != BeingAction::DEAD) + if (localPlayer->getCurrentAction() != BeingAction::DEAD) { - player_node->setAction(BeingAction::DEAD, 0); - player_node->recalcSpritesOrder(); + localPlayer->setAction(BeingAction::DEAD, 0); + localPlayer->recalcSpritesOrder(); } } BLOCK_END("PlayerHandler::processPlayerStatUpdate1") diff --git a/src/net/ea/skillhandler.cpp b/src/net/ea/skillhandler.cpp index e7ac66d7a..59e8f75e8 100644 --- a/src/net/ea/skillhandler.cpp +++ b/src/net/ea/skillhandler.cpp @@ -142,10 +142,10 @@ void SkillHandler::processSkillFailed(Net::MessageIn &msg) if (success == static_cast<int>(SKILL_FAILED) && skillId == static_cast<int>(SKILL_BASIC)) { - if (player_node && bskill == static_cast<int>(BSKILL_EMOTE) + if (localPlayer && bskill == static_cast<int>(BSKILL_EMOTE) && reason == static_cast<int>(RFAIL_SKILLDEP)) { - player_node->stopAdvert(); + localPlayer->stopAdvert(); } switch (bskill) |