summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-09-17 11:24:41 +0300
committerAndrei Karas <akaras@inbox.ru>2014-09-17 11:24:41 +0300
commit4eaedf092bc504fae492827b1a89e7bbaac20263 (patch)
tree098d1b1a7721606a8c053dc56f9e9765b8072c9e /src
parent418d749f0d4889904d0b91e825a87e70a08d134c (diff)
downloadplus-4eaedf092bc504fae492827b1a89e7bbaac20263.tar.gz
plus-4eaedf092bc504fae492827b1a89e7bbaac20263.tar.bz2
plus-4eaedf092bc504fae492827b1a89e7bbaac20263.tar.xz
plus-4eaedf092bc504fae492827b1a89e7bbaac20263.zip
Remove getter for petHandler.
Diffstat (limited to 'src')
-rw-r--r--src/actions/actions.cpp4
-rw-r--r--src/actions/commands.cpp2
-rw-r--r--src/being/being.cpp6
-rw-r--r--src/being/localplayer.cpp2
-rw-r--r--src/net/net.cpp6
-rw-r--r--src/net/net.h2
-rw-r--r--src/net/pethandler.h2
7 files changed, 10 insertions, 14 deletions
diff --git a/src/actions/actions.cpp b/src/actions/actions.cpp
index 5fd3b6e70..6c8c49ca6 100644
--- a/src/actions/actions.cpp
+++ b/src/actions/actions.cpp
@@ -179,7 +179,7 @@ impHandler(petEmote)
{
const int emotion = event.action - InputAction::PET_EMOTE_1;
if (emoteShortcut)
- Net::getPetHandler()->emote(emoteShortcut->getEmote(emotion), 0);
+ petHandler->emote(emoteShortcut->getEmote(emotion), 0);
if (Game::instance())
Game::instance()->setValidSpeed();
return true;
@@ -1170,7 +1170,7 @@ impHandler(catchPet)
else
localPlayer->setTarget(target);
if (target)
- Net::getPetHandler()->catchPet(target);
+ petHandler->catchPet(target);
return true;
}
diff --git a/src/actions/commands.cpp b/src/actions/commands.cpp
index d5c2f5096..cdc65f0ad 100644
--- a/src/actions/commands.cpp
+++ b/src/actions/commands.cpp
@@ -318,7 +318,7 @@ impHandler(commandEmote)
impHandler(commandEmotePet)
{
// need use actual pet id
- Net::getPetHandler()->emote(static_cast<uint8_t>(
+ petHandler->emote(static_cast<uint8_t>(
atoi(event.args.c_str())), 0);
return true;
}
diff --git a/src/being/being.cpp b/src/being/being.cpp
index 6ad8f5a9b..303e9f8f9 100644
--- a/src/being/being.cpp
+++ b/src/being/being.cpp
@@ -1520,7 +1520,7 @@ void Being::petLogic()
setAction(BeingAction::STAND, 0);
fixPetSpawnPos(dstX, dstY);
setTileCoords(dstX, dstY);
- Net::getPetHandler()->spawn(mOwner, mId, dstX, dstY);
+ petHandler->spawn(mOwner, mId, dstX, dstY);
}
else if (!followDist || divX > followDist || divY > followDist)
{
@@ -1573,7 +1573,7 @@ void Being::petLogic()
if (mX != dstX || mY != dstY)
{
setPath(mMap->findPath(mX, mY, dstX, dstY, blockWalkMask));
- Net::getPetHandler()->move(mOwner, mId, mX, mY, dstX, dstY);
+ petHandler->move(mOwner, mId, mX, mY, dstX, dstY);
return;
}
}
@@ -3137,7 +3137,7 @@ void Being::addPet(const int id)
int dstY = mY;
being->fixPetSpawnPos(dstX, dstY);
being->setTileCoords(dstX, dstY);
- Net::getPetHandler()->spawn(this, being->mId, dstX, dstY);
+ petHandler->spawn(this, being->mId, dstX, dstY);
}
}
diff --git a/src/being/localplayer.cpp b/src/being/localplayer.cpp
index f01a3171a..a97d56128 100644
--- a/src/being/localplayer.cpp
+++ b/src/being/localplayer.cpp
@@ -1963,7 +1963,7 @@ void LocalPlayer::crazyMoveA()
if (mMoveProgram[mCrazyMoveState - 1] == 'e')
emote(emoteId);
else if (PacketLimiter::limitPackets(PACKET_CHAT))
- Net::getPetHandler()->emote(emoteId, 0);
+ petHandler->emote(emoteId, 0);
mCrazyMoveState ++;
}
diff --git a/src/net/net.cpp b/src/net/net.cpp
index 34e4eb345..aee04a8e4 100644
--- a/src/net/net.cpp
+++ b/src/net/net.cpp
@@ -55,6 +55,7 @@ namespace Net
class MailHandler;
class NpcHandler;
class PartyHandler;
+ class PetHandler;
}
Net::AdminHandler *adminHandler = nullptr;
@@ -80,11 +81,6 @@ Net::CashShopHandler *cashShopHandler = nullptr;
Net::FamilyHandler *familyHandler = nullptr;
Net::BankHandler *bankHandler = nullptr;
-Net::PetHandler *Net::getPetHandler()
-{
- return petHandler;
-}
-
Net::PlayerHandler *Net::getPlayerHandler()
{
return playerHandler;
diff --git a/src/net/net.h b/src/net/net.h
index 8dd94792b..f0611114f 100644
--- a/src/net/net.h
+++ b/src/net/net.h
@@ -36,13 +36,11 @@
namespace Net
{
-class PetHandler;
class PlayerHandler;
class SkillHandler;
class TradeHandler;
class ServerFeatures;
-PetHandler *getPetHandler() A_WARN_UNUSED;
PlayerHandler *getPlayerHandler() A_WARN_UNUSED;
SkillHandler *getSkillHandler() A_WARN_UNUSED;
TradeHandler *getTradeHandler() A_WARN_UNUSED;
diff --git a/src/net/pethandler.h b/src/net/pethandler.h
index 3a90b98f1..8827a63e8 100644
--- a/src/net/pethandler.h
+++ b/src/net/pethandler.h
@@ -52,4 +52,6 @@ class PetHandler notfinal
} // namespace Net
+extern Net::PetHandler *petHandler;
+
#endif // NET_PETHANDLER_H