From 1ab0521ebffbfaa55270a1c1b76896a2fc75100e Mon Sep 17 00:00:00 2001 From: megamage Date: Thu, 19 Feb 2009 13:08:14 -0600 Subject: *Fix a crash caused eye of beast. --HG-- branch : trunk --- src/game/Unit.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 9ed77d70cb2..dea16ec8f35 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -8451,7 +8451,8 @@ void Unit::SetCharm(Unit* pet) void Unit::AddPlayerToVision(Player* plr) { - if (m_sharedVision.empty() && GetTypeId() == TYPEID_UNIT) + if (m_sharedVision.empty() && GetTypeId() == TYPEID_UNIT + && !((Creature*)this)->isPet()) { setActive(true); GetMap()->SwitchGridContainers((Creature*)this, true); @@ -8463,7 +8464,8 @@ void Unit::AddPlayerToVision(Player* plr) void Unit::RemovePlayerFromVision(Player* plr) { m_sharedVision.remove(plr); - if (m_sharedVision.empty() && GetTypeId() == TYPEID_UNIT) + if (m_sharedVision.empty() && GetTypeId() == TYPEID_UNIT + && !((Creature*)this)->isPet()) { setActive(false); GetMap()->SwitchGridContainers((Creature*)this, false); -- cgit v1.2.3