NSNavAI: ensure everything is properly nulled when an empty chase path target is set.

This commit is contained in:
Marco Cawthorne 2023-10-04 08:56:21 -07:00
parent 07e70aa4c4
commit 6f3b07ed34
Signed by: eukara
GPG key ID: CE2032F0A2882A22

View file

@ -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);