Browse Source

Fix op4mortar

opforfixed
Roman Chistokhodov 5 years ago
parent
commit
639fa46a8d
  1. 12
      dlls/gearbox/op4mortar.cpp

12
dlls/gearbox/op4mortar.cpp

@ -221,7 +221,7 @@ public:
virtual int Save(CSave &save); virtual int Save(CSave &save);
virtual int Restore(CRestore &restore); virtual int Restore(CRestore &restore);
CBaseEntity *FindTarget(); CBaseEntity *FindTarget();
void MortarThink(); void EXPORT MortarThink();
static TYPEDESCRIPTION m_SaveData[]; static TYPEDESCRIPTION m_SaveData[];
int ObjectCaps() { return 0; } int ObjectCaps() { return 0; }
@ -314,7 +314,7 @@ void COp4Mortar::Spawn()
m_flExplodeTime = gpGlobals->time + 5; m_flExplodeTime = gpGlobals->time + 5;
pev->nextthink = gpGlobals->time + 0.01; pev->nextthink = gpGlobals->time + 0.1;
} }
void COp4Mortar::UpdatePosition(float direction, int controller) void COp4Mortar::UpdatePosition(float direction, int controller)
@ -376,7 +376,7 @@ void COp4Mortar::MortarThink()
} }
} }
if(m_hEnemy) if(m_hEnemy != 0)
{ {
vecTarget = Vector( m_hEnemy->pev->origin.x, m_hEnemy->pev->origin.y, m_hEnemy->pev->absmax.z); vecTarget = Vector( m_hEnemy->pev->origin.x, m_hEnemy->pev->origin.y, m_hEnemy->pev->absmax.z);
@ -424,7 +424,7 @@ CBaseEntity *COp4Mortar::FindTarget()
Vector BarretAngle; Vector BarretAngle;
Vector targetPosition; Vector targetPosition;
TraceResult tr; TraceResult tr;
CBaseEntity *pIdealTarget; CBaseEntity *pIdealTarget = NULL;
if((pPlayer = UTIL_FindEntityByClassname(0, "player")) == NULL ) if((pPlayer = UTIL_FindEntityByClassname(0, "player")) == NULL )
return NULL; return NULL;
@ -448,10 +448,6 @@ CBaseEntity *COp4Mortar::FindTarget()
} }
} }
} }
else
{
pIdealTarget = NULL;
}
return pIdealTarget; return pIdealTarget;
} }

Loading…
Cancel
Save