Fix some warnings.

This commit is contained in:
Night Owl 2017-12-24 21:26:21 +05:00
parent 0ea3cc77bf
commit 664eea792c
7 changed files with 12 additions and 11 deletions

View File

@ -320,7 +320,7 @@ void CBarney::BarneyFirePistol( void )
Vector vecSpread; Vector vecSpread;
if( m_hEnemy == NULL || !m_hEnemy->IsPlayer() ) if( m_hEnemy == 0 || !m_hEnemy->IsPlayer() )
{ {
// Higher chance to hit target. // Higher chance to hit target.
vecSpread = VECTOR_CONE_2DEGREES; vecSpread = VECTOR_CONE_2DEGREES;
@ -384,12 +384,11 @@ void CBarney::Spawn()
{ {
Precache(); Precache();
char* szModel = (char*)STRING( pev->model ); if( !pev->model )
if( !szModel || !*szModel )
{ {
szModel = "models/barney.mdl"; pev->model = MAKE_STRING( "models/barney.mdl" );
} }
SET_MODEL( ENT( pev ), szModel ); SET_MODEL( ENT( pev ), STRING( pev->model ) );
UTIL_SetSize( pev, VEC_HUMAN_HULL_MIN, VEC_HUMAN_HULL_MAX ); UTIL_SetSize( pev, VEC_HUMAN_HULL_MIN, VEC_HUMAN_HULL_MAX );
pev->solid = SOLID_SLIDEBOX; pev->solid = SOLID_SLIDEBOX;

View File

@ -50,7 +50,7 @@ void CGlock::Spawn()
pev->classname = MAKE_STRING( "weapon_9mmhandgun" ); // hack to allow for old names pev->classname = MAKE_STRING( "weapon_9mmhandgun" ); // hack to allow for old names
Precache(); Precache();
m_iId = WEAPON_GLOCK; m_iId = WEAPON_GLOCK;
char* szModel = NULL; const char* szModel = NULL;
if( pev->body == SILENCER_ON ) if( pev->body == SILENCER_ON )
szModel = GLOCK_MODEL_SILENCER; szModel = GLOCK_MODEL_SILENCER;

View File

@ -76,7 +76,7 @@ const char *CBabyKelly::pDeathSounds[] =
//========================================================= //=========================================================
void CBabyKelly::AlertSound(void) void CBabyKelly::AlertSound(void)
{ {
if (m_hEnemy != NULL) if (m_hEnemy != 0)
{ {
SENTENCEG_PlayRndSz(ENT(pev), "BKL_ALERT", 0.85, ATTN_NORM, 0, m_voicePitch); SENTENCEG_PlayRndSz(ENT(pev), "BKL_ALERT", 0.85, ATTN_NORM, 0, m_voicePitch);

View File

@ -167,7 +167,7 @@ BOOL CCyberFranklin::CheckMeleeAttack1(float flDot, float flDist)
{ {
CBaseMonster *pEnemy; CBaseMonster *pEnemy;
if (m_hEnemy != NULL) if (m_hEnemy != 0)
{ {
pEnemy = m_hEnemy->MyMonsterPointer(); pEnemy = m_hEnemy->MyMonsterPointer();

View File

@ -362,6 +362,8 @@ Schedule_t *CZombieBull::GetSchedule(void)
break; break;
} }
default:
break;
} }
return CBaseMonster::GetSchedule(); return CBaseMonster::GetSchedule();

View File

@ -1063,7 +1063,7 @@ void CFuncTrackTrain::StopSound( void )
/* /*
STOP_SOUND( ENT( pev ), CHAN_STATIC, STRING( pev->noise ) ); STOP_SOUND( ENT( pev ), CHAN_STATIC, STRING( pev->noise ) );
*/ */
char *brake = "plats/ttrain_brake1.wav"; const char *brake = "plats/ttrain_brake1.wav";
if( UseCustomSounds() ) if( UseCustomSounds() )
{ {

View File

@ -1500,7 +1500,7 @@ void CBasePlayer::PlayerUse( void )
m_afPhysicsFlags |= PFLAG_ONTRAIN; m_afPhysicsFlags |= PFLAG_ONTRAIN;
m_iTrain = TrainSpeed( (int)pTrain->pev->speed, pTrain->pev->impulse ); m_iTrain = TrainSpeed( (int)pTrain->pev->speed, pTrain->pev->impulse );
m_iTrain |= TRAIN_NEW; m_iTrain |= TRAIN_NEW;
char* usesound = "plats/train_use1.wav"; const char* usesound = "plats/train_use1.wav";
CFuncTrackTrain* pTrackTrain = (CFuncTrackTrain*)pTrain; CFuncTrackTrain* pTrackTrain = (CFuncTrackTrain*)pTrain;