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

C++ REMOVE_ENTITY函数代码示例

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

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



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

示例1: GenericCyclerSpawn

void CInfoCommentary :: GenericCyclerSpawn(char *szModel, Vector vecMin, Vector vecMax)
{
	if (!szModel || !*szModel)
	{
		ALERT(at_error, "cycler at %.0f %.0f %0.f missing modelname", pev->origin.x, pev->origin.y, pev->origin.z );
		REMOVE_ENTITY(ENT(pev));
		return;
	}

	//ignored on subsequent calls
	char* szSoundFile = (char*) STRING(pev->message);

	if ( !FStringNull( pev->message ) && strlen( szSoundFile ) > 1 )
	{
		PRECACHE_SOUND(szSoundFile);
	}
	//ignored on subsequent calls

	pev->classname		= MAKE_STRING("info_commentary");
	PRECACHE_MODEL( szModel );
	SET_MODEL(ENT(pev),	szModel);

	CCycler::Spawn( );

	UTIL_SetSize(pev, vecMin, vecMax);
}
开发者ID:JoelTroch,项目名称:am_src_rebirth,代码行数:26,代码来源:h_cycler.cpp


示例2: BloodGush

void CCineBlood :: BloodGush ( void )
{
    Vector	vecSplatDir;
    TraceResult	tr;
    pev->nextthink = gpGlobals->time + 0.1;

    UTIL_MakeVectors(pev->angles);
    if ( pev->health-- < 0 )
        REMOVE_ENTITY(ENT(pev));
// CHANGE_METHOD ( ENT(pev), em_think, SUB_Remove );

    if ( RANDOM_FLOAT ( 0 , 1 ) < 0.7 )// larger chance of globs
    {
        UTIL_BloodDrips( pev->origin, UTIL_RandomBloodVector(), BLOOD_COLOR_RED, 10 );
    }
    else// slim chance of geyser
    {
        UTIL_BloodStream( pev->origin, UTIL_RandomBloodVector(), BLOOD_COLOR_RED, RANDOM_LONG(50, 150) );
    }

    if ( RANDOM_FLOAT ( 0, 1 ) < 0.75 )
    {   // decals the floor with blood.
        vecSplatDir = Vector ( 0 , 0 , -1 );
        vecSplatDir = vecSplatDir + (RANDOM_FLOAT(-1,1) * 0.6 * gpGlobals->v_right) + (RANDOM_FLOAT(-1,1) * 0.6 * gpGlobals->v_forward);// randomize a bit
        UTIL_TraceLine( pev->origin + Vector ( 0, 0 , 64) , pev->origin + vecSplatDir * 256, ignore_monsters, ENT(pev), &tr);
        if ( tr.flFraction != 1.0 )
        {
            // Decal with a bloodsplat
            UTIL_BloodDecalTrace( &tr, BLOOD_COLOR_RED );
        }
    }
}
开发者ID:puzl,项目名称:NS3.2,代码行数:32,代码来源:h_cine.cpp


示例3: Spawn

//=========================================================
//=========================================================
void CFlockingFlyerFlock :: Spawn( )
{
	Precache( );
	SpawnFlock();

	REMOVE_ENTITY(ENT(pev));		// dump the spawn ent
}
开发者ID:Hammermaps-DEV,项目名称:opposing-force-rebuilded-sdk,代码行数:9,代码来源:aflock.cpp


示例4: GetAddressVtableByClassname

void HIDDEN GetAddressVtableByClassname(const char *szClassName, const int iOffset, bool bCreate)
{
	void *vtable;

	if (bCreate)
	{
		edict_t *pObject = CREATE_ENTITY();

		void *addr = GetFunctionEntity(szClassName);
	
		if (addr == NULL)
		{
			//can't create object. 
			printf2(__FUNCTION__ ":: Not found export function of binaries. Presumably looks '__declspec(dllexport) void %s(entvars_t *pev)'", szClassName);
			REMOVE_ENTITY(pObject);
			return;
		}

		// call link to class GetClassPtr<BaseClass>(pev);
		reinterpret_cast<void (*)(entvars_t *)>(addr)(&pObject->v);

		vtable = *(void **)pObject->pvPrivateData;
	}
	else
	{
		VirtualTableRef *refsVtbl = GetVirtualTableRefAddr(szClassName);
		vtable = (void *)refsVtbl->originalAddress;
	}

	printf2(__FUNCTION__ "* ADDRESS VTABLE: %p | ADDRESS VIRTUAL FUNC: %p",
		OffsetToRebase((size_t)vtable),
		OffsetToRebase(*(((size_t **)&vtable)[ iOffset ])));
}
开发者ID:Arkshine,项目名称:ReGameDLL_CS,代码行数:33,代码来源:memory.cpp


示例5: switch

void CWorldItem::Spawn( void )
{
	CBaseEntity *pEntity = NULL;

	switch (m_iType) 
	{
	case 44: // ITEM_BATTERY:
		pEntity = CBaseEntity::Create( "item_battery", pev->origin, pev->angles );
		break;
	case 42: // ITEM_ANTIDOTE:
		pEntity = CBaseEntity::Create( "item_antidote", pev->origin, pev->angles );
		break;
	case 43: // ITEM_SECURITY:
		pEntity = CBaseEntity::Create( "item_security", pev->origin, pev->angles );
		break;
	case 45: // ITEM_SUIT:
		pEntity = CBaseEntity::Create( "item_suit", pev->origin, pev->angles );
		break;
	}

	if (!pEntity)
	{
		ALERT( at_console, "unable to create world_item %d\n", m_iType );
	}
	else
	{
		pEntity->pev->target = pev->target;
		pEntity->pev->targetname = pev->targetname;
		pEntity->pev->spawnflags = pev->spawnflags;
	}

	REMOVE_ENTITY(edict());
}
开发者ID:Arkshine,项目名称:HLEnhanced,代码行数:33,代码来源:items.cpp


示例6: switch

void CWorldItem::__MAKE_VHOOK(Spawn)()
{
	CBaseEntity *pEntity = NULL;

	switch (m_iType)
	{
	case 41: // ITEM_HEALTHKIT
		break;
	case 42: // ITEM_ANTIDOTE
		pEntity = CBaseEntity::Create("item_antidote", pev->origin, pev->angles);
		break;
	case 43: // ITEM_SECURITY
		pEntity = CBaseEntity::Create("item_security", pev->origin, pev->angles);
		break;
	case 44: // ITEM_BATTERY
		pEntity = CBaseEntity::Create("item_battery", pev->origin, pev->angles);
		break;
	case 45: // ITEM_SUIT
		pEntity = CBaseEntity::Create("item_suit", pev->origin, pev->angles);
		break;
	}

	if (pEntity != NULL)
	{
		pEntity->pev->target = pev->target;
		pEntity->pev->targetname = pev->targetname;
		pEntity->pev->spawnflags = pev->spawnflags;
	}

	REMOVE_ENTITY(edict());
}
开发者ID:a1batross,项目名称:ReGameDLL_CS,代码行数:31,代码来源:items.cpp


示例7: VirtualProtect

void NPC::Remove()
{
	m_workNPC = false;

	if (vtable != null)
	{
		int **ivtable = (int **)vtable;

		if (vFcTraceAttack != null)
		{
			DWORD OldFlags;
			VirtualProtect(&ivtable[TraceAttackOffset], sizeof(int*), PAGE_READWRITE, &OldFlags);
			ivtable[TraceAttackOffset] = (int *)vFcTraceAttack;
			VirtualFree(HookTraceAttack, 0, MEM_RELEASE);
		}

		if (vFcTakeDamage != null)
		{
			DWORD OldFlags;
			VirtualProtect(&ivtable[TakeDamageOffset], sizeof(int*), PAGE_READWRITE, &OldFlags);
			ivtable[TakeDamageOffset] = (int *)vFcTakeDamage;
			VirtualFree(HookTakeDamage, 0, MEM_RELEASE);
		}
	}

	if (pev != null && !FNullEnt(GetEntity()) && pvData == GetEntity()->pvPrivateData)
	{
		SetEntityAction(GetIndex(), -1, -1);
		REMOVE_ENTITY(GetEntity());
	}
}
开发者ID:CCNHsK-Dev,项目名称:SyPB,代码行数:31,代码来源:npc_ai.cpp


示例8: csdm_give_item

//shamelessly pulled from fun
static cell AMX_NATIVE_CALL csdm_give_item(AMX *amx, cell *params) // native give_item(index, const item[]); = 2 params
{
	// Check index.
	if (params[1] < 1 || params[1] > gpGlobals->maxClients)
	{
		MF_LogError(amx, AMX_ERR_NATIVE, "Invalid player %d", params[1]);
		return 0;
	} else if (!MF_IsPlayerIngame(params[1])) {
		MF_LogError(amx, AMX_ERR_NATIVE, "Player %d is not in game", params[1]);
		return 0;
	}

	// Get player pointer.
	edict_t *pPlayer = MF_GetPlayerEdict(params[1]);

	// Create item entity pointer
	edict_t	*pItemEntity;

	// Make an "intstring" out of 2nd parameter
	int length;
	const char *szItem = MF_GetAmxString(amx, params[2], 1, &length);

	//check for valid item
	if (strncmp(szItem, "weapon_", 7) && 
		strncmp(szItem, "ammo_", 5) && 
		strncmp(szItem, "item_", 5) &&
		strncmp(szItem, "tf_weapon_", 10)
	) {
		return 0;
	}

	string_t item = ALLOC_STRING(szItem); // Using MAKE_STRING makes "item" contents get lost when we leave this scope! ALLOC_STRING seems to allocate properly...
	pItemEntity = CREATE_NAMED_ENTITY(item);

	if (FNullEnt(pItemEntity)) {
		MF_LogError(amx, AMX_ERR_NATIVE, "Item \"%s\" failed to create", szItem);
		return 0;
	}

	pItemEntity->v.origin = pPlayer->v.origin;
	pItemEntity->v.spawnflags |= (1 << 30);	//SF_NORESPAWN;

	MDLL_Spawn(pItemEntity);

	int save = pItemEntity->v.solid;

	MDLL_Touch(pItemEntity, ENT(pPlayer));

	if (pItemEntity->v.solid == save)
	{
		REMOVE_ENTITY(pItemEntity);
		//the function did not fail - we're just deleting the item
		return -1;
	}

	return ENTINDEX(pItemEntity);
}
开发者ID:Arkshine,项目名称:CSDM,代码行数:58,代码来源:csdm_natives.cpp


示例9: SUB_UseTargets

/* <184158> ../cstrike/dlls/subs.cpp:357 */
void CBaseDelay::DelayThink(void)
{
	CBaseEntity *pActivator = NULL;
	if (pev->owner)
		pActivator = CBaseEntity::Instance(pev->owner);

	SUB_UseTargets(pActivator, (USE_TYPE)pev->button, 0.0f);
	REMOVE_ENTITY(ENT(pev));
}
开发者ID:omertelli,项目名称:ReGameDLL_CS,代码行数:10,代码来源:subs.cpp


示例10: SUB_UseTargets

void CBaseDelay::DelayThink( void )
{
	CBaseEntity *pActivator = NULL;

	// The use type is cached (and stashed) in pev->button
	//LRC - now using m_hActivator.
	SUB_UseTargets( m_hActivator, (USE_TYPE)pev->button, 0 );
	REMOVE_ENTITY(ENT(pev));
}
开发者ID:Hammermaps-DEV,项目名称:Spirit-of-Half-Life-1.8--VC2010,代码行数:9,代码来源:subs.cpp


示例11: UpdateOnRemove

/* <183f38> ../cstrike/dlls/subs.cpp:120 */
void CBaseEntity::SUB_Remove(void)
{
	UpdateOnRemove();
	if (pev->health > 0)
	{
		pev->health = 0;
		ALERT(at_aiconsole, "SUB_Remove called on entity with health > 0\n");
	}

	REMOVE_ENTITY(ENT(pev));
}
开发者ID:omertelli,项目名称:ReGameDLL_CS,代码行数:12,代码来源:subs.cpp


示例12: RemoveAllNodeEntity

void RemoveAllNodeEntity()
{
   CEntity *pFoundNode = UTIL_FindEntityByClassname(NULL, "info_node");
   if (pFoundNode == NULL)
      return; // No node entities

   do {
      CEntity *pNextNode = UTIL_FindEntityByClassname(pFoundNode, "info_node");
      REMOVE_ENTITY(pFoundNode->edict());
      pFoundNode = pNextNode;
   } while (pFoundNode != NULL);
}
开发者ID:CecilHarvey,项目名称:gina,代码行数:12,代码来源:engine_util.cpp


示例13: remove_entity

static cell AMX_NATIVE_CALL remove_entity(AMX *amx, cell *params)
{
	int id = params[1];
	edict_t *pEnt = INDEXENT2(id);

	if (FNullEnt(pEnt))
		return 0;
	
	REMOVE_ENTITY(pEnt);

	return 1;
}
开发者ID:Chuvi-w,项目名称:amxmodx,代码行数:12,代码来源:entity.cpp


示例14: SUB_Remove

// Convenient way to delay removing oneself
void CBaseEntity :: SUB_Remove( void )
{
	UpdateOnRemove();
	if (pev->health > 0)
	{
		// this situation can screw up monsters who can't tell their entity pointers are invalid.
		pev->health = 0;
		ALERT( at_aiconsole, "SUB_Remove called on entity with health > 0\n");
	}

	REMOVE_ENTITY(ENT(pev));
}
开发者ID:nekonomicon,项目名称:QuakeRemakeDevkit,代码行数:13,代码来源:subs.cpp


示例15: SUB_UseTargets

void CBaseDelay::DelayThink( void )
{
	CBaseEntity *pActivator = NULL;

	if ( pev->owner != NULL )		// A player activated this on delay
	{
		pActivator = CBaseEntity::Instance( pev->owner );	
	}
	// The use type is cached (and stashed) in pev->button
	SUB_UseTargets( pActivator, (USE_TYPE)pev->button, 0 );
	REMOVE_ENTITY(ENT(pev));
}
开发者ID:Skumek,项目名称:hlsdk,代码行数:12,代码来源:subs.cpp


示例16: REMOVE_ENTITY

void CEnvGlobal::Spawn( void )
{
	if ( !m_globalstate )
	{
		REMOVE_ENTITY( ENT(pev) );
		return;
	}
	if ( FBitSet( pev->spawnflags, SF_GLOBAL_SET ) )
	{
		if ( !gGlobalState.EntityInTable( m_globalstate ) )
			gGlobalState.EntityAdd( m_globalstate, gpGlobals->mapname, (GLOBALESTATE)m_initialstate );
	}
}
开发者ID:Fograin,项目名称:hl-subsmod-ex,代码行数:13,代码来源:buttons.cpp


示例17: Spawn

void CLight :: Spawn( void )
{
	if( FStringNull( pev->targetname ))
	{       	
		// inert light
		REMOVE_ENTITY(ENT( pev ));
		return;
	}
	
	if (FBitSet(pev->spawnflags,SF_LIGHT_START_OFF))
		m_iState = STATE_OFF;
	else	m_iState = STATE_ON;
	SetCorrectStyle();
}
开发者ID:a1batross,项目名称:Xash3D_ancient,代码行数:14,代码来源:lights.cpp


示例18: g_fn_GetAmxString

cell AMX_NATIVE_CALL Rage::GetFunctionFromClass(AMX* amx,cell* params)
{
	int len;
	char *func_name = g_fn_GetAmxString(amx,params[1],0,&len);

	VirtualFunction** virtual_function_ptr = Global::virtualFunctionsManager.get_by_label(func_name);
	
	if(!virtual_function_ptr)
	{
		MF_LogError(amx, AMX_ERR_NATIVE, "Virtual function %s not registered",func_name);
		return -1;
	}

	VirtualFunction* virtual_function = *virtual_function_ptr;

	char* class_name = g_fn_GetAmxString(amx,params[2],0,&len);

	static char class_name_cp[50];
	strncpy(class_name_cp,class_name,49);

	edict_t *entity = CREATE_ENTITY();
	CALL_GAME_ENTITY(PLID,class_name,&entity->v);

	if(!entity->pvPrivateData)
	{
		REMOVE_ENTITY(entity);

		MF_LogError(amx, AMX_ERR_NATIVE,"Unable to create an entity of class '%s'",class_name);
		return -1;
	}

	int ret = virtual_function->create_get_id(entity->pvPrivateData,class_name_cp);
	
	REMOVE_ENTITY(entity);

	return ret;
}
开发者ID:Arkshine,项目名称:Rage,代码行数:37,代码来源:rage.cpp


示例19: REMOVE_ENTITY

void CEnvGlobal::__MAKE_VHOOK(Spawn)()
{
	if (!m_globalstate)
	{
		REMOVE_ENTITY(ENT(pev));
		return;
	}

	if (pev->spawnflags & SF_GLOBAL_SET)
	{
		if (!gGlobalState.EntityInTable(m_globalstate))
		{
			gGlobalState.EntityAdd(m_globalstate, gpGlobals->mapname, (GLOBALESTATE)m_initialstate);
		}
	}
}
开发者ID:Chuvi-w,项目名称:ReGameDLL_CS,代码行数:16,代码来源:buttons.cpp


示例20: UTIL_PrecacheOther

void UTIL_PrecacheOther( const char *szClassname )
{
	edict_t	*pent;

	pent = CREATE_NAMED_ENTITY( MAKE_STRING( szClassname ) );
	if ( FNullEnt( pent ) )
	{
		ALERT ( at_console, "NULL Ent in UTIL_PrecacheOther\n" );
		return;
	}
	
	CBaseEntity *pEntity = CBaseEntity::Instance (VARS( pent ));
	if (pEntity)
		pEntity->Precache( );
	REMOVE_ENTITY(pent);
}
开发者ID:CryoKeen,项目名称:HLEnhanced,代码行数:16,代码来源:util.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ RENDERER_LOG_ERROR函数代码示例发布时间:2022-05-30
下一篇:
C++ REMOVE_BIT函数代码示例发布时间: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