From 306abfd59432972d96fa3e52b2b04097a8f6889d Mon Sep 17 00:00:00 2001 From: Charles Date: Mon, 30 Apr 2001 20:32:28 +0000 Subject: [PATCH] --- source/enemy/npc.cpp | 16 ++++++---------- source/enemy/npc.h | 1 - 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/source/enemy/npc.cpp b/source/enemy/npc.cpp index c5bfb188f..13d0596f7 100644 --- a/source/enemy/npc.cpp +++ b/source/enemy/npc.cpp @@ -592,7 +592,6 @@ void CNpcEnemy::init() m_heading = m_fireHeading = 0; m_movementTimer = 0; m_timerTimer = 0; - m_collisionTimer = 0; m_velocity = 0; m_extension = 0; m_rotation = 0; @@ -643,7 +642,6 @@ void CNpcEnemy::reinit() m_heading = m_fireHeading = 0; m_movementTimer = 0; m_timerTimer = 0; - m_collisionTimer = 0; m_velocity = 0; m_extension = 0; m_rotation = 0; @@ -1239,11 +1237,6 @@ void CNpcEnemy::processCollision() void CNpcEnemy::processTimer(int _frames) { - if ( m_collisionTimer > 0 ) - { - m_collisionTimer -= _frames; - } - if ( m_timerTimer > 0 ) { m_timerTimer -= _frames; @@ -1432,10 +1425,13 @@ void CNpcEnemy::processEnemyCollision( CThing *thisThing ) m_heading = headingFromTarget; - if ( m_collisionTimer <= 0 ) - { - m_collisionTimer = GameState::getOneSecondInFrames(); + s32 waypointXDist; + s32 waypointYDist; + m_npcPath.getDistToNextWaypoint( Pos, &waypointXDist, &waypointYDist ); + + if ( ( xDist > 0 && waypointXDist < 0 ) || ( xDist < 0 && waypointXDist > 0 ) ) + { // try next waypoint to get around other enemy m_npcPath.incPath(); diff --git a/source/enemy/npc.h b/source/enemy/npc.h index d443290eb..c3dde2c56 100644 --- a/source/enemy/npc.h +++ b/source/enemy/npc.h @@ -280,7 +280,6 @@ protected: s32 m_velocity; bool m_evadeClockwise; s32 m_movementTimer; - s32 m_collisionTimer; s32 m_timerTimer; s32 m_extension; bool m_extendDir;