• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ AddObjectToRemoveList函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中AddObjectToRemoveList函数的典型用法代码示例。如果您正苦于以下问题:C++ AddObjectToRemoveList函数的具体用法?C++ AddObjectToRemoveList怎么用?C++ AddObjectToRemoveList使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了AddObjectToRemoveList函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: ForcedUnsummonDelayEvent

void TempSummon::UnSummon(uint32 msTime)
{
    if (msTime)
    {
        ForcedUnsummonDelayEvent* pEvent = new ForcedUnsummonDelayEvent(*this);

        m_Events.AddEvent(pEvent, m_Events.CalculateTime(msTime));
        return;
    }

    //ASSERT(!isPet());
    if (isPet())
    {
        ((Pet*)this)->Remove(PET_SAVE_NOT_IN_SLOT);
        ASSERT(!IsInWorld());
        return;
    }

    Unit* owner = GetSummoner();
	   if (owner && GetEntry() == 30230) // Risen ally
       {
          owner->RemoveAurasDueToSpell(62218);
          owner->RemoveAurasDueToSpell(46619);
       }
    if (owner && owner->GetTypeId() == TYPEID_UNIT && owner->ToCreature()->IsAIEnabled)
        owner->ToCreature()->AI()->SummonedCreatureDespawn(this);

    AddObjectToRemoveList();
}
开发者ID:DaShutok,项目名称:TrinityCore,代码行数:29,代码来源:TemporarySummon.cpp


示例2: RemoveAllPassengers

void Vehicle::Dismiss()
{
    RemoveAllPassengers();
    SendObjectDeSpawnAnim(GetGUID());
    CombatStop();
    AddObjectToRemoveList();
}
开发者ID:sc0rpio0o,项目名称:diamondcore,代码行数:7,代码来源:Vehicle.cpp


示例3: CombatStop

void Totem::UnSummon() {
	CombatStop();
	RemoveAurasDueToSpell(GetSpell());

	// clear owner's totem slot
	for (int i = SUMMON_SLOT_TOTEM; i < MAX_TOTEM_SLOT; ++i) {
		if (m_owner->m_SummonSlot[i] == GetGUID()) {
			m_owner->m_SummonSlot[i] = 0;
			break;
		}
	}

	m_owner->RemoveAurasDueToSpell(GetSpell());

	//remove aura all party members too
	Group *pGroup = NULL;
	if (m_owner->GetTypeId() == TYPEID_PLAYER) {
		m_owner->ToPlayer()->SendAutoRepeatCancel(this);
		// Not only the player can summon the totem (scripted AI)
		pGroup = m_owner->ToPlayer()->GetGroup();
		if (pGroup) {
			for (GroupReference *itr = pGroup->GetFirstMember(); itr != NULL;
					itr = itr->next()) {
				Player* Target = itr->getSource();
				if (Target && pGroup->SameSubGroup((Player*) m_owner, Target))
					Target->RemoveAurasDueToSpell(GetSpell());
			}
		}
	}

	AddObjectToRemoveList();
}
开发者ID:ProjectStarGate,项目名称:StarGate-Plus-EMU,代码行数:32,代码来源:Totem.cpp


示例4: CombatStop

void Totem::UnSummon()
{
    CombatStop();

    // clear owner's totem slot
    for (int i = SUMMON_SLOT_TOTEM; i < MAX_TOTEM_SLOT; ++i)
    {
        if (_owner->m_SummonSlot[i] == GetGUID())
        {
            _owner->m_SummonSlot[i] = 0;
            break;
        }
    }

     //remove aura all party members too
    if (Player* owner = _owner->ToPlayer())
    {
        owner->SendAutoRepeatCancel(this);

        if (SpellInfo const* spell = sSpellMgr->GetSpellInfo(GetUInt32Value(UNIT_CREATED_BY_SPELL)))
            owner->SendCooldownEvent(spell, 0, NULL, false);
    }

    AddObjectToRemoveList();
}
开发者ID:Exodius,项目名称:ZapekFapeCore,代码行数:25,代码来源:Totem.cpp


示例5: ForcedUnsummonDelayEvent

void TempSummon::UnSummon(uint32 msTime)
{
    if (msTime)
    {
        ForcedUnsummonDelayEvent *pEvent = new ForcedUnsummonDelayEvent(*this);

        m_Events.AddEvent(pEvent, m_Events.CalculateTime(msTime));
        return;
    }

    //ASSERT(!isPet());
    if (isPet())
    {
        if(((Pet*)this)->getPetType() == HUNTER_PET)
            ((Pet*)this)->Remove(PET_SAVE_AS_CURRENT);
        else
            ((Pet*)this)->Remove(PET_SAVE_NOT_IN_SLOT);
        ASSERT(!IsInWorld());
        return;
    }

    Unit* owner = GetSummoner();
    if (owner && owner->GetTypeId() == TYPEID_UNIT && owner->ToCreature()->IsAIEnabled)
        owner->ToCreature()->AI()->SummonedCreatureDespawn(this);

    AddObjectToRemoveList();
}
开发者ID:wuhongyi1977,项目名称:StrawberryCore,代码行数:27,代码来源:TemporarySummon.cpp


示例6: ForcedUnsummonDelayEvent

void TempSummon::UnSummon(uint32 msTime)
{
    if (msTime)
    {
        ForcedUnsummonDelayEvent* pEvent = new ForcedUnsummonDelayEvent(*this);

        m_Events.AddEvent(pEvent, m_Events.CalculateTime(msTime));
        return;
    }

    //ASSERT(!isPet());
    if (isPet())
    {
        if (ToPet()->getPetType() == HUNTER_PET)
            ToPet()->Remove(PET_SLOT_ACTUAL_PET_SLOT, false, ToPet()->m_Stampeded);
        else
            ToPet()->Remove(PET_SLOT_OTHER_PET, false, ToPet()->m_Stampeded);
        ASSERT(!IsInWorld());
        return;
    }

    Unit* owner = GetSummoner();
    if (owner && owner->GetTypeId() == TYPEID_UNIT && owner->ToCreature()->IsAIEnabled)
        owner->ToCreature()->AI()->SummonedCreatureDespawn(this);

    AddObjectToRemoveList();
}
开发者ID:Exodius,项目名称:JadeCore548,代码行数:27,代码来源:TemporarySummon.cpp


示例7: ForcedUnsummonDelayEvent

void TempSummon::UnSummon(uint32 msTime)
{
    if (msTime)
    {
        ForcedUnsummonDelayEvent* pEvent = new ForcedUnsummonDelayEvent(*this);

        m_Events.AddEvent(pEvent, m_Events.CalculateTime(msTime));
        return;
    }

    //ASSERT(!IsPet());
    if (IsPet())
    {
        ((Pet*)this)->Remove(PET_SAVE_NOT_IN_SLOT);
        ASSERT(!IsInWorld());
        return;
    }

    Unit* owner = GetSummoner();
    if (owner && owner->GetTypeId() == TYPEID_UNIT && owner->ToCreature()->IsAIEnabled)
        owner->ToCreature()->AI()->SummonedCreatureDespawn(this);

    //npcbot
    if (GetIAmABot() || GetIAmABotsPet())
    {
        //TC_LOG_ERROR("entities.player", "TempSummon::UnSummon(): Trying to unsummon Bot %s (guidLow: %u owner: %s)", GetName().c_str(), GetGUIDLow(), GetBotOwner()->GetName().c_str());
        if (IsTempBot())
            AI()->JustDied(NULL);
        return;
    }
    //end npcbots

    AddObjectToRemoveList();
}
开发者ID:GlassFace,项目名称:XC_CORE,代码行数:34,代码来源:TemporarySummon.cpp


示例8: AddObjectToRemoveList

void AreaTrigger::Remove()
{
    if (IsInWorld())
    {
        AddObjectToRemoveList(); // calls RemoveFromWorld
    }
}
开发者ID:Rochet2,项目名称:TrinityCore,代码行数:7,代码来源:AreaTrigger.cpp


示例9: ASSERT

void TempSummon::UnSummon()
{
    //ASSERT(!isPet());
    if (isPet())
    {
        if (((Pet*)this)->getPetType() == HUNTER_PET)
            ((Pet*)this)->Remove(PET_SLOT_ACTUAL_PET_SLOT);
        else
            ((Pet*)this)->Remove(PET_SLOT_OTHER_PET);
        ASSERT(!IsInWorld());
        return;
    }

    Unit* owner = GetSummoner();
    if (owner && owner->GetTypeId() == TYPEID_UNIT && owner->ToCreature()->IsAIEnabled)
        owner->ToCreature()->AI()->SummonedCreatureDespawn(this);

    if (owner &&
        owner->GetTypeId() == TYPEID_PLAYER &&
       ((Player*)owner)->HaveBot() &&
       ((Player*)owner)->GetBot()->GetGUID()==this->GetGUID() &&
       this->isDead()) {    // dont unsummon corpse if a bot
        return;
    }

    AddObjectToRemoveList();
}
开发者ID:XEQT,项目名称:SkyFireEMU,代码行数:27,代码来源:TemporarySummon.cpp


示例10: SendObjectDeSpawnAnim

void DynamicObject::Remove() {
    if (IsInWorld()) {
        SendObjectDeSpawnAnim(GetGUID());
        RemoveFromWorld();
        AddObjectToRemoveList();
    }
}
开发者ID:BlueSellafield,项目名称:ArkCORE,代码行数:7,代码来源:DynamicObject.cpp


示例11: CombatStop

void Totem::UnSummon()
{
    CombatStop();
    RemoveAurasDueToSpell(GetSpell());

    if (Unit *owner = GetOwner())
    {
        owner->_RemoveTotem(this);
        owner->RemoveAurasDueToSpell(GetSpell());

        //remove aura all party members too
        if (owner->GetTypeId() == TYPEID_PLAYER)
        {
            ((Player*)owner)->SendAutoRepeatCancel(this);

            // Not only the player can summon the totem (scripted AI)
            if (Group *pGroup = ((Player*)owner)->GetGroup())
            {
                for(GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
                {
                    Player* Target = itr->getSource();
                    if(Target && pGroup->SameSubGroup((Player*)owner, Target))
                        Target->RemoveAurasDueToSpell(GetSpell());
                }
            }
        }

        if (owner->GetTypeId() == TYPEID_UNIT && ((Creature*)owner)->AI())
            ((Creature*)owner)->AI()->SummonedCreatureDespawn((Creature*)this);
    }

    AddObjectToRemoveList();
}
开发者ID:SPIRITnsk,项目名称:mangos,代码行数:33,代码来源:Totem.cpp


示例12: CombatStop

void TemporarySummon::UnSummon(uint32 delay)
{
    if (delay > 0)
    {
        m_type = TEMPSUMMON_TIMED_OR_DEAD_DESPAWN;
        m_timer = delay;
        return;
    }

    m_isActive = false;

    CombatStop();

    if (GetSummonerGuid().IsCreatureOrVehicle())
    {
        if (Creature* sum = GetMap()->GetCreature(GetSummonerGuid()))
        {
            if (sum->AI())
                sum->AI()->SummonedCreatureDespawn(this);
        }
    }

    KillAllEvents(false);

    AddObjectToRemoveList();

    // Prevent double unsummonig before remove from world
    m_type = TEMPSUMMON_MANUAL_DESPAWN;
}
开发者ID:AnthoDevMoP,项目名称:mangos4,代码行数:29,代码来源:TemporarySummon.cpp


示例13: ForcedUnsummonDelayEvent

void TempSummon::UnSummon(uint32 msTime)
{ 
    if (msTime)
    {
        ForcedUnsummonDelayEvent* pEvent = new ForcedUnsummonDelayEvent(*this);

        m_Events.AddEvent(pEvent, m_Events.CalculateTime(msTime));
        return;
    }

	// Dont allow to call this function twice (possible)
	if (m_type == TEMPSUMMON_DESPAWNED)
		return;
	SetTempSummonType(TEMPSUMMON_DESPAWNED);

    //ASSERT(!IsPet());
    if (IsPet())
    {
        ((Pet*)this)->Remove(PET_SAVE_NOT_IN_SLOT);
        ASSERT(!IsInWorld());
        return;
    }

    Unit* owner = GetSummoner();
    if (owner && owner->GetTypeId() == TYPEID_UNIT && owner->ToCreature()->IsAIEnabled)
        owner->ToCreature()->AI()->SummonedCreatureDespawn(this);

    AddObjectToRemoveList();
}
开发者ID:Cryostorm,项目名称:SunwellCore,代码行数:29,代码来源:TemporarySummon.cpp


示例14: CombatStop

void Totem::UnSummon()
{
    CombatStop();

    uint32 maxIdx = GetSpellMaxIndex();

    for (int32 i = maxIdx; i >= 0; --i)
    {
        if (uint32 spellId = GetSpell(i))
            RemoveAurasDueToSpell(spellId);
    }

    if (Unit* owner = GetOwner())
    {
        owner->_RemoveTotem(this);

        for (int32 i = maxIdx; i >= 0; --i)
        {
            if (uint32 spellId = GetSpell(i))
                owner->RemoveAurasDueToSpell(spellId);
        }

        // Remove Sentry Totem aura on totem unsummon
        if (GetEntry() == SENTRY_TOTEM_ENTRY)
            owner->RemoveAurasDueToSpell(6495);

        //remove aura all party members too
        if (owner->GetTypeId() == TYPEID_PLAYER)
        {
            ((Player*)owner)->SendAutoRepeatCancel(this);

            // Not only the player can summon the totem (scripted AI)
            if (Group* pGroup = ((Player*)owner)->GetGroup())
            {
                for (GroupReference* itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
                {
                    Player* Target = itr->getSource();
                    if (Target && pGroup->SameSubGroup((Player*)owner, Target))
                    {
                        for (int32 i = maxIdx; i >= 0; --i)
                        {
                            if (uint32 spellId = GetSpell(i))
                                Target->RemoveAurasDueToSpell(spellId);
                        }
                    }
                }
            }
        }

        if (owner->GetTypeId() == TYPEID_UNIT && ((Creature*)owner)->AI())
            ((Creature*)owner)->AI()->SummonedCreatureDespawn((Creature*)this);
    }

    // any totem unsummon look like as totem kill, req. for proper animation
    if (isAlive())
        SetDeathState(DEAD);

    AddObjectToRemoveList();
}
开发者ID:gc,项目名称:mangos,代码行数:59,代码来源:Totem.cpp


示例15: RemoveFromWorld

void DynamicObject::Remove()
{
    if (IsInWorld())
    {
        RemoveFromWorld();
        AddObjectToRemoveList();
    }
}
开发者ID:Lyill,项目名称:TrinityCore,代码行数:8,代码来源:DynamicObject.cpp


示例16: SendObjectDeSpawnAnim

void GameObject::Delete()
{
    SendObjectDeSpawnAnim(GetGUID());

    SetGoState(1);
    SetUInt32Value(GAMEOBJECT_FLAGS, GetGOInfo()->flags);

    AddObjectToRemoveList();
}
开发者ID:Actionfox,项目名称:mangos,代码行数:9,代码来源:GameObject.cpp


示例17: SendObjectDeSpawnAnim

void AreaTrigger::Remove()
{
    if (IsInWorld())
    {
        SendObjectDeSpawnAnim(GetGUID());
        RemoveFromWorld();
        AddObjectToRemoveList();
    }
}
开发者ID:Myst,项目名称:ElunaTrinityCata,代码行数:9,代码来源:AreaTrigger.cpp


示例18: AddObjectToRemoveList

void TemporarySummon::UnSummon()
{
    AddObjectToRemoveList();

    Unit* sum = m_summoner ? GetMap()->GetUnit(m_summoner) : NULL;
    if (sum  && sum->GetTypeId() == TYPEID_UNIT && ((Creature*)sum)->IsAIEnabled)
    {
        ((Creature*)sum)->AI()->SummonedCreatureDespawn(this);
    }
}
开发者ID:wow4all,项目名称:HGCore,代码行数:10,代码来源:TemporarySummon.cpp


示例19: ForcedUnsummonDelayEvent

void Totem::UnSummon(uint32 msTime)
{
    if (msTime)
    {
        m_Events.AddEvent(new ForcedUnsummonDelayEvent(*this), m_Events.CalculateTime(msTime));
        return;
    }

    CombatStop();
    RemoveAurasDueToSpell(GetSpell(), GetGUID());

    // clear owner's totem slot
    for (uint8 i = SUMMON_SLOT_TOTEM; i < MAX_TOTEM_SLOT; ++i)
    {
        if (GetOwner()->m_SummonSlot[i] == GetGUID())
        {
            GetOwner()->m_SummonSlot[i].Clear();
            break;
        }
    }

    GetOwner()->RemoveAurasDueToSpell(GetSpell(), GetGUID());

    // Remove Sentry Totem Aura
    if (GetEntry() == SENTRY_TOTEM_ENTRY)
        GetOwner()->RemoveAurasDueToSpell(SENTRY_TOTEM_SPELLID);

    //remove aura all party members too
    if (Player* owner = GetOwner()->ToPlayer())
    {
        owner->SendAutoRepeatCancel(this);

        if (SpellInfo const* spell = sSpellMgr->GetSpellInfo(GetUInt32Value(UNIT_CREATED_BY_SPELL)))
            GetSpellHistory()->SendCooldownEvent(spell, 0, nullptr, false);

        if (Group* group = owner->GetGroup())
        {
            for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
            {
                Player* target = itr->GetSource();
                if (target && group->SameSubGroup(owner, target))
                    target->RemoveAurasDueToSpell(GetSpell(), GetGUID());
            }
        }
    }

    //npcbot: send SummonedCreatureDespawn()
    if (GetCreatorGUID().IsCreature())
        if (Unit* bot = ObjectAccessor::FindConnectedPlayer(GetCreatorGUID()))
            if (bot->ToCreature()->GetIAmABot())
                bot->ToCreature()->OnBotDespawn(this);
    //end npcbot

    AddObjectToRemoveList();
}
开发者ID:fannyfinal,项目名称:LordPsyanBots,代码行数:55,代码来源:Totem.cpp


示例20: ASSERT

void Corpse::DeleteBonesFromWorld() {
	ASSERT(GetType() == CORPSE_BONES);
	Corpse* corpse = ObjectAccessor::GetCorpse(*this, GetGUID());

	if (!corpse) {
		sLog->outError("Bones %u not found in world.", GetGUIDLow());
		return;
	}

	AddObjectToRemoveList();
}
开发者ID:Bootz,项目名称:DeepshjirRepack,代码行数:11,代码来源:Corpse.cpp



注:本文中的AddObjectToRemoveList函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ AddOption函数代码示例发布时间:2022-05-30
下一篇:
C++ AddObject函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap