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


C++ RemoveFlag函数代码示例

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


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

示例1: SetContextThink

void CASW_Parasite::DoJumpFromEgg()
{
	SetContextThink( NULL, gpGlobals->curtime, s_pParasiteAnimThink );
	SetParent( NULL );
	SetAbsOrigin( GetAbsOrigin() + Vector( 0, 0, 30 ) );	// TODO: position parasite at where his 'idle in egg' animation has him.  This has to be some distance off the ground, else the jump will immediately end.
	Vector dir = vec3_origin;
	AngleVectors( GetAbsAngles(), &dir );
	//Vector vecJumpPos = GetAbsOrigin()+ Vector(19,0,60)+ dir * m_flEggJumpDistance;
	Vector vecJumpPos = GetAbsOrigin() + dir * m_flEggJumpDistance;

	SetActivity( ACT_RANGE_ATTACK1 );
	StudioFrameAdvanceManual( 0.0 );
	SetParent( NULL );
	RemoveFlag( FL_FLY );
	AddEffects( EF_NOINTERP );
	m_bDoEggIdle = false;

	GetMotor()->SetIdealYaw( GetAbsAngles().y );

	JumpAttack( false, vecJumpPos, false );
}
开发者ID:detoxhby,项目名称:SwarmDirector2,代码行数:21,代码来源:asw_parasite.cpp

示例2: GetSlot

void Item::UpdateDuration(Player* owner, uint32 diff)
{
    if (!GetUInt32Value(ITEM_FIELD_DURATION))
        return;

    //DEBUG_LOG("Item::UpdateDuration Item (Entry: %u Duration %u Diff %u)",GetEntry(),GetUInt32Value(ITEM_FIELD_DURATION),diff);

    if (GetUInt32Value(ITEM_FIELD_DURATION)<=diff)
    {
        owner->DestroyItem(GetBagSlot(), GetSlot(), true);
        return;
    }

    SetUInt32Value(ITEM_FIELD_DURATION, GetUInt32Value(ITEM_FIELD_DURATION) - diff);
    SetState(ITEM_CHANGED, owner);                          // save new time in database

    //Remove refundable flag for next time if item is no logner refundable
    if(HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAGS_REFUNDABLE))
        if(!GetUInt32Value(ITEM_FIELD_CREATE_PLAYED_TIME) || (GetOwner() && GetOwner()->m_Played_time[0] > (GetUInt32Value(ITEM_FIELD_CREATE_PLAYED_TIME) + 2*60*60)))
            RemoveFlag(ITEM_FIELD_FLAGS, ITEM_FLAGS_REFUNDABLE);
}
开发者ID:Nny,项目名称:Core,代码行数:21,代码来源:Item.cpp

示例3: RemoveFlag

/*
============
idBrushBSPNode::RemoveFlagRecurseFlood
============
*/
void idBrushBSPNode::RemoveFlagRecurseFlood( int flag )
{
	RemoveFlag( flag );
	
	if( !children[0] && !children[1] )
	{
		RemoveFlagFlood( flag );
	}
	else
	{
		if( children[0] )
		{
			children[0]->RemoveFlagRecurseFlood( flag );
		}
		
		if( children[1] )
		{
			children[1]->RemoveFlagRecurseFlood( flag );
		}
	}
}
开发者ID:revelator,项目名称:MHDoom,代码行数:26,代码来源:BrushBSP.cpp

示例4: ClearSchedule

bool CHL1NPCTalker::HandleInteraction(int interactionType, void *data, CBaseCombatCharacter* sourceEnt)
{
	if (interactionType == g_interactionBarnacleVictimDangle)
	{
		// Force choosing of a new schedule
		ClearSchedule();
		m_bInBarnacleMouth	= true;
		return true;
	}
	else if ( interactionType == g_interactionBarnacleVictimReleased )
	{
		SetState ( NPC_STATE_IDLE );

		CPASAttenuationFilter filter( this );
		EmitSound( filter, entindex(), CHAN_VOICE, "barney/ba_close.wav", 1, SNDLVL_TALKING, 0, GetExpresser()->GetVoicePitch());

		m_bInBarnacleMouth	= false;
		SetAbsVelocity( vec3_origin );
		SetMoveType( MOVETYPE_STEP );
		return true;
	}
	else if ( interactionType == g_interactionBarnacleVictimGrab )
	{
		if ( GetFlags() & FL_ONGROUND )
		{
			RemoveFlag( FL_ONGROUND );
		}
		
		if ( GetState() == NPC_STATE_SCRIPT )
		{
			 m_hCine->CancelScript();
			 ClearSchedule();
		}

		SetState( NPC_STATE_PRONE );
		PainSound();
		return true;
	}
	return false;
}
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:40,代码来源:hl1_npc_talker.cpp

示例5: RemoveFlag

void CWndWindow::InitialUpdate()
{
	m_data = DataMng->GetWindow(m_ID);
	if (!m_data)
		return;

	m_flags |= m_data->flags;
	if (HasFlag(WBS_NOFRAME))
		RemoveFlag(WBS_CAPTION);

	SetRect(QRect(QPoint(10, 10), m_data->size), false);
	m_text = m_data->title;
	SetTexture(m_data->texture, m_data->tiles);

	m_closeButton = new CWndButton(m_render2D);
	m_closeButton->Create(WTBID_CLOSE, QRect(), WBS_DOCKING, this);
	m_closeButton->SetTexture("ButtWndExit.tga", false);
	m_closeButton->FitTextureSize();

	for (int i = 0; i < m_data->controls.GetSize(); i++)
		CreateControl(m_data->controls[i]);
}
开发者ID:Aishiro,项目名称:ATools,代码行数:22,代码来源:WndWindow.cpp

示例6: RemoveFlag

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
int CNPC_CeilingTurret::OnTakeDamage( const CTakeDamageInfo &inputInfo )
{
	if ( !m_takedamage )
		return 0;

	CTakeDamageInfo info = inputInfo;

	if ( m_bActive == false )
		info.ScaleDamage( 0.1f );

	// If attacker can't do at least the min required damage to us, don't take any damage from them
	if ( info.GetDamage() < m_iMinHealthDmg )
		return 0;

	m_iHealth -= info.GetDamage();

	if ( m_iHealth <= 0 )
	{
		m_iHealth = 0;
		m_takedamage = DAMAGE_NO;

		RemoveFlag( FL_NPC ); // why are they set in the first place???

		//FIXME: This needs to throw a ragdoll gib or something other than animating the retraction -- jdw

		ExplosionCreate( GetAbsOrigin(), GetLocalAngles(), this, 100, 100, false );
		SetThink( &CNPC_CeilingTurret::DeathThink );

		StopSound( "NPC_CeilingTurret.Alert" );

		m_OnDamaged.FireOutput( info.GetInflictor(), this );

		SetNextThink( gpGlobals->curtime + 0.1f );

		return 0;
	}

	return 1;
}
开发者ID:AluminumKen,项目名称:hl2sb-src,代码行数:42,代码来源:npc_turret_ceiling.cpp

示例7: RemoveFlag

int CBaseTurret::OnTakeDamage( const CTakeDamageInfo &inputInfo )
{
	if ( !m_takedamage )
		return 0;

	CTakeDamageInfo info = inputInfo;

	if (!m_iOn)
		info.ScaleDamage( 0.1f );

	m_iHealth -= info.GetDamage();
	if (m_iHealth <= 0)
	{
		m_iHealth = 0;
		m_takedamage = DAMAGE_NO;
		m_flDamageTime = gpGlobals->curtime;

		RemoveFlag( FL_NPC ); // why are they set in the first place???

		SetThink(TurretDeath);

		m_OnDamaged.FireOutput( info.GetInflictor(), this );

		SetNextThink( gpGlobals->curtime + 0.1f );

		return 0;
	}

	if (m_iHealth <= 10)
	{
		if (m_iOn && (1 || random->RandomInt(0, 0x7FFF) > 800))
		{
			m_fBeserk = 1;
			SetThink(SearchThink);
		}
	}

	return 1;
}
开发者ID:Filip98,项目名称:source-sdk-2013,代码行数:39,代码来源:npc_turret.cpp

示例8: GetGUID

void Creature::OnRespawn(MapMgr * m)
{
	sLog.outDetail("Respawning "I64FMT"...", GetGUID());
	SetUInt32Value(UNIT_FIELD_HEALTH, GetUInt32Value(UNIT_FIELD_MAXHEALTH));
	SetUInt32Value(UNIT_DYNAMIC_FLAGS, 0); // not tagging shiat
	if(proto && m_spawn)
	{
		SetUInt32Value(UNIT_NPC_FLAGS, proto->NPCFLags);
		SetUInt32Value(UNIT_NPC_EMOTESTATE, m_spawn->emote_state);
	}

	RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE);
	Skinned = false;
	Tagged = false;
	TaggerGuid = 0;
	m_lootMethod = -1;

	/* creature death state */
	if(proto && proto->death_state == 1)
	{
		uint32 newhealth = m_uint32Values[UNIT_FIELD_HEALTH] / 100;
		if(!newhealth)
			newhealth = 1;
		SetUInt32Value(UNIT_FIELD_HEALTH, 1);
		m_limbostate = true;
		bInvincible = true;
		SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_DEAD);
	}

	//empty loot
	loot.items.clear();

	setDeathState(ALIVE);
	GetAIInterface()->StopMovement(0); // after respawn monster can move
	m_PickPocketed = false;
	PushToWorld(m);
}
开发者ID:AwkwardDev,项目名称:ascent_classic,代码行数:37,代码来源:Creature.cpp

示例9: InputEnable

	// input functions
	void InputEnable( inputdata_t &inputdata )
	{
		RemoveFlag( FL_DONTTOUCH );
	}
开发者ID:Bubbasacs,项目名称:FinalProj,代码行数:5,代码来源:modelentities.cpp

示例10: SetFaceCullMode

 /// \brief
 ///   Translates the VCullMode value to the face culling bitflags and sets them in the simple render state object.
 inline void SetFaceCullMode(VCullMode iMode)
 {
   SetFlag(RENDERSTATEFLAG_DOUBLESIDED);
   if (iMode == CULL_FRONT) RemoveFlag(RENDERSTATEFLAG_FRONTFACE);
   if (iMode == CULL_BACK) RemoveFlag(RENDERSTATEFLAG_BACKFACE);
 }
开发者ID:Alagong,项目名称:projectanarchy,代码行数:8,代码来源:vSimpleRenderState.hpp

示例11: AddFlag

void CPWL_Edit::EnableSpellCheck(FX_BOOL bEnabled) {
  if (bEnabled)
    AddFlag(PES_SPELLCHECK);
  else
    RemoveFlag(PES_SPELLCHECK);
}
开发者ID:primiano,项目名称:pdfium-merge,代码行数:6,代码来源:PWL_Edit.cpp

示例12: CheckExplosionEffects

//-----------------------------------------------------------------------------
// Purpose: Allow pre-frame adjustments on the player
//-----------------------------------------------------------------------------
void CHL1_Player::PreThink(void)
{
	CheckExplosionEffects();
	if ( player_showpredictedposition.GetBool() )
	{
		Vector	predPos;

		UTIL_PredictedPosition( this, player_showpredictedposition_timestep.GetFloat(), &predPos );

		NDebugOverlay::Box( predPos, NAI_Hull::Mins( GetHullType() ), NAI_Hull::Maxs( GetHullType() ), 0, 255, 0, 0, 0.01f );
		NDebugOverlay::Line( GetAbsOrigin(), predPos, 0, 255, 0, 0, 0.01f );
	}

	int buttonsChanged;
	buttonsChanged = m_afButtonPressed | m_afButtonReleased;

	g_pGameRules->PlayerThink( this );

	if ( g_fGameOver || IsPlayerLockedInPlace() )
		return;         // intermission or finale

	ItemPreFrame( );
	WaterMove();

	if ( g_pGameRules && g_pGameRules->FAllowFlashlight() )
		m_Local.m_iHideHUD &= ~HIDEHUD_FLASHLIGHT;
	else
		m_Local.m_iHideHUD |= HIDEHUD_FLASHLIGHT;


	// checks if new client data (for HUD and view control) needs to be sent to the client
	UpdateClientData();
	
	CheckTimeBasedDamage();

	CheckSuitUpdate();

	if (m_lifeState >= LIFE_DYING)
	{
		PlayerDeathThink();
		return;
	}

	// So the correct flags get sent to client asap.
	//
	if ( m_afPhysicsFlags & PFLAG_DIROVERRIDE )
		AddFlag( FL_ONTRAIN );
	else 
		RemoveFlag( FL_ONTRAIN );

	// Train speed control
	if ( m_afPhysicsFlags & PFLAG_DIROVERRIDE )
	{
		CBaseEntity *pTrain = GetGroundEntity();
		float vel;

		if ( pTrain )
		{
			if ( !(pTrain->ObjectCaps() & FCAP_DIRECTIONAL_USE) )
				pTrain = NULL;
		}

		if ( !pTrain )
		{
			if ( GetActiveWeapon() && (GetActiveWeapon()->ObjectCaps() & FCAP_DIRECTIONAL_USE) )
			{
				m_iTrain = TRAIN_ACTIVE | TRAIN_NEW;

				if ( m_nButtons & IN_FORWARD )
				{
					m_iTrain |= TRAIN_FAST;
				}
				else if ( m_nButtons & IN_BACK )
				{
					m_iTrain |= TRAIN_BACK;
				}
				else
				{
					m_iTrain |= TRAIN_NEUTRAL;
				}
				return;
			}
			else
			{
				trace_t trainTrace;
				// Maybe this is on the other side of a level transition
				UTIL_TraceLine( GetAbsOrigin(), GetAbsOrigin() + Vector(0,0,-38), 
					MASK_PLAYERSOLID_BRUSHONLY, this, COLLISION_GROUP_NONE, &trainTrace );

				if ( trainTrace.fraction != 1.0 && trainTrace.m_pEnt )
					pTrain = trainTrace.m_pEnt;


				if ( !pTrain || !(pTrain->ObjectCaps() & FCAP_DIRECTIONAL_USE) || !pTrain->OnControls(GetContainingEntity(pev)) )
				{
//					Warning( "In train mode with no train!\n" );
					m_afPhysicsFlags &= ~PFLAG_DIROVERRIDE;
//.........这里部分代码省略.........
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:101,代码来源:hl1_player.cpp

示例13: switch

void BlobGame::handleMessage(const Message& msg){
	switch(msg.type){
	case 2:{
		Unit* unit = (Unit*)msg.extraInfo;
		for(int i = 0;i < m_GameObjects->size();i++){
			if((*m_GameObjects)[i] == unit){
				m_GameObjects->erase(m_GameObjects->begin()+i);
				SafePtrRelease(unit);
				return;
			}
		}
		break;
	}
	case PISTOL_ATTACK:{
			Unit* unit;
			Tile* tile = (Tile*)msg.extraInfo;
			if((unit = unitOnTile(tile))){
				unit->hit(PISTOL_DAMAGE);
				MessageHandler::Instance()->deleteMessage(msg.name);
			}
		break;
	}
	case REMOVE_TILE_EFFECT:{
		Tile* tile = (Tile*)msg.extraInfo;
		unsigned int tileStatuses = tile->getTileTypes();
		if(msg.name == "Fire"){
			if(ContainsFlags(tile->getTileTypes(),Fire)){
				RemoveFlag(&tileStatuses,Fire);
				tile->setTileTypes(tileStatuses);
			}
		}
		else if(msg.name == "Posion"){
			if(ContainsFlags(tile->getTileTypes(),Posion)){
				RemoveFlag(&tileStatuses,Posion);
				tile->setTileTypes(tileStatuses);
			}
		}
		else if(msg.name == "Slime"){
			if(ContainsFlags(tile->getTileTypes(),Slime)){
				RemoveFlag(&tileStatuses,Slime);
				tile->setTileTypes(tileStatuses);
			}
		}
		for(int i = 0;i < m_Effects->size();i++){
			if((*m_Effects)[i]->getName() == 
				(msg.name + "_" + tile->getName())){
					Sprite2d* sprite = (*m_Effects)[i];
					m_Effects->erase(m_Effects->begin()+i);
					SpriteManager::instance()->deleteSprite(sprite);
			}
		}
	}
	case 5:{
		for(int i = 0;i < m_GameObjects->size();i++){
			if((*m_GameObjects)[i]->getName() == msg.name){
				Enemy* enemy = (Enemy*)(*m_GameObjects)[i];
				enemy->hold();
				return;
			}
		}
		break;
	}
	case 6:{
		for(int i = 0;i < m_GameObjects->size();i++){
			if((*m_GameObjects)[i]->getName() == msg.name){
				Unit* unit = (Unit*)(*m_GameObjects)[i];
				unit->hit(unit->getHealth());
				return;
			}
		}
		break;
	}
	case REMOVE_UNIT_STATUS:{
		Unit* unit = (Unit*)msg.extraInfo;
		unsigned int unitStatuses = unit->getStatus();
		if(msg.name == "Fire"){
			if(ContainsFlags(unit->getStatus(),OnFire)){
				RemoveFlag(&unitStatuses,OnFire);
				unit->setStatus(unitStatuses);
			}
		}
		else if(msg.name == "Posioned"){
			if(ContainsFlags(unit->getStatus(),Posioned)){
				RemoveFlag(&unitStatuses,Posioned);
				unit->setStatus(unitStatuses);
			}
		}
		else if(msg.name == "Slowed"){
			if(ContainsFlags(unit->getStatus(),Slowed)){
				RemoveFlag(&unitStatuses,Slowed);
				unit->setStatus(unitStatuses);
			}
		}
		break;
	}
	case CHANGE_STATE:{
		int s  = (int)msg.extraInfo;
		changeState((BlobGameStates)s);
		break;
	}
//.........这里部分代码省略.........
开发者ID:StevenBryar,项目名称:BlobGame,代码行数:101,代码来源:BlobGame.cpp

示例14: RemoveFlag

void Transport::BuildStopMovePacket(Map const* targetMap)
{
    RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE);
    SetGoState(GO_STATE_READY);
    UpdateForMap(targetMap);
}
开发者ID:Splash,项目名称:mangos,代码行数:6,代码来源:Transports.cpp

示例15: ClearEntityNearViewRange

 void ClearEntityNearViewRange() {
     RemoveFlag(entity_near);
 }
开发者ID:zznq,项目名称:void-ray,代码行数:3,代码来源:BaseEntity.hpp


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