mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-01-19 20:24:49 +00:00
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
This commit is contained in:
parent
5e2e82bf7a
commit
9b2ccb8bd5
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue