From 6ea1b95179ee91f204f3b96eaf86a419cd4b2d71 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Tue, 28 Jul 2015 17:26:23 -0500 Subject: [PATCH] #1939 - Fix Remove Action From Class --- .../functions/fnc_removeActionFromClass.sqf | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/addons/interact_menu/functions/fnc_removeActionFromClass.sqf b/addons/interact_menu/functions/fnc_removeActionFromClass.sqf index c407273258..3959d7d0b1 100644 --- a/addons/interact_menu/functions/fnc_removeActionFromClass.sqf +++ b/addons/interact_menu/functions/fnc_removeActionFromClass.sqf @@ -19,7 +19,7 @@ EXPLODE_3_PVT(_this,_objectType,_typeNum,_fullPath); -private ["_res","_varName","_actionTrees", "_actionIndex", "_parentLevel", "_parentNode"]; +private ["_res","_varName","_actionTrees", "_parentNode", "_found"]; _res = _fullPath call FUNC(splitPath); EXPLODE_2_PVT(_res,_parentPath,_actionName); @@ -30,10 +30,15 @@ _parentNode = [_actionTrees, _parentPath] call FUNC(findActionNode); if (isNil {_parentNode}) exitWith {}; // Iterate through children of the father +_found = false; { if (((_x select 0) select 0) == _actionName) exitWith { + TRACE_2("Deleting Action", _forEachIndex, _x); + _found = true; (_parentNode select 1) deleteAt _forEachIndex; }; } forEach (_parentNode select 1); -_parentLevel deleteAt _actionIndex; +if (!_found) then { + WARNING("Failed to find action to delete"); +};