From 9b2ccb8bd5c994ba426d16abf1b149d28fab79b9 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Wed, 14 May 2025 10:17:55 -0500 Subject: [PATCH] fix controller autoasignment script the navmesh editor will try and bolt on an aicontroller initially referencing a datablock.aiControllerData for any given thing clicked on. make sure if you saved a file with one still referenced, it wont try to use the old one --- Templates/BaseGame/game/tools/navEditor/navEditor.tscript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Templates/BaseGame/game/tools/navEditor/navEditor.tscript b/Templates/BaseGame/game/tools/navEditor/navEditor.tscript index 7f7b01804..1acbab8ef 100644 --- a/Templates/BaseGame/game/tools/navEditor/navEditor.tscript +++ b/Templates/BaseGame/game/tools/navEditor/navEditor.tscript @@ -459,7 +459,7 @@ function NavEditorGui::onLinkSelected(%this, %flags) function NavEditorGui::onPlayerSelected(%this, %flags) { - if (!isObject(%this.getPlayer().aiController) && (!(%this.getPlayer().isMemberOfClass("AIPlayer")))) + if (!isObject(%this.getPlayer().aiController) || (isObject(%this.getPlayer().aiController) && !(%this.getPlayer().isMemberOfClass("AIPlayer")))) { %this.getPlayer().aiController = new AIController(){ ControllerData = %this.getPlayer().getDatablock().aiControllerData; }; %this.getPlayer().setAIController(%this.getPlayer().aiController);