diff options
author | megamage <none@none> | 2009-02-26 16:29:55 -0600 |
---|---|---|
committer | megamage <none@none> | 2009-02-26 16:29:55 -0600 |
commit | ee6418d92a4cccbf63941016e7339ce557144287 (patch) | |
tree | 6e4cce4c8cfa8ae7c23506d313acd8703c786f3b /src/game/Unit.cpp | |
parent | c16848a23c25124e87034fd57ded304593fe67f5 (diff) |
*Update active object code.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r-- | src/game/Unit.cpp | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 8f5462cea81..6f63d8c9825 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -8502,25 +8502,19 @@ void Unit::SetCharm(Unit* pet) void Unit::AddPlayerToVision(Player* plr) { - if (m_sharedVision.empty() && GetTypeId() == TYPEID_UNIT - && !((Creature*)this)->isPet()) - { - setActive(true); - GetMap()->SwitchGridContainers((Creature*)this, true); - } + setActive(true); + if(m_sharedVision.empty()) + SetWorldObject(true); m_sharedVision.push_back(plr); plr->SetFarsightTarget(this); } void Unit::RemovePlayerFromVision(Player* plr) { + setActive(false); m_sharedVision.remove(plr); - if (m_sharedVision.empty() && GetTypeId() == TYPEID_UNIT - && !((Creature*)this)->isPet()) - { - GetMap()->SwitchGridContainers((Creature*)this, false); - setActive(false); - } + if(m_sharedVision.empty()) + SetWorldObject(false); plr->ClearFarsight(); } |