当前位置: 首页>>代码示例>>C++>>正文


C++ RemoveFromWorld函数代码示例

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


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

示例1: GetGUID

void Creature::OnRemoveCorpse()
{
	// time to respawn!
	if (IsInWorld() && (int32)m_mapMgr->GetInstanceID() == m_instanceId)
	{

		sLog.outDetail("Removing corpse of "I64FMT"...", GetGUID());
	   
			if((GetMapMgr()->GetMapInfo() && GetMapMgr()->GetMapInfo()->type == INSTANCE_RAID && this->proto && this->proto->boss) || m_noRespawn)
			{
				RemoveFromWorld(false, true);
			}
			else
			{
				if(proto && proto->RespawnTime)
					RemoveFromWorld(true, false);
				else
					RemoveFromWorld(false, true);
			}
		
	   
		setDeathState(DEAD);

		m_position = m_spawnLocation;
	}
	else
	{
		// if we got here it's pretty bad
	}
}
开发者ID:AwkwardDev,项目名称:ascent_classic,代码行数:30,代码来源:Creature.cpp

示例2: RemoveFromWorld

Item::~Item()
{
	if( loot != NULL )
	{
		delete loot;
		loot = NULL;
	}

	sEventMgr.RemoveEvents( this );

	EnchantmentMap::iterator itr;
	for( itr = Enchantments.begin(); itr != Enchantments.end(); ++itr )
	{
		if( itr->second.Enchantment->type == 0 && itr->second.Slot == 0 && itr->second.ApplyTime == 0 && itr->second.Duration == 0 )
		{
			delete itr->second.Enchantment;
			itr->second.Enchantment = NULL;
		}
	}
	Enchantments.clear();

	if( IsInWorld() )
		RemoveFromWorld();

	m_owner = NULL;
}
开发者ID:AegisEmu,项目名称:AegisEmu,代码行数:26,代码来源:Item.cpp

示例3: RemoveFromWorld

void Vehicle::DeleteMe()
{
	if(IsInWorld())
		RemoveFromWorld(false, true);

	Destruct();
}
开发者ID:SkyFire,项目名称:sandshroud,代码行数:7,代码来源:Vehicle.cpp

示例4: data

void DynamicObject::Remove()
{
    if (!IsInWorld())
    {
        delete this;
        return;
    }

    for (std::set< uint64 >::iterator itr = targets.begin(); itr != targets.end(); ++itr)
    {
        uint64 TargetGUID = *itr;

        if (Unit* target = m_mapMgr->GetUnit(TargetGUID))
            target->RemoveAura(m_spellProto->Id);
    }

    WorldPacket data(SMSG_GAMEOBJECT_DESPAWN_ANIM, 8);

    data << GetGUID();
    SendMessageToSet(&data, false);

    if (IsInWorld())
        RemoveFromWorld(true);

    if (u_caster != NULL && m_spellProto->ChannelInterruptFlags != 0)
    {
        u_caster->SetChannelSpellTargetGUID(0);
        u_caster->SetChannelSpellId(0);
    }

    delete this;
}
开发者ID:lev1976g,项目名称:easywow,代码行数:32,代码来源:DynamicObject.cpp

示例5: RemoveFromWorld

void GameObject::_Expire()
{
	if(IsInWorld())
		RemoveFromWorld(true);

	Destructor();
}
开发者ID:arcticdev,项目名称:arctic-test,代码行数:7,代码来源:GameObject.cpp

示例6: RemoveFromWorld

void Corpse::Despawn()
{
    if (this->IsInWorld())
    {
        RemoveFromWorld(false);
    }
}
开发者ID:AscEmu,项目名称:AscEmu_TBC,代码行数:7,代码来源:Corpse.cpp

示例7: SendObjectDeSpawnAnim

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

示例8: GetMap

void Transport::TeleportTransport(uint32 newMapid, float x, float y, float z)
{
    Map const* oldMap = GetMap();
    Relocate(x, y, z);

    for(PlayerSet::const_iterator itr = m_passengers.begin(); itr != m_passengers.end();)
    {
        Player* pPlayer = *itr;
        ++itr;

        if(pPlayer->isDead() && !pPlayer->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST))
            pPlayer->ResurrectPlayer(1.0f);

        pPlayer->TeleportTo(newMapid, x, y, z, GetOrientation(), TELE_TO_NOT_LEAVE_TRANSPORT);
    }

    //we need to create and save new Map object with 'newMapid' because if not done -> lead to invalid Map object reference...
    //player far teleport would try to create same instance, but we need it NOW for transport...

    RemoveFromWorld();
    ResetMap();
    Map * newMap = sMapMgr->CreateMap(newMapid, this, 0);
    SetMap(newMap);
    ASSERT(GetMap());
    AddToWorld();

    if(oldMap != newMap)
    {
        UpdateForMap(oldMap);
        UpdateForMap(newMap);
    }

    for(CreatureSet::iterator itr = m_NPCPassengerSet.begin(); itr != m_NPCPassengerSet.end(); ++itr)
        (*itr)->FarTeleportTo(newMap, x, y, z, (*itr)->GetOrientation());
}
开发者ID:ahuraa,项目名称:ServerMythCore,代码行数:35,代码来源:Transport.cpp

示例9: RemoveFromWorld

void Creature::Update( uint32 p_time )
{
	Unit::Update( p_time );
	if(IsTotem() && isDead())
	{
		RemoveFromWorld(false, true);
		delete this;
		return;
	}

	if(m_corpseEvent)
	{
		sEventMgr.RemoveEvents(this);
		if(this->proto==NULL)
			sEventMgr.AddEvent(this, &Creature::OnRemoveCorpse, EVENT_CREATURE_REMOVE_CORPSE, 1000, 1, EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT);
		else if (this->creature_info->Rank == ELITE_WORLDBOSS)
			sEventMgr.AddEvent(this, &Creature::OnRemoveCorpse, EVENT_CREATURE_REMOVE_CORPSE, TIME_CREATURE_REMOVE_BOSSCORPSE, 1,EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT);
		else if ( this->creature_info->Rank == ELITE_RAREELITE || this->creature_info->Rank == ELITE_RARE)
			sEventMgr.AddEvent(this, &Creature::OnRemoveCorpse, EVENT_CREATURE_REMOVE_CORPSE, TIME_CREATURE_REMOVE_RARECORPSE, 1,EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT);
		else
			sEventMgr.AddEvent(this, &Creature::OnRemoveCorpse, EVENT_CREATURE_REMOVE_CORPSE, TIME_CREATURE_REMOVE_CORPSE, 1,EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT);

		m_corpseEvent=false;
	}
}
开发者ID:AwkwardDev,项目名称:ascent_classic,代码行数:25,代码来源:Creature.cpp

示例10: _isFixedAndCantHaveChildren

Critter::Critter(Type type, const RN::Vector3 &position) :
    _isFixedAndCantHaveChildren(false)
{
    SetPosition(position);
    SetRenderGroup(31);
    SetTag(kWHCritterTag);

    SetType(type);

    NavigationAgent *agent = new NavigationAgent();
    AddAttachment(agent);

    agent->Enable();
    agent->Release();

    RN::MessageCenter::GetSharedInstance()->AddObserver(kWHWorldSpawningStoppedMessage, [this](RN::Message *message) {
        RemoveFromWorld();
    }, this);

    RN::MessageCenter::GetSharedInstance()->AddObserver(RNCSTR("fuckoff"), [this](RN::Message *message) {

        RN::Value *value = static_cast<RN::Value *>(message->GetObject());
        SetTarget(value->GetValue<RN::Vector3>());

    }, this);
}
开发者ID:uberpixel,项目名称:The-White-House,代码行数:26,代码来源:WHCritter.cpp

示例11: RemoveFromWorld

void GameObject::EndFishing(Player* player, bool abort )
{
	Spell * spell = player->GetCurrentSpell();
	
	if(spell)
	{
		if(abort)   // abort becouse of a reason
		{
			//FIXME: here 'failed' should appear over progress bar
			spell->cancel();
		}
		else		// spell ended
		{
			if (!(GetUInt32Value(GAMEOBJECT_FLAGS) & 32)) // if there was no loot
				spell->SendCastResult(SPELL_FAILED_NO_FISH);

			spell->SendChannelUpdate(0);
			spell->finish();

			/*if(this->IsInWorld())
				RemoveFromWorld();
			delete this;*/

			ExpireAndDelete();
			return;
		}
	}
	else // if this is called, and there is no spell so remove the gameobject
	{
		if(this->IsInWorld())
				RemoveFromWorld();
		delete this;
	}
}
开发者ID:Sylica2013,项目名称:Antrix,代码行数:34,代码来源:GameObject.cpp

示例12: GetPhysicsSettings

 void ActorRigid::_Update()
 {
     StickyData* StickyD = GetPhysicsSettings()->GetStickyData();
     if(StickyD->CreationQueue.empty())
         return;
     RemoveFromWorld();
     AddToWorld();
     for( Whole X = 0 ; X < StickyD->CreationQueue.size() ; ++X )
     {
         StickyConstraintConstructionInfo& CurrInfo = StickyD->CreationQueue[X];
         /*ObjectPair NewPair(CurrInfo.ActA,CurrInfo.ActB);
         Collision* Col = Entresol::GetSingletonPtr()->GetPhysicsManager()->GetCollision(&NewPair);
         if(Col) Entresol::GetSingletonPtr()->GetPhysicsManager()->RemoveCollision(Col);//*/
         StickyConstraint* NewSticky = new StickyConstraint(CurrInfo.ActA,CurrInfo.ActB,CurrInfo.TransA,CurrInfo.TransB);
         NewSticky->SetAngularLimitLower(Vector3());
         NewSticky->SetAngularLimitUpper(Vector3());
         NewSticky->SetLinearLimitLower(Vector3());
         NewSticky->SetLinearLimitUpper(Vector3());
         /*NewSticky->SetUpperLinLimit(0.0);
         NewSticky->SetUpperAngLimit(0.0);
         NewSticky->SetLowerLinLimit(0.0);
         NewSticky->SetLowerAngLimit(0.0);//*/
         Entresol::GetSingletonPtr()->GetPhysicsManager()->_GetPhysicsWorldPointer()->addConstraint(NewSticky->GetConstraintBase(),true);
         StickyD->StickyConstraints.push_back(NewSticky);
         CurrInfo.ActA->GetPhysicsSettings()->GetStickyData()->StickyConstraints.push_back(NewSticky);
         NewSticky->GetConstraintBase()->setOverrideNumSolverIterations(100);
     }
     StickyD->CreationQueue.clear();
 }
开发者ID:zester,项目名称:Mezzanine,代码行数:29,代码来源:actorrigid.cpp

示例13: FlushLevelStreaming

void UWorld::RefreshStreamingLevels( const TArray<class ULevelStreaming*>& InLevelsToRefresh )
{
	// Reassociate levels in case we changed streaming behavior. Editor-only!
	if( GIsEditor )
	{
		// Load and associate levels if necessary.
		FlushLevelStreaming();

		// Remove all currently visible levels.
		for( int32 LevelIndex=0; LevelIndex<InLevelsToRefresh.Num(); LevelIndex++ )
		{
			ULevelStreaming* StreamingLevel = InLevelsToRefresh[LevelIndex];
			ULevel* LoadedLevel = StreamingLevel ? StreamingLevel->GetLoadedLevel() : nullptr;

			if( LoadedLevel &&
				LoadedLevel->bIsVisible )
			{
				RemoveFromWorld( LoadedLevel );
			}
		}

		// Load and associate levels if necessary.
		FlushLevelStreaming();

		// Update the level browser so it always contains valid data
		FEditorSupportDelegates::WorldChange.Broadcast();
	}
}
开发者ID:magetron,项目名称:UnrealEngine4-mod,代码行数:28,代码来源:LevelActor.cpp

示例14: RemoveFromWorld

//------------------------------------------------------------------------------
//! Dtor
//! 
CBulletObjectAnimator::~CBulletObjectAnimator()
{
  RemoveFromWorld();
  SAFE_DELETE(bulletMesh);
  SAFE_DELETE(collisionShape);
  SAFE_DELETE(motionState);
  SAFE_DELETE(rigidBody);
}
开发者ID:JamesLee2,项目名称:ukgtut,代码行数:11,代码来源:CBulletObjectAnimator.cpp

示例15: RemoveFromWorld

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


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