From 865e18670343aa4fd6df4f5b6c97f386bc3bb1e6 Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Tue, 30 Jul 2024 02:13:43 +0200 Subject: [PATCH] Server: log NavMesh query init failures on hotswap --- src/game/server/ai_utility.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/game/server/ai_utility.cpp b/src/game/server/ai_utility.cpp index c7b4c07c..f6eee3a5 100644 --- a/src/game/server/ai_utility.cpp +++ b/src/game/server/ai_utility.cpp @@ -12,6 +12,7 @@ #include "public/edict.h" #include "game/server/detour_impl.h" #include "game/server/ai_networkmanager.h" +#include "game/shared/util_shared.h" #include "vscript/languages/squirrel_re/vsquirrel.h" @@ -145,7 +146,8 @@ void Detour_HotSwap() const NavMeshType_e navType = NAI_Hull::NavMeshType(npc->GetHullType()); const dtNavMesh* const navMesh = Detour_GetNavMeshByType(navType); - pathFinder->GetNavMeshQuery()->init(navMesh, 2048); + if (dtStatusFailed(pathFinder->GetNavMeshQuery()->init(navMesh, 2048))) + Error(eDLL_T::SERVER, NOERROR, "%s - Failed to initialize Detour NavMesh query for %s\n", __FUNCTION__, UTIL_GetEntityScriptInfo(npc)); } g_pServerScript->ExecuteCodeCallback("CodeCallback_OnNavMeshHotSwapEnd");