summaryrefslogtreecommitdiff
path: root/src/net/tmwa
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/tmwa
parent9913b4b481ddcaf0fa8499f3554c85bb588be7f0 (diff)
downloadmanaplus-1680d159ecbf75591d2dab1416ff8144c27d4de5.tar.gz
manaplus-1680d159ecbf75591d2dab1416ff8144c27d4de5.tar.bz2
manaplus-1680d159ecbf75591d2dab1416ff8144c27d4de5.tar.xz
manaplus-1680d159ecbf75591d2dab1416ff8144c27d4de5.zip
Rename player_node variable into localPlayer.
Diffstat (limited to 'src/net/tmwa')
-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
6 files changed, 45 insertions, 45 deletions
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);
}
}