2
0
mirror of https://github.com/FWGS/hlsdk-xash3d synced 2024-11-25 19:29:13 +01:00

Partially fix -Wswitch.

This commit is contained in:
Night Owl 2016-06-13 19:29:45 +05:00
parent 2facf77f01
commit 3a691b21a4
15 changed files with 87 additions and 41 deletions

View File

@ -1081,7 +1081,7 @@ Schedule_t *CAGrunt :: GetSchedule ( void )
{
case MONSTERSTATE_COMBAT:
{
// dead enemy
// dead enemy
if ( HasConditions( bits_COND_ENEMY_DEAD ) )
{
// call base class, all code to handle dead enemies is centralized there.
@ -1093,7 +1093,7 @@ Schedule_t *CAGrunt :: GetSchedule ( void )
return GetScheduleOfType( SCHED_WAKE_ANGRY );
}
// zap player!
// zap player!
if ( HasConditions ( bits_COND_CAN_MELEE_ATTACK1 ) )
{
AttackSound();// this is a total hack. Should be parto f the schedule
@ -1105,7 +1105,7 @@ Schedule_t *CAGrunt :: GetSchedule ( void )
return GetScheduleOfType( SCHED_SMALL_FLINCH );
}
// can attack
// can attack
if ( HasConditions ( bits_COND_CAN_RANGE_ATTACK1 ) && OccupySlot ( bits_SLOTS_AGRUNT_HORNET ) )
{
return GetScheduleOfType ( SCHED_RANGE_ATTACK1 );
@ -1118,6 +1118,9 @@ Schedule_t *CAGrunt :: GetSchedule ( void )
return GetScheduleOfType ( SCHED_STANDOFF );
}
break;
default:
break;
}
return CSquadMonster :: GetSchedule();

View File

@ -702,7 +702,7 @@ Schedule_t *CBarney :: GetSchedule ( void )
{
case MONSTERSTATE_COMBAT:
{
// dead enemy
// dead enemy
if ( HasConditions( bits_COND_ENEMY_DEAD ) )
{
// call base class, all code to handle dead enemies is centralized there.
@ -756,6 +756,8 @@ Schedule_t *CBarney :: GetSchedule ( void )
// try to say something about smells
TrySmellTalk();
break;
default:
break;
}
return CTalkMonster::GetSchedule();

View File

@ -1060,7 +1060,7 @@ Schedule_t *CBullsquid :: GetSchedule( void )
}
case MONSTERSTATE_COMBAT:
{
// dead enemy
// dead enemy
if ( HasConditions( bits_COND_ENEMY_DEAD ) )
{
// call base class, all code to handle dead enemies is centralized there.
@ -1116,6 +1116,8 @@ Schedule_t *CBullsquid :: GetSchedule( void )
break;
}
default:
break;
}
return CBaseMonster :: GetSchedule();
@ -1266,6 +1268,8 @@ MONSTERSTATE CBullsquid :: GetIdealState ( void )
}
break;
}
default:
break;
}
m_IdealMonsterState = CBaseMonster :: GetIdealState();

View File

@ -731,12 +731,6 @@ Schedule_t *CController :: GetSchedule ( void )
{
switch ( m_MonsterState )
{
case MONSTERSTATE_IDLE:
break;
case MONSTERSTATE_ALERT:
break;
case MONSTERSTATE_COMBAT:
{
Vector vecTmp = Intersect( Vector( 0, 0, 0 ), Vector( 100, 4, 7 ), Vector( 2, 10, -3 ), 20.0 );
@ -752,6 +746,11 @@ Schedule_t *CController :: GetSchedule ( void )
}
}
break;
case MONSTERSTATE_IDLE:
case MONSTERSTATE_ALERT:
break;
default:
break;
}
return CSquadMonster :: GetSchedule();

View File

@ -338,6 +338,11 @@ void CBreakable::Precache( void )
PRECACHE_SOUND ("debris/bustceiling.wav");
break;
case matNone:
case matLastMaterial:
break;
default:
break;
}
MaterialSoundPrecache( m_Material );
if ( m_iszGibModel )
@ -510,11 +515,13 @@ void CBreakable::TraceAttack( entvars_t *pevAttacker, float flDamage, Vector vec
case 1: EMIT_SOUND(ENT(pev), CHAN_VOICE, "buttons/spark6.wav", flVolume, ATTN_NORM); break;
}
}
break;
break;
case matUnbreakableGlass:
UTIL_Ricochet( ptr->vecEndPos, RANDOM_FLOAT(0.5,1.5) );
break;
break;
default:
break;
}
}
@ -664,6 +671,12 @@ void CBreakable::Die( void )
case matCeilingTile:
EMIT_SOUND_DYN(ENT(pev), CHAN_VOICE, "debris/bustceiling.wav", fvol, ATTN_NORM, 0, pitch);
break;
case matNone:
case matLastMaterial:
case matUnbreakableGlass:
break;
default:
break;
}

View File

@ -858,7 +858,7 @@ Schedule_t *CHAssassin :: GetSchedule ( void )
case MONSTERSTATE_COMBAT:
{
// dead enemy
// dead enemy
if ( HasConditions( bits_COND_ENEMY_DEAD ) )
{
// call base class, all code to handle dead enemies is centralized there.
@ -907,21 +907,21 @@ Schedule_t *CHAssassin :: GetSchedule ( void )
m_iFrustration++;
}
// jump player!
// jump player!
if ( HasConditions ( bits_COND_CAN_MELEE_ATTACK1 ) )
{
// ALERT( at_console, "melee attack 1\n");
return GetScheduleOfType ( SCHED_MELEE_ATTACK1 );
}
// throw grenade
// throw grenade
if ( HasConditions ( bits_COND_CAN_RANGE_ATTACK2 ) )
{
// ALERT( at_console, "range attack 2\n");
return GetScheduleOfType ( SCHED_RANGE_ATTACK2 );
}
// spotted
// spotted
if ( HasConditions ( bits_COND_SEE_ENEMY ) && HasConditions ( bits_COND_ENEMY_FACING_ME ) )
{
// ALERT( at_console, "exposed\n");
@ -929,7 +929,7 @@ Schedule_t *CHAssassin :: GetSchedule ( void )
return GetScheduleOfType ( SCHED_ASSASSIN_EXPOSED );
}
// can attack
// can attack
if ( HasConditions ( bits_COND_CAN_RANGE_ATTACK1 ) )
{
// ALERT( at_console, "range attack 1\n");
@ -943,7 +943,7 @@ Schedule_t *CHAssassin :: GetSchedule ( void )
return GetScheduleOfType ( SCHED_COMBAT_FACE );
}
// new enemy
// new enemy
if ( HasConditions ( bits_COND_NEW_ENEMY ) )
{
// ALERT( at_console, "take cover\n");
@ -954,6 +954,8 @@ Schedule_t *CHAssassin :: GetSchedule ( void )
return GetScheduleOfType ( SCHED_ALERT_STAND );
}
break;
default:
break;
}
return CBaseMonster :: GetSchedule();
@ -1012,4 +1014,4 @@ Schedule_t* CHAssassin :: GetScheduleOfType ( int Type )
return CBaseMonster :: GetScheduleOfType( Type );
}
#endif
#endif

View File

@ -2035,14 +2035,14 @@ Schedule_t *CHGrunt :: GetSchedule( void )
{
case MONSTERSTATE_COMBAT:
{
// dead enemy
// dead enemy
if ( HasConditions( bits_COND_ENEMY_DEAD ) )
{
// call base class, all code to handle dead enemies is centralized there.
return CBaseMonster :: GetSchedule();
}
// new enemy
// new enemy
if ( HasConditions(bits_COND_NEW_ENEMY) )
{
if ( InSquad() )
@ -2089,7 +2089,7 @@ Schedule_t *CHGrunt :: GetSchedule( void )
}
}
}
// no ammo
// no ammo
else if ( HasConditions ( bits_COND_NO_AMMO_LOADED ) )
{
//!!!KELLY - this individual just realized he's out of bullet ammo.
@ -2098,7 +2098,7 @@ Schedule_t *CHGrunt :: GetSchedule( void )
return GetScheduleOfType ( SCHED_GRUNT_COVER_AND_RELOAD );
}
// damaged just a little
// damaged just a little
else if ( HasConditions( bits_COND_LIGHT_DAMAGE ) )
{
// if hurt:
@ -2124,19 +2124,19 @@ Schedule_t *CHGrunt :: GetSchedule( void )
return GetScheduleOfType( SCHED_SMALL_FLINCH );
}
}
// can kick
// can kick
else if ( HasConditions ( bits_COND_CAN_MELEE_ATTACK1 ) )
{
return GetScheduleOfType ( SCHED_MELEE_ATTACK1 );
}
// can grenade launch
// can grenade launch
else if ( FBitSet( pev->weapons, HGRUNT_GRENADELAUNCHER) && HasConditions ( bits_COND_CAN_RANGE_ATTACK2 ) && OccupySlot( bits_SLOTS_HGRUNT_GRENADE ) )
{
// shoot a grenade if you can
return GetScheduleOfType( SCHED_RANGE_ATTACK2 );
}
// can shoot
// can shoot
else if ( HasConditions ( bits_COND_CAN_RANGE_ATTACK1 ) )
{
if ( InSquad() )
@ -2167,7 +2167,7 @@ Schedule_t *CHGrunt :: GetSchedule( void )
return GetScheduleOfType( SCHED_TAKE_COVER_FROM_ENEMY );
}
}
// can't see enemy
// can't see enemy
else if ( HasConditions( bits_COND_ENEMY_OCCLUDED ) )
{
if ( HasConditions( bits_COND_CAN_RANGE_ATTACK2 ) && OccupySlot( bits_SLOTS_HGRUNT_GRENADE ) )
@ -2212,6 +2212,9 @@ Schedule_t *CHGrunt :: GetSchedule( void )
return GetScheduleOfType ( SCHED_GRUNT_ESTABLISH_LINE_OF_FIRE );
}
}
break;
default:
break;
}
// no special cases here, call the base class

View File

@ -219,14 +219,11 @@ void CHoundeye :: SetYawSpeed ( void )
ys = 60;
break;
case ACT_WALK:
ys = 90;
break;
case ACT_RUN:
ys = 90;
break;
case ACT_TURN_LEFT:
case ACT_TURN_RIGHT:
ys = 90;
break;
default:
break;
}
@ -1298,6 +1295,8 @@ Schedule_t *CHoundeye :: GetSchedule( void )
}
break;
}
default:
break;
}
return CSquadMonster :: GetSchedule();

View File

@ -534,11 +534,11 @@ Schedule_t* CIchthyosaur::GetSchedule()
case MONSTERSTATE_IDLE:
m_flightSpeed = 80;
return GetScheduleOfType( SCHED_IDLE_WALK );
break;
case MONSTERSTATE_ALERT:
m_flightSpeed = 150;
return GetScheduleOfType( SCHED_IDLE_WALK );
break;
case MONSTERSTATE_COMBAT:
m_flMaxSpeed = 400;
// eat them
@ -561,6 +561,9 @@ Schedule_t* CIchthyosaur::GetSchedule()
}
return GetScheduleOfType( SCHED_STANDOFF );
break;
default:
break;
}
return CFlyingMonster :: GetSchedule();

View File

@ -668,7 +668,7 @@ Schedule_t *CISlave :: GetSchedule( void )
switch (m_MonsterState)
{
case MONSTERSTATE_COMBAT:
// dead enemy
// dead enemy
if ( HasConditions( bits_COND_ENEMY_DEAD ) )
{
// call base class, all code to handle dead enemies is centralized there.
@ -692,6 +692,8 @@ Schedule_t *CISlave :: GetSchedule( void )
}
}
break;
default:
break;
}
return CSquadMonster::GetSchedule( );
}

View File

@ -50,6 +50,8 @@ void CBaseMonster :: SetState ( MONSTERSTATE State )
ALERT ( at_aiconsole, "Stripped\n" );
}
break;
default:
break;
}
m_MonsterState = State;
@ -227,6 +229,8 @@ MONSTERSTATE CBaseMonster :: GetIdealState ( void )
case MONSTERSTATE_DEAD:
m_IdealMonsterState = MONSTERSTATE_DEAD;
break;
default:
break;
}
return m_IdealMonsterState;

View File

@ -617,6 +617,8 @@ void CScientist :: SetYawSpeed ( void )
case ACT_TURN_RIGHT:
ys = 120;
break;
default:
break;
}
pev->yaw_speed = ys;
@ -996,6 +998,8 @@ Schedule_t *CScientist :: GetSchedule ( void )
return slScientistCover; // Run & Cower
break;
default:
break;
}
return CTalkMonster::GetSchedule();
@ -1058,6 +1062,8 @@ MONSTERSTATE CScientist :: GetIdealState ( void )
}
}
break;
default:
break;
}
return CTalkMonster::GetIdealState();

View File

@ -533,6 +533,8 @@ MONSTERSTATE CSquadMonster :: GetIdealState ( void )
SquadMakeEnemy ( m_hEnemy );
}
break;
default:
break;
}
return CBaseMonster :: GetIdealState();

View File

@ -813,6 +813,8 @@ void CBaseTurret::SetTurretAnim(TURRET_ANIM anim)
case TURRET_ANIM_DIE:
pev->framerate = 1.0;
break;
default:
break;
}
//ALERT(at_console, "Turret anim #%d\n", anim);
}

View File

@ -2098,19 +2098,21 @@ int CSave :: WriteFields( const char *pname, void *pBaseData, TYPEDESCRIPTION *p
{
case FIELD_EVARS:
entityArray[j] = EntityIndex( ((entvars_t **)pOutputData)[j] );
break;
break;
case FIELD_CLASSPTR:
entityArray[j] = EntityIndex( ((CBaseEntity **)pOutputData)[j] );
break;
break;
case FIELD_EDICT:
entityArray[j] = EntityIndex( ((edict_t **)pOutputData)[j] );
break;
break;
case FIELD_ENTITY:
entityArray[j] = EntityIndex( ((EOFFSET *)pOutputData)[j] );
break;
break;
case FIELD_EHANDLE:
entityArray[j] = EntityIndex( (CBaseEntity *)(((EHANDLE *)pOutputData)[j]) );
break;
break;
default:
break;
}
}
WriteInt( pTest->fieldName, entityArray, pTest->fieldSize );