From 639fa46a8d4c3a95d429e9839369c79e35432d27 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Wed, 7 Aug 2019 01:54:49 +0300 Subject: [PATCH] Fix op4mortar --- dlls/gearbox/op4mortar.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/dlls/gearbox/op4mortar.cpp b/dlls/gearbox/op4mortar.cpp index 1c03f5ab..e323d0f6 100644 --- a/dlls/gearbox/op4mortar.cpp +++ b/dlls/gearbox/op4mortar.cpp @@ -221,7 +221,7 @@ public: virtual int Save(CSave &save); virtual int Restore(CRestore &restore); CBaseEntity *FindTarget(); - void MortarThink(); + void EXPORT MortarThink(); static TYPEDESCRIPTION m_SaveData[]; int ObjectCaps() { return 0; } @@ -314,7 +314,7 @@ void COp4Mortar::Spawn() m_flExplodeTime = gpGlobals->time + 5; - pev->nextthink = gpGlobals->time + 0.01; + pev->nextthink = gpGlobals->time + 0.1; } 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); @@ -424,7 +424,7 @@ CBaseEntity *COp4Mortar::FindTarget() Vector BarretAngle; Vector targetPosition; TraceResult tr; - CBaseEntity *pIdealTarget; + CBaseEntity *pIdealTarget = NULL; if((pPlayer = UTIL_FindEntityByClassname(0, "player")) == NULL ) return NULL; @@ -448,10 +448,6 @@ CBaseEntity *COp4Mortar::FindTarget() } } } - else - { - pIdealTarget = NULL; - } return pIdealTarget; }