diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-02-23 00:20:47 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-02-23 00:21:10 +0300 |
commit | dd1c7257b760f4c97c84e66d4ebb4f32fff8a499 (patch) | |
tree | ba75dfbdff9b7f7279fd20ecf9a78fc6d959cd03 /src/actions/pets.cpp | |
parent | 839cb18574b493cfbf66c03aa031bd040b2a7972 (diff) | |
download | plus-dd1c7257b760f4c97c84e66d4ebb4f32fff8a499.tar.gz plus-dd1c7257b760f4c97c84e66d4ebb4f32fff8a499.tar.bz2 plus-dd1c7257b760f4c97c84e66d4ebb4f32fff8a499.tar.xz plus-dd1c7257b760f4c97c84e66d4ebb4f32fff8a499.zip |
eathena: fix crash if pet went outside of visible area.
Diffstat (limited to 'src/actions/pets.cpp')
-rw-r--r-- | src/actions/pets.cpp | 5 |
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) |