From 6ca37617104dec3830e180732d90c3f038b8be14 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Thu, 13 Aug 2015 11:54:26 -0500 Subject: [PATCH] AddAction basic param checking --- addons/interact_menu/functions/fnc_addActionToClass.sqf | 4 +++- addons/interact_menu/functions/fnc_addActionToObject.sqf | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/addons/interact_menu/functions/fnc_addActionToClass.sqf b/addons/interact_menu/functions/fnc_addActionToClass.sqf index ef4dc94d9e..8f814206ab 100644 --- a/addons/interact_menu/functions/fnc_addActionToClass.sqf +++ b/addons/interact_menu/functions/fnc_addActionToClass.sqf @@ -19,7 +19,9 @@ */ #include "script_component.hpp" -params ["_objectType", "_typeNum", "_parentPath", "_action"]; +if (!params [["_objectType", "", [""]], ["_typeNum", 0, [0]], ["_parentPath", [], [[]]], ["_action", [], [[]], 11]]) exitWith { + ERROR("Bad Params"); +}; // Ensure the config menu was compiled first if (_typeNum == 0) then { diff --git a/addons/interact_menu/functions/fnc_addActionToObject.sqf b/addons/interact_menu/functions/fnc_addActionToObject.sqf index fd64c61dad..f15bac79a0 100644 --- a/addons/interact_menu/functions/fnc_addActionToObject.sqf +++ b/addons/interact_menu/functions/fnc_addActionToObject.sqf @@ -19,7 +19,9 @@ */ #include "script_component.hpp" -params ["_object", "_typeNum", "_parentPath", "_action"]; +if (!params [["_object", objNull, [objNull]], ["_typeNum", 0, [0]], ["_parentPath", [], [[]]], ["_action", [], [[]], 11]]) exitWith { + ERROR("Bad Params"); +}; private ["_varName","_actionList"]; _varName = [QGVAR(actions),QGVAR(selfActions)] select _typeNum;