From 6f3b07ed34ab5977792ff80771c2c74bd7de3d2a Mon Sep 17 00:00:00 2001 From: Marco Cawthorne Date: Wed, 4 Oct 2023 08:56:21 -0700 Subject: [PATCH] NSNavAI: ensure everything is properly nulled when an empty chase path target is set. --- src/shared/NSNavAI.qc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/shared/NSNavAI.qc b/src/shared/NSNavAI.qc index fe862fd2..49bfadbb 100644 --- a/src/shared/NSNavAI.qc +++ b/src/shared/NSNavAI.qc @@ -310,6 +310,12 @@ NSNavAI::RouteToPosition(vector destination) void NSNavAI::ChasePath(string startPath) { + if (!startPath || startPath == "") { + m_pathTarget = __NULL__; + m_pathEntity = __NULL__; + return; + } + m_pathTarget = startPath; m_pathEntity = (NSEntity)find(world, ::targetname, m_pathTarget); NSNavAI_Log("Actor %S chase Path set to %S\n", netname, m_pathEntity.targetname);