From 5378bafa182f0fca5d6e44ca56a389ac87758204 Mon Sep 17 00:00:00 2001 From: Steam Deck User Date: Tue, 24 Jan 2023 21:34:10 -0500 Subject: [PATCH] SERVER: Fix finding target for window reaching --- source/server/ai/ai_core.qc | 14 -------------- source/server/ai/zombie_core.qc | 8 ++++---- 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/source/server/ai/ai_core.qc b/source/server/ai/ai_core.qc index f7a63de..041cef5 100644 --- a/source/server/ai/ai_core.qc +++ b/source/server/ai/ai_core.qc @@ -522,20 +522,6 @@ float() TryWalkToEnemy = } }; -#ifndef PC -float() SetUpGoalDummy = -{ - self.goaldummy.origin = Get_Waypoint_Near(self); - setorigin(self.goaldummy,self.goaldummy.origin); - self.goalentity = self.goaldummy; - - if (!self.goalentity) - bprint(PRINT_HIGH, "Could not find waypoint for zombie\n"); - - return 1; //because we can't actually know if it was good or not... yet -}; -#endif - void() PathfindToEnemy = { float path_result; diff --git a/source/server/ai/zombie_core.qc b/source/server/ai/zombie_core.qc index 55749c1..7474fcd 100644 --- a/source/server/ai/zombie_core.qc +++ b/source/server/ai/zombie_core.qc @@ -909,17 +909,17 @@ void() zombie_attack = local entity who; local float found; found = 0; - who = findradius(self.origin,70); - while(who && found == 0 ) + who = findradius(self.origin, 70); + while (who != world && found == false) { if(who.classname == "player") { - found = 1; + found = true; } else who = who.chain; } - if(found == 1) + if (found == true) { zombie_attack_through_w1(); return;