summaryrefslogtreecommitdiff
path: root/src/actions
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-02-23 00:20:47 +0300
committerAndrei Karas <akaras@inbox.ru>2015-02-23 00:21:10 +0300
commitdd1c7257b760f4c97c84e66d4ebb4f32fff8a499 (patch)
treeba75dfbdff9b7f7279fd20ecf9a78fc6d959cd03 /src/actions
parent839cb18574b493cfbf66c03aa031bd040b2a7972 (diff)
downloadmv-dd1c7257b760f4c97c84e66d4ebb4f32fff8a499.tar.gz
mv-dd1c7257b760f4c97c84e66d4ebb4f32fff8a499.tar.bz2
mv-dd1c7257b760f4c97c84e66d4ebb4f32fff8a499.tar.xz
mv-dd1c7257b760f4c97c84e66d4ebb4f32fff8a499.zip
eathena: fix crash if pet went outside of visible area.
Diffstat (limited to 'src/actions')
-rw-r--r--src/actions/pets.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/actions/pets.cpp b/src/actions/pets.cpp
index 7e2c849ac..ef544d88a 100644
--- a/src/actions/pets.cpp
+++ b/src/actions/pets.cpp
@@ -61,7 +61,10 @@ static const Being *getPet()
return *pets.begin();
}
#endif
- return PlayerInfo::getPetBeing();
+ const int id = PlayerInfo::getPetBeingId();
+ if (!id)
+ return nullptr;
+ return actorManager->findBeing(id);
}
impHandler(commandEmotePet)