コード例 #1
0
ファイル: GridNotifiers.cpp プロジェクト: FixCore/335source
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
ファイル: GridNotifiers.cpp プロジェクト: Mystiko/OregonCore
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
ファイル: GridNotifiers.cpp プロジェクト: Adeer/OregonCore
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
ファイル: GridNotifiers.cpp プロジェクト: Keader/Sunwell
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
ファイル: GridNotifiers.cpp プロジェクト: FixCore/335source
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);
        }
    }
}