summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-07-30 12:25:16 +0300
committerAndrei Karas <akaras@inbox.ru>2014-07-30 12:25:16 +0300
commit1680d159ecbf75591d2dab1416ff8144c27d4de5 (patch)
treecd34ad27487036265f08d7aa63476c160280d899 /src/net
parent9913b4b481ddcaf0fa8499f3554c85bb588be7f0 (diff)
downloadmanaverse-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')
-rw-r--r--src/net/ea/beinghandler.cpp62
-rw-r--r--src/net/ea/charserverhandler.cpp10
-rw-r--r--src/net/ea/chathandler.cpp4
-rw-r--r--src/net/ea/gamehandler.cpp4
-rw-r--r--src/net/ea/gui/partytab.cpp4
-rw-r--r--src/net/ea/guildhandler.cpp18
-rw-r--r--src/net/ea/inventoryhandler.cpp24
-rw-r--r--src/net/ea/partyhandler.cpp24
-rw-r--r--src/net/ea/playerhandler.cpp58
-rw-r--r--src/net/ea/skillhandler.cpp4
-rw-r--r--src/net/eathena/beinghandler.cpp64
-rw-r--r--src/net/eathena/chathandler.cpp4
-rw-r--r--src/net/eathena/gamehandler.cpp10
-rw-r--r--src/net/eathena/guildhandler.cpp8
-rw-r--r--src/net/eathena/npchandler.cpp4
-rw-r--r--src/net/eathena/partyhandler.cpp4
-rw-r--r--src/net/tmwa/beinghandler.cpp60
-rw-r--r--src/net/tmwa/chathandler.cpp4
-rw-r--r--src/net/tmwa/gamehandler.cpp10
-rw-r--r--src/net/tmwa/guildhandler.cpp8
-rw-r--r--src/net/tmwa/npchandler.cpp4
-rw-r--r--src/net/tmwa/partyhandler.cpp4
22 files changed, 198 insertions, 198 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)
diff --git a/src/net/eathena/beinghandler.cpp b/src/net/eathena/beinghandler.cpp
index d44b2508b..fe153a474 100644
--- a/src/net/eathena/beinghandler.cpp
+++ b/src/net/eathena/beinghandler.cpp
@@ -290,7 +290,7 @@ void BeingHandler::processBeingChangeLook(Net::MessageIn &msg,
if (dstBeing->getType() == ActorType::PLAYER)
dstBeing->setOtherTime();
- if (!player_node)
+ if (!localPlayer)
return;
switch (type)
@@ -305,22 +305,22 @@ void BeingHandler::processBeingChangeLook(Net::MessageIn &msg,
dstBeing->setSprite(SPRITE_WEAPON, id, "", 1, true);
if (!mHideShield)
dstBeing->setSprite(SPRITE_SHIELD, id2);
- player_node->imitateOutfit(dstBeing, SPRITE_SHIELD);
+ localPlayer->imitateOutfit(dstBeing, SPRITE_SHIELD);
break;
case 3: // Change lower headgear for eAthena, pants for us
dstBeing->setSprite(SPRITE_BOTTOMCLOTHES, id, color,
static_cast<unsigned char>(id2));
- player_node->imitateOutfit(dstBeing, SPRITE_BOTTOMCLOTHES);
+ localPlayer->imitateOutfit(dstBeing, SPRITE_BOTTOMCLOTHES);
break;
case 4: // Change upper headgear for eAthena, hat for us
dstBeing->setSprite(SPRITE_HAT, id, color,
static_cast<unsigned char>(id2));
- player_node->imitateOutfit(dstBeing, SPRITE_HAT);
+ localPlayer->imitateOutfit(dstBeing, SPRITE_HAT);
break;
case 5: // Change middle headgear for eathena, armor for us
dstBeing->setSprite(SPRITE_TOPCLOTHES, id, color,
static_cast<unsigned char>(id2));
- player_node->imitateOutfit(dstBeing, SPRITE_TOPCLOTHES);
+ localPlayer->imitateOutfit(dstBeing, SPRITE_TOPCLOTHES);
break;
case 6: // eAthena LOOK_HAIR_COLOR
dstBeing->setSpriteColor(SPRITE_HAIR, ItemDB::get(
@@ -335,42 +335,42 @@ void BeingHandler::processBeingChangeLook(Net::MessageIn &msg,
dstBeing->setSprite(SPRITE_SHIELD, id, color,
static_cast<unsigned char>(id2));
}
- player_node->imitateOutfit(dstBeing, SPRITE_SHIELD);
+ localPlayer->imitateOutfit(dstBeing, SPRITE_SHIELD);
break;
case 9: // eAthena LOOK_SHOES
dstBeing->setSprite(SPRITE_SHOE, id, color,
static_cast<unsigned char>(id2));
- player_node->imitateOutfit(dstBeing, SPRITE_SHOE);
+ localPlayer->imitateOutfit(dstBeing, SPRITE_SHOE);
break;
case 10: // LOOK_GLOVES
dstBeing->setSprite(SPRITE_GLOVES, id, color,
static_cast<unsigned char>(id2));
- player_node->imitateOutfit(dstBeing, SPRITE_GLOVES);
+ localPlayer->imitateOutfit(dstBeing, SPRITE_GLOVES);
break;
case 11: // LOOK_CAPE
dstBeing->setSprite(SPRITE_CAPE, id, color,
static_cast<unsigned char>(id2));
- player_node->imitateOutfit(dstBeing, SPRITE_CAPE);
+ localPlayer->imitateOutfit(dstBeing, SPRITE_CAPE);
break;
case 12:
dstBeing->setSprite(SPRITE_MISC1, id, color,
static_cast<unsigned char>(id2));
- player_node->imitateOutfit(dstBeing, SPRITE_MISC1);
+ localPlayer->imitateOutfit(dstBeing, SPRITE_MISC1);
break;
case 13:
dstBeing->setSprite(SPRITE_MISC2, id, color,
static_cast<unsigned char>(id2));
- player_node->imitateOutfit(dstBeing, SPRITE_MISC2);
+ localPlayer->imitateOutfit(dstBeing, SPRITE_MISC2);
break;
case 14:
dstBeing->setSprite(SPRITE_EVOL1, id, color,
static_cast<unsigned char>(id2));
- player_node->imitateOutfit(dstBeing, SPRITE_EVOL1);
+ localPlayer->imitateOutfit(dstBeing, SPRITE_EVOL1);
break;
case 15:
dstBeing->setSprite(SPRITE_EVOL2, id, color,
static_cast<unsigned char>(id2));
- player_node->imitateOutfit(dstBeing, SPRITE_EVOL2);
+ localPlayer->imitateOutfit(dstBeing, SPRITE_EVOL2);
break;
default:
logger->log("QQQ3 CHANGE_LOOKS: unsupported type: "
@@ -383,7 +383,7 @@ void BeingHandler::processBeingChangeLook(Net::MessageIn &msg,
void BeingHandler::processNameResponse2(Net::MessageIn &msg)
{
- if (!actorManager || !player_node)
+ if (!actorManager || !localPlayer)
return;
const int len = msg.readInt16();
@@ -392,9 +392,9 @@ void BeingHandler::processNameResponse2(Net::MessageIn &msg)
Being *const dstBeing = actorManager->findBeing(beingId);
if (dstBeing)
{
- if (beingId == player_node->getId())
+ if (beingId == localPlayer->getId())
{
- player_node->pingResponse();
+ localPlayer->pingResponse();
}
else
{
@@ -405,9 +405,9 @@ void BeingHandler::processNameResponse2(Net::MessageIn &msg)
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(
@@ -416,7 +416,7 @@ void BeingHandler::processNameResponse2(Net::MessageIn &msg)
if (member)
member->setName(dstBeing->getName());
}
- player_node->checkNewName(dstBeing);
+ localPlayer->checkNewName(dstBeing);
}
}
}
@@ -425,7 +425,7 @@ void BeingHandler::processNameResponse2(Net::MessageIn &msg)
void BeingHandler::processPlayerMoveUpdate(Net::MessageIn &msg,
const int msgType) const
{
- if (!actorManager || !player_node)
+ if (!actorManager || !localPlayer)
return;
// An update about a player, potentially including movement.
@@ -466,7 +466,7 @@ void BeingHandler::processPlayerMoveUpdate(Net::MessageIn &msg,
dstBeing->setDirection(dir);
}
- if (Party *const party = player_node->getParty())
+ if (Party *const party = localPlayer->getParty())
{
if (party->isMember(id))
dstBeing->setParty(party);
@@ -522,14 +522,14 @@ void BeingHandler::processPlayerMoveUpdate(Net::MessageIn &msg,
dstBeing->updateSprite(SPRITE_HAIR, hairStyle * -1,
ItemDB::get(-hairStyle).getDyeColorsString(hairColor));
}
- player_node->imitateOutfit(dstBeing);
+ localPlayer->imitateOutfit(dstBeing);
if (msgType == 3)
{
uint16_t srcX, srcY, dstX, dstY;
msg.readCoordinatePair(srcX, srcY, dstX, dstY);
- player_node->followMoveTo(dstBeing, srcX, srcY, dstX, dstY);
+ localPlayer->followMoveTo(dstBeing, srcX, srcY, dstX, dstY);
dstBeing->setTileCoords(srcX, srcY);
dstBeing->setDestination(dstX, dstY);
@@ -545,11 +545,11 @@ void BeingHandler::processPlayerMoveUpdate(Net::MessageIn &msg,
dstBeing->setDirectionDelayed(static_cast<uint8_t>(d));
}
- if (player_node->getCurrentAction() != BeingAction::STAND)
- player_node->imitateAction(dstBeing, BeingAction::STAND);
- if (player_node->getDirection() != dstBeing->getDirection())
+ if (localPlayer->getCurrentAction() != BeingAction::STAND)
+ localPlayer->imitateAction(dstBeing, BeingAction::STAND);
+ if (localPlayer->getDirection() != dstBeing->getDirection())
{
- player_node->imitateDirection(dstBeing,
+ localPlayer->imitateDirection(dstBeing,
dstBeing->getDirection());
}
}
@@ -560,7 +560,7 @@ void BeingHandler::processPlayerMoveUpdate(Net::MessageIn &msg,
dstBeing->setTileCoords(x, y);
dstBeing->setDirection(dir);
- player_node->imitateDirection(dstBeing, dir);
+ localPlayer->imitateDirection(dstBeing, dir);
}
const uint16_t gmstatus = msg.readInt16();
@@ -575,7 +575,7 @@ void BeingHandler::processPlayerMoveUpdate(Net::MessageIn &msg,
{
case 0:
dstBeing->setAction(BeingAction::STAND, 0);
- player_node->imitateAction(dstBeing, BeingAction::STAND);
+ localPlayer->imitateAction(dstBeing, BeingAction::STAND);
break;
case 1:
@@ -588,7 +588,7 @@ void BeingHandler::processPlayerMoveUpdate(Net::MessageIn &msg,
case 2:
dstBeing->setAction(BeingAction::SIT, 0);
- player_node->imitateAction(dstBeing, BeingAction::SIT);
+ localPlayer->imitateAction(dstBeing, BeingAction::SIT);
break;
default:
@@ -707,8 +707,8 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg,
dstBeing->setWalkSpeed(Vector(speed, speed, 0));
dstBeing->setSubtype(job, 0);
- if (dstBeing->getType() == ActorType::MONSTER && player_node)
- player_node->checkNewName(dstBeing);
+ if (dstBeing->getType() == ActorType::MONSTER && localPlayer)
+ localPlayer->checkNewName(dstBeing);
const int hairStyle = msg.readInt16();
const uint16_t weapon = msg.readInt16();
diff --git a/src/net/eathena/chathandler.cpp b/src/net/eathena/chathandler.cpp
index a9d11f563..daa3891e8 100644
--- a/src/net/eathena/chathandler.cpp
+++ b/src/net/eathena/chathandler.cpp
@@ -94,10 +94,10 @@ void ChatHandler::handleMessage(Net::MessageIn &msg)
void ChatHandler::talk(const std::string &restrict text,
const std::string &restrict channel A_UNUSED) const
{
- if (!player_node)
+ if (!localPlayer)
return;
- const std::string mes = std::string(player_node->getName()).append(
+ const std::string mes = std::string(localPlayer->getName()).append(
" : ").append(text);
MessageOut outMsg(CMSG_CHAT_MESSAGE);
diff --git a/src/net/eathena/gamehandler.cpp b/src/net/eathena/gamehandler.cpp
index 9c7e84554..c21b37611 100644
--- a/src/net/eathena/gamehandler.cpp
+++ b/src/net/eathena/gamehandler.cpp
@@ -113,10 +113,10 @@ void GameHandler::connect()
if (client->getState() == STATE_CONNECT_GAME)
{
// Change the player's ID to the account ID to match what eAthena uses
- if (player_node)
+ if (localPlayer)
{
- mCharID = player_node->getId();
- player_node->setId(token.account_ID);
+ mCharID = localPlayer->getId();
+ localPlayer->setId(token.account_ID);
}
else
{
@@ -133,10 +133,10 @@ void GameHandler::connect()
outMsg.writeInt8(Being::genderToInt(token.sex));
/*
- if (player_node)
+ if (localPlayer)
{
// Change the player's ID to the account ID to match what eAthena uses
- player_node->setId(token.account_ID);
+ localPlayer->setId(token.account_ID);
}
*/
// We get 4 useless bytes before the real answer comes in (what are these?)
diff --git a/src/net/eathena/guildhandler.cpp b/src/net/eathena/guildhandler.cpp
index 33ff12a57..6beebee9f 100644
--- a/src/net/eathena/guildhandler.cpp
+++ b/src/net/eathena/guildhandler.cpp
@@ -240,12 +240,12 @@ void GuildHandler::inviteResponse(const int guildId,
void GuildHandler::leave(const int guildId) const
{
- if (!player_node)
+ if (!localPlayer)
return;
MessageOut msg(CMSG_GUILD_LEAVE);
msg.writeInt32(guildId);
- msg.writeInt32(player_node->getId()); // Account ID
+ msg.writeInt32(localPlayer->getId()); // Account ID
msg.writeInt32(PlayerInfo::getCharId()); // Char ID
msg.writeString("", 40); // Message
}
@@ -266,10 +266,10 @@ void GuildHandler::kick(const GuildMember *restrict const member,
void GuildHandler::chat(const int guildId A_UNUSED,
const std::string &text) const
{
- if (!player_node)
+ if (!localPlayer)
return;
- const std::string str = std::string(player_node->getName()).append(
+ const std::string str = std::string(localPlayer->getName()).append(
" : ").append(text);
MessageOut msg(CMSG_GUILD_MESSAGE);
msg.writeInt16(static_cast<uint16_t>(str.size() + 4));
diff --git a/src/net/eathena/npchandler.cpp b/src/net/eathena/npchandler.cpp
index 297e333cf..76ae7d3b5 100644
--- a/src/net/eathena/npchandler.cpp
+++ b/src/net/eathena/npchandler.cpp
@@ -224,8 +224,8 @@ int NpcHandler::getNpc(Net::MessageIn &msg, const bool haveLength)
mDialog = new NpcDialog(npcId);
mDialog->postInit();
mDialog->saveCamera();
- if (player_node)
- player_node->stopWalking(false);
+ if (localPlayer)
+ localPlayer->stopWalking(false);
NpcDialog::mNpcDialogs[npcId] = mDialog;
}
}
diff --git a/src/net/eathena/partyhandler.cpp b/src/net/eathena/partyhandler.cpp
index 08074fa23..2c4fa63e4 100644
--- a/src/net/eathena/partyhandler.cpp
+++ b/src/net/eathena/partyhandler.cpp
@@ -137,10 +137,10 @@ void PartyHandler::invite(const std::string &name) const
void PartyHandler::inviteResponse(const std::string &inviter A_UNUSED,
const bool accept) const
{
- if (player_node)
+ if (localPlayer)
{
MessageOut outMsg(CMSG_PARTY_INVITED);
- outMsg.writeInt32(player_node->getId());
+ outMsg.writeInt32(localPlayer->getId());
outMsg.writeInt32(accept ? 1 : 0);
}
}
diff --git a/src/net/tmwa/beinghandler.cpp b/src/net/tmwa/beinghandler.cpp
index 11467a0e1..2ea77d925 100644
--- a/src/net/tmwa/beinghandler.cpp
+++ b/src/net/tmwa/beinghandler.cpp
@@ -298,7 +298,7 @@ void BeingHandler::processBeingChangeLook(Net::MessageIn &msg,
if (dstBeing->getType() == ActorType::PLAYER)
dstBeing->setOtherTime();
- if (!player_node)
+ if (!localPlayer)
{
BLOCK_END("BeingHandler::processBeingChangeLook")
return;
@@ -322,22 +322,22 @@ void BeingHandler::processBeingChangeLook(Net::MessageIn &msg,
dstBeing->setSprite(SPRITE_WEAPON, id, "", 1, true);
if (!mHideShield)
dstBeing->setSprite(SPRITE_SHIELD, id2);
- player_node->imitateOutfit(dstBeing, SPRITE_SHIELD);
+ localPlayer->imitateOutfit(dstBeing, SPRITE_SHIELD);
break;
case 3: // Change lower headgear for eAthena, pants for us
dstBeing->setSprite(SPRITE_BOTTOMCLOTHES, id, color,
static_cast<unsigned char>(id2));
- player_node->imitateOutfit(dstBeing, SPRITE_BOTTOMCLOTHES);
+ localPlayer->imitateOutfit(dstBeing, SPRITE_BOTTOMCLOTHES);
break;
case 4: // Change upper headgear for eAthena, hat for us
dstBeing->setSprite(SPRITE_HAT, id, color,
static_cast<unsigned char>(id2));
- player_node->imitateOutfit(dstBeing, SPRITE_HAT);
+ localPlayer->imitateOutfit(dstBeing, SPRITE_HAT);
break;
case 5: // Change middle headgear for eathena, armor for us
dstBeing->setSprite(SPRITE_TOPCLOTHES, id, color,
static_cast<unsigned char>(id2));
- player_node->imitateOutfit(dstBeing, SPRITE_TOPCLOTHES);
+ localPlayer->imitateOutfit(dstBeing, SPRITE_TOPCLOTHES);
break;
case 6: // eAthena LOOK_HAIR_COLOR
dstBeing->setHairColor(SPRITE_HAIR, static_cast<uint8_t>(id));
@@ -351,42 +351,42 @@ void BeingHandler::processBeingChangeLook(Net::MessageIn &msg,
dstBeing->setSprite(SPRITE_SHIELD, id, color,
static_cast<unsigned char>(id2));
}
- player_node->imitateOutfit(dstBeing, SPRITE_SHIELD);
+ localPlayer->imitateOutfit(dstBeing, SPRITE_SHIELD);
break;
case 9: // eAthena LOOK_SHOES
dstBeing->setSprite(SPRITE_SHOE, id, color,
static_cast<unsigned char>(id2));
- player_node->imitateOutfit(dstBeing, SPRITE_SHOE);
+ localPlayer->imitateOutfit(dstBeing, SPRITE_SHOE);
break;
case 10: // LOOK_GLOVES
dstBeing->setSprite(SPRITE_GLOVES, id, color,
static_cast<unsigned char>(id2));
- player_node->imitateOutfit(dstBeing, SPRITE_GLOVES);
+ localPlayer->imitateOutfit(dstBeing, SPRITE_GLOVES);
break;
case 11: // LOOK_CAPE
dstBeing->setSprite(SPRITE_CAPE, id, color,
static_cast<unsigned char>(id2));
- player_node->imitateOutfit(dstBeing, SPRITE_CAPE);
+ localPlayer->imitateOutfit(dstBeing, SPRITE_CAPE);
break;
case 12:
dstBeing->setSprite(SPRITE_MISC1, id, color,
static_cast<unsigned char>(id2));
- player_node->imitateOutfit(dstBeing, SPRITE_MISC1);
+ localPlayer->imitateOutfit(dstBeing, SPRITE_MISC1);
break;
case 13:
dstBeing->setSprite(SPRITE_MISC2, id, color,
static_cast<unsigned char>(id2));
- player_node->imitateOutfit(dstBeing, SPRITE_MISC2);
+ localPlayer->imitateOutfit(dstBeing, SPRITE_MISC2);
break;
case 14:
dstBeing->setSprite(SPRITE_EVOL1, id, color,
static_cast<unsigned char>(id2));
- player_node->imitateOutfit(dstBeing, SPRITE_EVOL1);
+ localPlayer->imitateOutfit(dstBeing, SPRITE_EVOL1);
break;
case 15:
dstBeing->setSprite(SPRITE_EVOL2, id, color,
static_cast<unsigned char>(id2));
- player_node->imitateOutfit(dstBeing, SPRITE_EVOL2);
+ localPlayer->imitateOutfit(dstBeing, SPRITE_EVOL2);
break;
case 16:
dstBeing->setLook(static_cast<uint8_t>(id));
@@ -404,7 +404,7 @@ void BeingHandler::processBeingChangeLook(Net::MessageIn &msg,
void BeingHandler::processNameResponse2(Net::MessageIn &msg)
{
BLOCK_START("BeingHandler::processNameResponse2")
- if (!actorManager || !player_node)
+ if (!actorManager || !localPlayer)
{
BLOCK_END("BeingHandler::processNameResponse2")
return;
@@ -416,9 +416,9 @@ void BeingHandler::processNameResponse2(Net::MessageIn &msg)
Being *const dstBeing = actorManager->findBeing(beingId);
if (dstBeing)
{
- if (beingId == player_node->getId())
+ if (beingId == localPlayer->getId())
{
- player_node->pingResponse();
+ localPlayer->pingResponse();
}
else
{
@@ -429,9 +429,9 @@ void BeingHandler::processNameResponse2(Net::MessageIn &msg)
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(
@@ -440,7 +440,7 @@ void BeingHandler::processNameResponse2(Net::MessageIn &msg)
if (member)
member->setName(dstBeing->getName());
}
- player_node->checkNewName(dstBeing);
+ localPlayer->checkNewName(dstBeing);
}
}
}
@@ -451,7 +451,7 @@ void BeingHandler::processPlayerMoveUpdate(Net::MessageIn &msg,
const int msgType) const
{
BLOCK_START("BeingHandler::processPlayerMoveUpdate")
- if (!actorManager || !player_node)
+ if (!actorManager || !localPlayer)
{
BLOCK_END("BeingHandler::processPlayerMoveUpdate")
return;
@@ -500,7 +500,7 @@ void BeingHandler::processPlayerMoveUpdate(Net::MessageIn &msg,
dstBeing->setDirection(dir);
}
- if (Party *const party = player_node->getParty())
+ if (Party *const party = localPlayer->getParty())
{
if (party->isMember(id))
dstBeing->setParty(party);
@@ -571,14 +571,14 @@ void BeingHandler::processPlayerMoveUpdate(Net::MessageIn &msg,
ItemDB::get(-hairStyle).getDyeColorsString(hairColor));
dstBeing->setHairColor(hairColor);
}
- player_node->imitateOutfit(dstBeing);
+ localPlayer->imitateOutfit(dstBeing);
if (msgType == 3)
{
uint16_t srcX, srcY, dstX, dstY;
msg.readCoordinatePair(srcX, srcY, dstX, dstY);
- player_node->followMoveTo(dstBeing, srcX, srcY, dstX, dstY);
+ localPlayer->followMoveTo(dstBeing, srcX, srcY, dstX, dstY);
dstBeing->setTileCoords(srcX, srcY);
dstBeing->setDestination(dstX, dstY);
@@ -594,11 +594,11 @@ void BeingHandler::processPlayerMoveUpdate(Net::MessageIn &msg,
dstBeing->setDirectionDelayed(static_cast<uint8_t>(d));
}
- if (player_node->getCurrentAction() != BeingAction::STAND)
- player_node->imitateAction(dstBeing, BeingAction::STAND);
- if (player_node->getDirection() != dstBeing->getDirection())
+ if (localPlayer->getCurrentAction() != BeingAction::STAND)
+ localPlayer->imitateAction(dstBeing, BeingAction::STAND);
+ if (localPlayer->getDirection() != dstBeing->getDirection())
{
- player_node->imitateDirection(dstBeing,
+ localPlayer->imitateDirection(dstBeing,
dstBeing->getDirection());
}
}
@@ -610,7 +610,7 @@ void BeingHandler::processPlayerMoveUpdate(Net::MessageIn &msg,
dstBeing->setTileCoords(x, y);
dstBeing->setDirection(dir);
- player_node->imitateDirection(dstBeing, dir);
+ localPlayer->imitateDirection(dstBeing, dir);
}
const uint16_t gmstatus = msg.readInt16();
@@ -625,7 +625,7 @@ void BeingHandler::processPlayerMoveUpdate(Net::MessageIn &msg,
{
case 0:
dstBeing->setAction(BeingAction::STAND, 0);
- player_node->imitateAction(dstBeing, BeingAction::STAND);
+ localPlayer->imitateAction(dstBeing, BeingAction::STAND);
break;
case 1:
@@ -638,7 +638,7 @@ void BeingHandler::processPlayerMoveUpdate(Net::MessageIn &msg,
case 2:
dstBeing->setAction(BeingAction::SIT, 0);
- player_node->imitateAction(dstBeing, BeingAction::SIT);
+ localPlayer->imitateAction(dstBeing, BeingAction::SIT);
break;
default:
diff --git a/src/net/tmwa/chathandler.cpp b/src/net/tmwa/chathandler.cpp
index d00f12dd3..23401799c 100644
--- a/src/net/tmwa/chathandler.cpp
+++ b/src/net/tmwa/chathandler.cpp
@@ -109,10 +109,10 @@ void ChatHandler::handleMessage(Net::MessageIn &msg)
void ChatHandler::talk(const std::string &restrict text,
const std::string &restrict channel) const
{
- if (!player_node)
+ if (!localPlayer)
return;
- const std::string mes = std::string(player_node->getName()).append(
+ const std::string mes = std::string(localPlayer->getName()).append(
" : ").append(text);
if (serverVersion >= 8 && channel.size() == 3)
diff --git a/src/net/tmwa/gamehandler.cpp b/src/net/tmwa/gamehandler.cpp
index 2cb8aa999..fabd15b1b 100644
--- a/src/net/tmwa/gamehandler.cpp
+++ b/src/net/tmwa/gamehandler.cpp
@@ -109,10 +109,10 @@ void GameHandler::connect()
if (client->getState() == STATE_CONNECT_GAME)
{
// Change the player's ID to the account ID to match what eAthena uses
- if (player_node)
+ if (localPlayer)
{
- mCharID = player_node->getId();
- player_node->setId(token.account_ID);
+ mCharID = localPlayer->getId();
+ localPlayer->setId(token.account_ID);
}
else
{
@@ -129,10 +129,10 @@ void GameHandler::connect()
outMsg.writeInt8(Being::genderToInt(token.sex));
/*
- if (player_node)
+ if (localPlayer)
{
// Change the player's ID to the account ID to match what eAthena uses
- player_node->setId(token.account_ID);
+ localPlayer->setId(token.account_ID);
}
*/
// We get 4 useless bytes before the real answer comes in (what are these?)
diff --git a/src/net/tmwa/guildhandler.cpp b/src/net/tmwa/guildhandler.cpp
index af45d63cc..a97da4153 100644
--- a/src/net/tmwa/guildhandler.cpp
+++ b/src/net/tmwa/guildhandler.cpp
@@ -245,12 +245,12 @@ void GuildHandler::inviteResponse(const int guildId, const bool response) const
void GuildHandler::leave(const int guildId) const
{
- if (!player_node)
+ if (!localPlayer)
return;
MessageOut msg(CMSG_GUILD_LEAVE);
msg.writeInt32(guildId);
- msg.writeInt32(player_node->getId()); // Account ID
+ msg.writeInt32(localPlayer->getId()); // Account ID
msg.writeInt32(PlayerInfo::getCharId()); // Char ID
msg.writeString("", 40); // Message
}
@@ -271,10 +271,10 @@ void GuildHandler::kick(const GuildMember *restrict const member,
void GuildHandler::chat(const int guildId A_UNUSED,
const std::string &text) const
{
- if (!player_node)
+ if (!localPlayer)
return;
- const std::string str = std::string(player_node->getName()).append(
+ const std::string str = std::string(localPlayer->getName()).append(
" : ").append(text);
MessageOut msg(CMSG_GUILD_MESSAGE);
msg.writeInt16(static_cast<uint16_t>(str.size() + 4));
diff --git a/src/net/tmwa/npchandler.cpp b/src/net/tmwa/npchandler.cpp
index 436badf26..534ee99db 100644
--- a/src/net/tmwa/npchandler.cpp
+++ b/src/net/tmwa/npchandler.cpp
@@ -244,8 +244,8 @@ int NpcHandler::getNpc(Net::MessageIn &msg, const bool haveLength)
mDialog = new NpcDialog(npcId);
mDialog->postInit();
mDialog->saveCamera();
- if (player_node)
- player_node->stopWalking(false);
+ if (localPlayer)
+ localPlayer->stopWalking(false);
NpcDialog::mNpcDialogs[npcId] = mDialog;
}
}
diff --git a/src/net/tmwa/partyhandler.cpp b/src/net/tmwa/partyhandler.cpp
index b0ab2dcef..12c011c89 100644
--- a/src/net/tmwa/partyhandler.cpp
+++ b/src/net/tmwa/partyhandler.cpp
@@ -139,10 +139,10 @@ void PartyHandler::invite(const std::string &name) const
void PartyHandler::inviteResponse(const std::string &inviter A_UNUSED,
const bool accept) const
{
- if (player_node)
+ if (localPlayer)
{
MessageOut outMsg(CMSG_PARTY_INVITED);
- outMsg.writeInt32(player_node->getId());
+ outMsg.writeInt32(localPlayer->getId());
outMsg.writeInt32(accept ? 1 : 0);
}
}