Changeset 233 for trunk/src/game/Unit.cpp
- Timestamp:
- 11/19/08 13:49:07 (17 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/game/Unit.cpp
r232 r233 828 828 he->DuelComplete(DUEL_INTERUPTED); 829 829 } 830 831 // Possessed unit died, restore control to possessor832 pVictim->UnpossessSelf(false);833 834 // Possessor died, remove possession835 if(pVictim->GetTypeId() == TYPEID_PLAYER && pVictim->isPossessing())836 ((Player*)pVictim)->RemovePossess(false);837 830 838 831 // battleground things (do this at the end, so the death state flag will be properly set to handle in the bg->handlekill) … … 7184 7177 } 7185 7178 7179 void Unit::AddPlayerToVision(Player* plr) 7180 { 7181 if (m_sharedVision.empty() && GetTypeId() == TYPEID_UNIT) 7182 { 7183 setActive(true); 7184 GetMap()->SwitchGridContainers((Creature*)this, true); 7185 } 7186 m_sharedVision.push_back(plr); 7187 plr->SetFarsightTarget(this); 7188 } 7189 7190 void Unit::RemovePlayerFromVision(Player* plr) 7191 { 7192 m_sharedVision.remove(plr); 7193 if (m_sharedVision.empty() && GetTypeId() == TYPEID_UNIT) 7194 { 7195 setActive(false); 7196 GetMap()->SwitchGridContainers((Creature*)this, false); 7197 } 7198 plr->ClearFarsight(); 7199 } 7200 7201 void Unit::RemoveAllFromVision() 7202 { 7203 while (!m_sharedVision.empty()) 7204 { 7205 Player* plr = *m_sharedVision.begin(); 7206 m_sharedVision.erase(m_sharedVision.begin()); 7207 plr->ClearFarsight(); 7208 } 7209 } 7210 7186 7211 void Unit::UncharmSelf() 7187 7212 { … … 8936 8961 UnsummonAllTotems(); 8937 8962 8963 // Possessed unit died, restore control to possessor 8964 UnpossessSelf(false); 8965 RemoveAllFromVision(); 8966 8938 8967 ModifyAuraState(AURA_STATE_HEALTHLESS_20_PERCENT, false); 8939 8968 ModifyAuraState(AURA_STATE_HEALTHLESS_35_PERCENT, false); … … 9757 9786 9758 9787 UnpossessSelf(false); 9788 RemoveAllFromVision(); 9759 9789 } 9760 9790 RemoveFromWorld(); 9761 9791 } 9792 9793 9762 9794 9763 9795 CharmInfo* Unit::InitCharmInfo(Unit *charm)