summaryrefslogtreecommitdiff
path: root/src/actions/pets.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-02-22 18:27:16 +0300
committerAndrei Karas <akaras@inbox.ru>2015-02-22 18:27:16 +0300
commit6394aa39611ce2730f4030a8ac45088ae6f20460 (patch)
tree8a5c426047960a89991e1a09ac676303c51c520f /src/actions/pets.cpp
parentb6f49d9db7221c762652e94e6a52b50d4b4bc913 (diff)
downloadmv-6394aa39611ce2730f4030a8ac45088ae6f20460.tar.gz
mv-6394aa39611ce2730f4030a8ac45088ae6f20460.tar.bz2
mv-6394aa39611ce2730f4030a8ac45088ae6f20460.tar.xz
mv-6394aa39611ce2730f4030a8ac45088ae6f20460.zip
eathena: allow move pet by left shift + cursor keys.
Diffstat (limited to 'src/actions/pets.cpp')
-rw-r--r--src/actions/pets.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/actions/pets.cpp b/src/actions/pets.cpp
index 925ab993f..061a7dd6d 100644
--- a/src/actions/pets.cpp
+++ b/src/actions/pets.cpp
@@ -27,10 +27,12 @@
#include "actions/actiondef.h"
#include "being/localplayer.h"
+#include "being/playerinfo.h"
#include "gui/chatconsts.h"
#include "net/chathandler.h"
+#include "net/net.h"
#include "net/pethandler.h"
#include "net/serverfeatures.h"
@@ -44,13 +46,19 @@ namespace Actions
static const Being *getPet()
{
+#ifdef TMWA_SUPPORT
if (!localPlayer)
return nullptr;
- const std::vector<Being*> &pets = localPlayer->getPets();
- if (pets.empty())
- return nullptr;
- return *pets.begin();
+ if (Net::getNetworkType() == ServerType::TMWATHENA)
+ {
+ const std::vector<Being*> &pets = localPlayer->getPets();
+ if (pets.empty())
+ return nullptr;
+ return *pets.begin();
+ }
+#endif
+ return PlayerInfo::getPetBeing();
}
impHandler(commandEmotePet)