diff --git a/source/enemy/npc.cpp b/source/enemy/npc.cpp index d26b8b3b4..079e2dcd6 100644 --- a/source/enemy/npc.cpp +++ b/source/enemy/npc.cpp @@ -343,6 +343,7 @@ void CNpc::detectCollisionWithPlayer() { // close enough for collision + m_oldControlFunc = m_controlFunc; m_controlFunc = NPC_CONTROL_COLLISION; } } @@ -953,6 +954,8 @@ void CNpc::processCollision() CPlayer *player = GameScene.getPlayer(); //player->takeDamage( m_data[m_type].damageToUserType ); + + m_controlFunc = m_oldControlFunc; } void CNpc::processTimer(int _frames) diff --git a/source/enemy/npc.h b/source/enemy/npc.h index 3e593b474..d53f20da2 100644 --- a/source/enemy/npc.h +++ b/source/enemy/npc.h @@ -357,6 +357,7 @@ protected: NPC_UNIT_TYPE m_type; NPC_CONTROL_FUNC m_controlFunc; + NPC_CONTROL_FUNC m_oldControlFunc; NPC_TIMER_FUNC m_timerFunc; NPC_SENSOR_FUNC m_sensorFunc; CNpcPath m_npcPath;