From dd1c7257b760f4c97c84e66d4ebb4f32fff8a499 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 23 Feb 2015 00:20:47 +0300 Subject: eathena: fix crash if pet went outside of visible area. --- src/actions/pets.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/actions/pets.cpp') 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) -- cgit v1.2.3-70-g09d2