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


C++ IsInWorld函数代码示例

本文整理汇总了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;
	}
}
开发者ID:Arkshine,项目名称:NS,代码行数:16,代码来源:ggrenade.cpp

示例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();
}
开发者ID:Bootz,项目名称:S6.RO.WoW,代码行数:16,代码来源:TemporarySummon.cpp

示例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);
    }
}
开发者ID:Brayna01222,项目名称:Core-Trinity,代码行数:16,代码来源:Cfbg.cpp

示例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();
}
开发者ID:Bootz,项目名称:S6.RO.WoW,代码行数:16,代码来源:TemporarySummon.cpp

示例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);
    }
}
开发者ID:deathkayn,项目名称:Core-W,代码行数:16,代码来源:Transport.cpp

示例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();
}
开发者ID:WowDevs,项目名称:Sandshroud,代码行数:17,代码来源:Item.cpp

示例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);
    }
}
开发者ID:Sandshroud,项目名称:Sandshroud-Prodigy,代码行数:17,代码来源:ReputationHandler.cpp

示例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();
}
开发者ID:AegisEmu,项目名称:AegisEmu,代码行数:18,代码来源:Item.cpp

示例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 );
	}
}
开发者ID:FWGS,项目名称:XashXT,代码行数:18,代码来源:ggrenade.cpp

示例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();
	}
}
开发者ID:SkyFire,项目名称:sandshroud,代码行数:44,代码来源:Vehicle.cpp

示例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();
}
开发者ID:kmishima,项目名称:DarkCore,代码行数:19,代码来源:TemporarySummon.cpp

示例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
	}
}
开发者ID:Selenah,项目名称:ArcEmu,代码行数:19,代码来源:ReputationHandler.cpp

示例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();
}
开发者ID:oMadMano,项目名称:MistyWorld_6xx,代码行数:19,代码来源:TemporarySummon.cpp

示例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;
}
开发者ID:Chero,项目名称:abcwow,代码行数:19,代码来源:DynamicObject.cpp

示例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());
    }
}
开发者ID:Rochet2,项目名称:TrinityCore,代码行数:19,代码来源:AreaTrigger.cpp


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