Browse Source

Fix some warnings.

residual_point
Night Owl 7 years ago
parent
commit
1368c0fae5
  1. 4
      dlls/rp/blkop_osprey.cpp
  2. 2
      dlls/rp/massn.cpp
  3. 8
      dlls/rp/otis.cpp
  4. 10
      dlls/rp/pitdrone.cpp
  5. 4
      dlls/zombie.cpp

4
dlls/rp/blkop_osprey.cpp

@ -139,9 +139,9 @@ CBaseMonster *CBlkopOsprey::MakeGrunt(Vector vecSrc)
for (int i = 0; i < m_iUnits; i++) for (int i = 0; i < m_iUnits; i++)
{ {
if (m_hGrunt[i] == NULL || !m_hGrunt[i]->IsAlive()) if (m_hGrunt[i] == 0 || !m_hGrunt[i]->IsAlive())
{ {
if (m_hGrunt[i] != NULL && m_hGrunt[i]->pev->rendermode == kRenderNormal) if (m_hGrunt[i] != 0 && m_hGrunt[i]->pev->rendermode == kRenderNormal)
{ {
m_hGrunt[i]->SUB_StartFadeOut(); m_hGrunt[i]->SUB_StartFadeOut();
} }

2
dlls/rp/massn.cpp

@ -131,7 +131,7 @@ int CMassn::IRelationship( CBaseEntity *pTarget )
//========================================================= //=========================================================
void CMassn::Sniperrifle(void) void CMassn::Sniperrifle(void)
{ {
if (m_hEnemy == NULL) if (m_hEnemy == 0)
{ {
return; return;
} }

8
dlls/rp/otis.cpp

@ -91,7 +91,7 @@ LINK_ENTITY_TO_CLASS(monster_otis, COtis);
//========================================================= //=========================================================
void COtis::AlertSound(void) void COtis::AlertSound(void)
{ {
if (m_hEnemy != NULL) if (m_hEnemy != 0 )
{ {
if (FOkToSpeak()) if (FOkToSpeak())
{ {
@ -302,7 +302,7 @@ int COtis::TakeDamage(entvars_t* pevInflictor, entvars_t* pevAttacker, float flD
// This is a heurstic to determine if the player intended to harm me // This is a heurstic to determine if the player intended to harm me
// If I have an enemy, we can't establish intent (may just be crossfire) // If I have an enemy, we can't establish intent (may just be crossfire)
if (m_hEnemy == NULL) if (m_hEnemy == 0 )
{ {
// If the player was facing directly at me, or I'm already suspicious, get mad // If the player was facing directly at me, or I'm already suspicious, get mad
if ((m_afMemory & bits_MEMORY_SUSPICIOUS) || IsFacing(pevAttacker, pev->origin)) if ((m_afMemory & bits_MEMORY_SUSPICIOUS) || IsFacing(pevAttacker, pev->origin))
@ -477,10 +477,10 @@ public:
void KeyValue(KeyValueData *pkvd); void KeyValue(KeyValueData *pkvd);
int m_iPose;// which sequence to display -- temporary, don't need to save int m_iPose;// which sequence to display -- temporary, don't need to save
static char *m_szPoses[5]; static const char *m_szPoses[5];
}; };
char *CDeadOtis::m_szPoses[] = { "lying_on_back", "lying_on_side", "lying_on_stomach", "stuffed_in_vent", "dead_sitting" }; const char *CDeadOtis::m_szPoses[] = { "lying_on_back", "lying_on_side", "lying_on_stomach", "stuffed_in_vent", "dead_sitting" };
void CDeadOtis::KeyValue(KeyValueData *pkvd) void CDeadOtis::KeyValue(KeyValueData *pkvd)
{ {

10
dlls/rp/pitdrone.cpp

@ -149,7 +149,7 @@ int CPitdrone::TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float
// if the squid is running, has an enemy, was hurt by the enemy, hasn't been hurt in the last 3 seconds, and isn't too close to the enemy, // if the squid is running, has an enemy, was hurt by the enemy, hasn't been hurt in the last 3 seconds, and isn't too close to the enemy,
// it will swerve. (whew). // it will swerve. (whew).
if (m_hEnemy != NULL && IsMoving() && pevAttacker == m_hEnemy->pev) if (m_hEnemy != 0 && IsMoving() && pevAttacker == m_hEnemy->pev)
{ {
flDist = (pev->origin - m_hEnemy->pev->origin).Length2D(); flDist = (pev->origin - m_hEnemy->pev->origin).Length2D();
@ -181,7 +181,7 @@ BOOL CPitdrone::CheckRangeAttack1(float flDot, float flDist)
if (flDist > 64 && flDist <= 784 && flDot >= 0.5 && gpGlobals->time >= m_flNextSpitTime) if (flDist > 64 && flDist <= 784 && flDot >= 0.5 && gpGlobals->time >= m_flNextSpitTime)
{ {
if (m_hEnemy != NULL) if (m_hEnemy != 0)
{ {
if (fabs(pev->origin.z - m_hEnemy->pev->origin.z) > 256) if (fabs(pev->origin.z - m_hEnemy->pev->origin.z) > 256)
{ {
@ -893,7 +893,7 @@ int CPitDrone::TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float
// if the pitdrone is running, has an enemy, was hurt by the enemy, and isn't too close to the enemy, // if the pitdrone is running, has an enemy, was hurt by the enemy, and isn't too close to the enemy,
// it will swerve. (whew). // it will swerve. (whew).
if (m_hEnemy != NULL && IsMoving() && pevAttacker == m_hEnemy->pev ) if (m_hEnemy != 0 && IsMoving() && pevAttacker == m_hEnemy->pev )
{ {
flDist = (pev->origin - m_hEnemy->pev->origin).Length2D(); flDist = (pev->origin - m_hEnemy->pev->origin).Length2D();
@ -1297,7 +1297,7 @@ void CPitDrone::RunAI(void)
// first, do base class stuff // first, do base class stuff
CBaseMonster::RunAI(); CBaseMonster::RunAI();
if (m_hEnemy != NULL && m_Activity == ACT_RUN) if (m_hEnemy != 0 && m_Activity == ACT_RUN)
{ {
// chasing enemy. Sprint for last bit // chasing enemy. Sprint for last bit
if ((pev->origin - m_hEnemy->pev->origin).Length2D() < PITDRONE_SPRINT_DIST) if ((pev->origin - m_hEnemy->pev->origin).Length2D() < PITDRONE_SPRINT_DIST)
@ -1601,6 +1601,8 @@ Schedule_t *CPitDrone::GetSchedule(void)
break; break;
} }
default:
break;
} }
return CBaseMonster::GetSchedule(); return CBaseMonster::GetSchedule();

4
dlls/zombie.cpp

@ -335,10 +335,10 @@ public:
void KeyValue( KeyValueData *pkvd ); void KeyValue( KeyValueData *pkvd );
int m_iPose;// which sequence to display -- temporary, don't need to save int m_iPose;// which sequence to display -- temporary, don't need to save
static char *m_szPoses[2]; static const char *m_szPoses[2];
}; };
char *CDeadZSoldier::m_szPoses[] = const char *CDeadZSoldier::m_szPoses[] =
{ {
"dead_on_back", "dead_on_back",
"dead_on_stomach" "dead_on_stomach"

Loading…
Cancel
Save