本文整理汇总了C++中IsInWorld函数的典型用法代码示例。如果您正苦于以下问题:C++ IsInWorld函数的具体用法?C++ IsInWorld怎么用?C++ IsInWorld使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了IsInWorld函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DangerSoundThink
void CGrenade::DangerSoundThink( void )
{
if (!IsInWorld())
{
UTIL_Remove( this );
return;
}
CSoundEnt::InsertSound ( bits_SOUND_DANGER, pev->origin + pev->velocity * 0.5, pev->velocity.Length( ), 0.2 );
pev->nextthink = gpGlobals->time + 0.2;
if (pev->waterlevel != 0)
{
pev->velocity = pev->velocity * 0.5;
}
}
示例2: ASSERT
void TempSummon::UnSummon()
{
//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();
}
示例3: SendChatMessage
void Player::SendChatMessage(const char *format, ...)
{
if (!IsInWorld())
return;
if (format)
{
va_list ap;
char str [2048];
va_start(ap, format);
vsnprintf(str, 2048, format, ap);
va_end(ap);
ChatHandler(GetSession()).SendSysMessage(str);
}
}
示例4: RemoveFromWorld
void TempSummon::RemoveFromWorld()
{
if (!IsInWorld())
return;
if (m_Properties)
if (uint32 slot = m_Properties->Slot)
if (Unit* owner = GetSummoner())
if (owner->m_SummonSlot[slot] == GetGUID())
owner->m_SummonSlot[slot] = 0;
//if (GetOwnerGUID())
// sLog.outError("Unit %u has owner guid when removed from world", GetEntry());
Creature::RemoveFromWorld();
}
示例5: AddPassenger
void Transport::AddPassenger(WorldObject* passenger)
{
if (!IsInWorld())
return;
if (_passengers.insert(passenger).second)
{
passenger->SetTransport(this);
passenger->m_movementInfo.AddMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
passenger->m_movementInfo.transport.guid = GetGUID();
TC_LOG_DEBUG("entities.transport", "Object %s boarded transport %s.", passenger->GetName().c_str(), GetName().c_str());
if (Player* plr = passenger->ToPlayer())
sScriptMgr->OnAddPassenger(this, plr);
}
}
示例6: DestroyForPlayer
void Item::RemoveFromWorld()
{
// if we have an owner->send destroy
if( m_owner != NULL )
{
DestroyForPlayer( m_owner );
}
if( !IsInWorld() )
return;
m_mapMgr->RemoveObject( TO_OBJECT(this), false );
m_mapMgr = NULLMAPMGR;
// update our event holder
event_Relocate();
}
示例7: SetFlagVisible
void Player::Reputation_OnTalk(FactionDBC * dbc)
{
// set faction visible if not visible
if(!dbc || dbc->RepListId < 0)
return;
FactionReputation * rep = reputationByListId[dbc->RepListId];
if(!rep)
return;
if(!Visible(rep->flag))
{
SetFlagVisible(rep->flag);
if(IsInWorld())
m_session->OutPacket(SMSG_SET_FACTION_VISIBLE, 4, &dbc->RepListId);
}
}
示例8: DestroyForPlayer
void Item::RemoveFromWorld()
{
// if we have an owner->send destroy
if( m_owner != NULL )
{
DestroyForPlayer( m_owner );
}
if( !IsInWorld() )
return;
mSemaphoreTeleport = true;
m_mapMgr->RemoveObject( this, false );
m_mapMgr = NULL;
// update our event holder
event_Relocate();
}
示例9: DangerSoundThink
void CGrenade::DangerSoundThink( void )
{
if( !IsInWorld( ))
{
UTIL_Remove( this );
return;
}
CSoundEnt::InsertSound( bits_SOUND_DANGER, GetAbsOrigin() + GetAbsVelocity() * 0.5, GetAbsVelocity().Length( ), 0.2 );
pev->nextthink = gpGlobals->time + 0.2;
if( pev->waterlevel != 0 )
{
Vector vecVelocity = GetAbsVelocity();
vecVelocity *= 0.5f;
SetAbsVelocity( vecVelocity );
}
}
示例10: Despawn
void Vehicle::Despawn(uint32 delay, uint32 respawntime)
{
if(delay)
{
sEventMgr.AddEvent(TO_VEHICLE(this), &Vehicle::Despawn, (uint32)0, respawntime, EVENT_VEHICLE_RESPAWN, delay, 1,0);
return;
}
if(!IsInWorld())
return;
if(respawntime)
{
for(int i = 0; i < 8; i++)
{
if(m_passengers[i] != NULL)
{
if(m_passengers[i]->IsPlayer())
// Remove any passengers
RemovePassenger(m_passengers[i]);
else
m_passengers[i]->Destruct();
}
}
/* get the cell with our SPAWN location. if we've moved cell this might break :P */
MapCell * pCell = m_mapMgr->GetCellByCoords(m_spawnLocation.x, m_spawnLocation.y);
if(!pCell)
pCell = m_mapCell;
ASSERT(pCell);
pCell->_respawnObjects.insert(TO_OBJECT(this));
sEventMgr.RemoveEvents(this);
sEventMgr.AddEvent(m_mapMgr, &MapMgr::EventRespawnVehicle, TO_VEHICLE(this), pCell, EVENT_VEHICLE_RESPAWN, respawntime, 1, 0);
Unit::RemoveFromWorld(false);
m_position = m_spawnLocation;
m_respawnCell=pCell;
}
else
{
Unit::RemoveFromWorld(true);
SafeDelete();
}
}
示例11: 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);
AddObjectToRemoveList();
}
示例12: Reputation_OnTalk
void Player::Reputation_OnTalk(FactionDBC* dbc)
{
// set faction visible if not visible
if(dbc == NULL || dbc->RepListId < 0)
return;
FactionReputation* rep = reputationByListId[dbc->RepListId];
if(rep == NULL)
return;
if(SetFlagVisible(rep->flag, true) && IsInWorld())
{
m_session->OutPacket(SMSG_SET_FACTION_VISIBLE, 4, &dbc->RepListId);
#ifdef OPTIMIZED_PLAYER_SAVING
save_Reputation();
#endif
}
}
示例13: RemoveFromWorld
void TempSummon::RemoveFromWorld()
{
if (!IsInWorld())
return;
if (m_Properties)
{
int32 slot = m_Properties->Slot;
if (slot > 0)
if (Unit* owner = GetSummoner())
if (owner->m_SummonSlot[slot] == GetGUID())
owner->m_SummonSlot[slot] = 0;
}
//if (GetOwnerGUID())
// TC_LOG_ERROR("entities.unit", "Unit %u has owner guid when removed from world", GetEntry());
Creature::RemoveFromWorld();
}
示例14: while
void DynamicObject::Remove()
{
// remove aura from all targets
DynamicObjectList::iterator jtr = targets.begin();
DynamicObjectList::iterator jend = targets.end();
Unit * target;
while(jtr != jend)
{
target = GetMapMgr() ? GetMapMgr()->GetUnit(*jtr) : NULL;
++jtr;
if (target != NULL)
target->RemoveAura(m_spellProto->Id);
}
if(IsInWorld())
RemoveFromWorld(true);
delete this;
}
示例15: RemoveFromWorld
void AreaTrigger::RemoveFromWorld()
{
///- Remove the AreaTrigger from the accessor and from all lists of objects in world
if (IsInWorld())
{
_isRemoved = true;
if (Unit* caster = GetCaster())
caster->_UnregisterAreaTrigger(this);
// Handle removal of all units, calling OnUnitExit & deleting auras if needed
HandleUnitEnterExit({});
_ai->OnRemove();
WorldObject::RemoveFromWorld();
GetMap()->GetObjectsStore().Remove<AreaTrigger>(GetGUID());
}
}