예제 #1
0
void VisibleChangesNotifier::Visit(DynamicObjectMapType &m)
{
    for (DynamicObjectMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
        if (Unit* caster = iter->GetSource()->GetCaster())
            if (Player* player = caster->ToPlayer())
                if (player->m_seer == iter->GetSource())
                    player->UpdateVisibilityOf(&i_object);
}
예제 #2
0
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);
}
예제 #3
0
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);
}
예제 #4
0
void
MessageDistDeliverer::Visit(DynamicObjectMapType& m)
{
    for (DynamicObjectMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
    {
        if (iter->GetSource()->GetExactDist2dSq(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);
        }
    }
}
예제 #5
0
void MessageDistDelivererToHostile::Visit(DynamicObjectMapType &m)
{
    for (DynamicObjectMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
    {
        DynamicObject* target = iter->GetSource();
        if (!IS_PLAYER_GUID(target->GetCasterGUID()) || !target->InSamePhase(i_phaseMask))
            continue;

        if (target->GetExactDist2dSq(i_source) > i_distSq)
            continue;

        // Send packet back to the caster if the caster has vision of dynamic object
        Player* caster = (Player*)target->GetCaster();
        if (caster && caster->m_seer == target)
            SendPacket(caster);
    }
}
예제 #6
0
void MessageDistDeliverer::Visit(DynamicObjectMapType &m)
{
    for (DynamicObjectMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
    {
        DynamicObject* target = iter->GetSource();
        if (!target->InSamePhase(i_phaseMask))
            continue;

        if (target->GetExactDist2dSq(i_source) > i_distSq)
            continue;

        if (Unit* caster = target->GetCaster())
        {
            // Send packet back to the caster if the caster has vision of dynamic object
            Player* player = caster->ToPlayer();
            if (player && player->m_seer == target)
                SendPacket(player);
        }
    }
}