From 271d5038e7ed6b8feb777b637b4ce20da36e1b50 Mon Sep 17 00:00:00 2001
From: Roman Chistokhodov <freeslave93@gmail.com>
Date: Wed, 20 Jul 2022 01:14:25 +0300
Subject: [PATCH] Fix alien controllers facing in non-combat state

---
 dlls/controller.cpp | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/dlls/controller.cpp b/dlls/controller.cpp
index 49b455a85..b399dfc84 100644
--- a/dlls/controller.cpp
+++ b/dlls/controller.cpp
@@ -665,8 +665,11 @@ void CController::RunTask(Task_t* pTask)
 	case TASK_WAIT:
 	case TASK_WAIT_FACE_ENEMY:
 	case TASK_WAIT_PVS:
-		MakeIdealYaw(m_vecEnemyLKP);
-		ChangeYaw(pev->yaw_speed);
+		if (m_hEnemy != 0)
+		{
+			MakeIdealYaw(m_vecEnemyLKP);
+			ChangeYaw(pev->yaw_speed);
+		}
 
 		if (m_fSequenceFinished)
 		{