本文整理汇总了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 );
}
示例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);
}
示例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 );
}
}
}
示例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;
}
示例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]);
}
示例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;
}
示例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;
}
示例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);
}
示例9: InputEnable
// input functions
void InputEnable( inputdata_t &inputdata )
{
RemoveFlag( FL_DONTTOUCH );
}
示例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);
}
示例11: AddFlag
void CPWL_Edit::EnableSpellCheck(FX_BOOL bEnabled) {
if (bEnabled)
AddFlag(PES_SPELLCHECK);
else
RemoveFlag(PES_SPELLCHECK);
}
示例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;
//.........这里部分代码省略.........
示例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;
}
//.........这里部分代码省略.........
示例14: RemoveFlag
void Transport::BuildStopMovePacket(Map const* targetMap)
{
RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE);
SetGoState(GO_STATE_READY);
UpdateForMap(targetMap);
}
示例15: ClearEntityNearViewRange
void ClearEntityNearViewRange() {
RemoveFlag(entity_near);
}