本文整理汇总了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
}
}
示例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;
}
示例3: RemoveFromWorld
void Vehicle::DeleteMe()
{
if(IsInWorld())
RemoveFromWorld(false, true);
Destruct();
}
示例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;
}
示例5: RemoveFromWorld
void GameObject::_Expire()
{
if(IsInWorld())
RemoveFromWorld(true);
Destructor();
}
示例6: RemoveFromWorld
void Corpse::Despawn()
{
if (this->IsInWorld())
{
RemoveFromWorld(false);
}
}
示例7: SendObjectDeSpawnAnim
void DynamicObject::Remove() {
if (IsInWorld()) {
SendObjectDeSpawnAnim(GetGUID());
RemoveFromWorld();
AddObjectToRemoveList();
}
}
示例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());
}
示例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;
}
}
示例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);
}
示例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;
}
}
示例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();
}
示例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();
}
}
示例14: RemoveFromWorld
//------------------------------------------------------------------------------
//! Dtor
//!
CBulletObjectAnimator::~CBulletObjectAnimator()
{
RemoveFromWorld();
SAFE_DELETE(bulletMesh);
SAFE_DELETE(collisionShape);
SAFE_DELETE(motionState);
SAFE_DELETE(rigidBody);
}
示例15: RemoveFromWorld
void DynamicObject::Remove()
{
if (IsInWorld())
{
RemoveFromWorld();
AddObjectToRemoveList();
}
}