void VisibleChangesNotifier::Visit(DynamicObjectMapType &m) { for (DynamicObjectMapType::iterator iter = m.begin(); iter != m.end(); ++iter) if (IS_PLAYER_GUID(iter->getSource()->GetCasterGUID())) if (Player* caster = (Player*)iter->getSource()->GetCaster()) if (caster->m_seer == iter->getSource()) caster->UpdateVisibilityOf(&i_object); }
void VisibleChangesNotifier::Visit(DynamicObjectMapType &m) { for (DynamicObjectMapType::iterator iter = m.begin(); iter != m.end(); ++iter) if (iter->getSource()->GetTypeId() == TYPEID_PLAYER) // better check to see if the target it a player. if (Player* caster = (Player*)iter->getSource()->GetCaster()) if (caster->m_seer == iter->getSource()) caster->UpdateVisibilityOf(&i_object); }
void ObjectAccessor::WorldObjectChangeAccumulator::Visit(DynamicObjectMapType &m) { for(DynamicObjectMapType::iterator iter = m.begin(); iter != m.end(); ++iter) { uint64 guid = iter->getSource()->GetCasterGUID(); if(IS_PLAYER_GUID(guid)) { //Caster may be NULL if DynObj is in removelist if(Player *caster = FindPlayer(guid)) if (caster->GetUInt64Value(PLAYER_FARSIGHT) == iter->getSource()->GetGUID()) BuildPacket(caster); } } }
void Deliverer::Visit(DynamicObjectMapType &m) { for (DynamicObjectMapType::iterator iter = m.begin(); iter != m.end(); ++iter) { if (IS_PLAYER_GUID(iter->getSource()->GetCasterGUID())) { // Send packet back to the caster if the caster has vision of dynamic object Player* caster = iter->getSource()->GetCaster()->ToPlayer(); if (caster && caster->GetUInt64Value(PLAYER_FARSIGHT) == iter->getSource()->GetGUID() && (!i_dist || iter->getSource()->GetDistance(&i_source) <= i_dist)) SendPacket(caster); } } }
void MessageDistDeliverer::Visit(DynamicObjectMapType &m) { for (DynamicObjectMapType::iterator iter = m.begin(); iter != m.end(); ++iter) { if (iter->getSource()->GetExactDistSq(i_source) > i_distSq) continue; if (iter->getSource()->GetTypeId() == TYPEID_PLAYER) { // Send packet back to the caster if the caster has vision of dynamic object Player* caster = iter->getSource()->GetCaster()->ToPlayer(); if (caster && caster->m_seer == iter->getSource()) SendPacket(caster); } } }
void MessageDistDeliverer::Visit(DynamicObjectMapType &m) { for (DynamicObjectMapType::iterator iter = m.begin(); iter != m.end(); ++iter) { if (!iter->getSource()->InSamePhase(i_phaseMask)) continue; if (iter->getSource()->GetExactDist2dSq(i_source) > i_distSq) continue; if (IS_PLAYER_GUID(iter->getSource()->GetCasterGUID())) { // Send packet back to the caster if the caster has vision of dynamic object Player* caster = (Player*) iter->getSource()->GetCaster(); if (caster && caster->m_seer == iter->getSource()) SendPacket(caster); } } }