From c75d219b65a2c311293a31dfcc236abafdc0f5b6 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sat, 3 Oct 2015 21:34:46 -0500 Subject: [PATCH] Cleanup Undefined Functions --- addons/common/functions/fnc_dumpArray.sqf | 14 ++--- .../functions/fnc_execPersistentFnc.sqf | 3 +- addons/common/functions/fnc_execRemoteFnc.sqf | 3 +- addons/common/functions/fnc_loadPerson.sqf | 2 +- .../fnc_sendDisplayInformationTo.sqf | 53 ------------------- .../functions/fnc_sendDisplayMessageTo.sqf | 53 ------------------- 6 files changed, 11 insertions(+), 117 deletions(-) delete mode 100644 addons/common/functions/fnc_sendDisplayInformationTo.sqf delete mode 100644 addons/common/functions/fnc_sendDisplayMessageTo.sqf diff --git a/addons/common/functions/fnc_dumpArray.sqf b/addons/common/functions/fnc_dumpArray.sqf index 182c542df2..010736d3a9 100644 --- a/addons/common/functions/fnc_dumpArray.sqf +++ b/addons/common/functions/fnc_dumpArray.sqf @@ -1,22 +1,24 @@ /* * Author: ? - * ? + * Dumps an array to the RPT, showing the depth of each element. * * Arguments: * 0: Array to be dumped - * 1: Depth + * 1: Depth * * Return Value: * None * + * Example: + * [[0, [1,2], [[3]]]] call ace_common_fnc_dumpArray + * * Public: No */ #include "script_component.hpp" -params ["_var", "_depth"]; +params ["_var", ["_depth", 0, [0]]]; -private "_pad"; -_pad = ""; +local _pad = ""; for "_i" from 0 to _depth do { _pad = _pad + toString [9]; @@ -38,5 +40,5 @@ if (IS_ARRAY(_var)) then { diag_log text format ["%1],", _pad]; }; } else { - diag_log text format ["%1%2", _pad, [_var] call FUNC(formatVar)]; + diag_log text format ["%1%2", _pad, _var]; }; diff --git a/addons/common/functions/fnc_execPersistentFnc.sqf b/addons/common/functions/fnc_execPersistentFnc.sqf index dc88a7c3c9..0b7bccb69a 100644 --- a/addons/common/functions/fnc_execPersistentFnc.sqf +++ b/addons/common/functions/fnc_execPersistentFnc.sqf @@ -20,11 +20,10 @@ GVAR(remoteFnc) = _this; params ["_arguments", "_function", "_unit", "_name"]; +TRACE_4("params", _arguments, _function, _unit, _name); _function = call compile _function; -//["Remote", [_arguments, _this select 1, _name], {format ["%1 call %2 id: %3", _this select 0, _this select 1, _this select 2]}, false] call FUNC(log); - // execute function on every currently connected machine [[_arguments, _unit], _this select 1, 2] call FUNC(execRemoteFnc); diff --git a/addons/common/functions/fnc_execRemoteFnc.sqf b/addons/common/functions/fnc_execRemoteFnc.sqf index 6b617bf92f..0dd0653a33 100644 --- a/addons/common/functions/fnc_execRemoteFnc.sqf +++ b/addons/common/functions/fnc_execRemoteFnc.sqf @@ -23,11 +23,10 @@ GVAR(remoteFnc) = _this; params ["_arguments", "_function", ["_unit", 2]]; +TRACE_3("params", _arguments, _function, _unit); _function = call compile _function; -//["Remote", [_arguments, _this select 1, _unit], {format ["%1 call %2 to: %3", _this select 0, _this select 1, _this select 2]}, false] call FUNC(log); - if (typeName _unit == "SCALAR") exitWith { switch (_unit) do { case 0 : { diff --git a/addons/common/functions/fnc_loadPerson.sqf b/addons/common/functions/fnc_loadPerson.sqf index 377412bd4c..da729ed0d7 100644 --- a/addons/common/functions/fnc_loadPerson.sqf +++ b/addons/common/functions/fnc_loadPerson.sqf @@ -21,7 +21,7 @@ private ["_vehicle", "_loadcar", "_loadair", "_loadtank", "_loadboat"]; _vehicle = objNull; -if (!([_caller] call FUNC(canInteract)) || {_caller == _unit}) exitwith {_vehicle}; +if (!([_caller, _unit, ["isNotDragging", "isNotCarrying"]] call FUNC(canInteractWith)) || {_caller == _unit}) exitwith {_vehicle}; _loadcar = nearestObject [_unit, "Car"]; diff --git a/addons/common/functions/fnc_sendDisplayInformationTo.sqf b/addons/common/functions/fnc_sendDisplayInformationTo.sqf deleted file mode 100644 index aa3dba2365..0000000000 --- a/addons/common/functions/fnc_sendDisplayInformationTo.sqf +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Author: Glowbal - * Sends a display information hint to a receiver - * - * Arguments: - * 0: receiver - * 1: title - * 2: content - * 3: type (optional) - * - * Return Value: - * None - * - * Public: Yes - */ -#include "script_component.hpp" - -params [["_reciever", objNull], ["_title", ""], ["_content", ""], ["_type", 0], ["_parameters", []]]; - -if (isPlayer _reciever) then { - if (!local _reciever) then { - [_this, QFUNC(sendDisplayInformationTo), _reciever, false] call FUNC(execRemoteFnc); - } else { - if (isLocalized _title) then { - _title = localize _title; - }; - - private "_localizationArray"; - _localizationArray = [_title]; - - { - _localizationArray pushback _x; - false - } count _parameters; - - _title = format _localizationArray; - - { - if (isLocalized _x) then { - _localizationArray = [localize _x]; - - { - _localizationArray pushBack _x; - false - } count _parameters; - - _content set [_forEachIndex, format _localizationArray]; - }; - } forEach _content; - - [_title, _content, _type] call FUNC(displayInformation); - }; -}; diff --git a/addons/common/functions/fnc_sendDisplayMessageTo.sqf b/addons/common/functions/fnc_sendDisplayMessageTo.sqf deleted file mode 100644 index 6f16ec8006..0000000000 --- a/addons/common/functions/fnc_sendDisplayMessageTo.sqf +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Author: Glowbal - * Displays a message on locality of receiver - * - * Arguments: - * 0: receiver - * 1: title - * 2: content - * 3: type (optional) - * - * Return Value: - * None - * - * Public: Yes - */ -#include "script_component.hpp" - -params [["_reciever", objNull], ["_title", ""], ["_content", ""], ["_type", 0], ["_parameters", []]]; - -if (isPlayer _reciever) then { - if (!local _reciever) then { - [_this, QFUNC(sendDisplayMessageTo), _reciever, false] call FUNC(execRemoteFnc); - } else { - if (isLocalized _title) then { - _title = localize _title; - }; - - if (isLocalized _content) then { - _content = localize _content; - }; - - private "_localizationArray"; - _localizationArray = [_title]; - - { - _localizationArray pushBack _x; - false - } count _parameters; - - _title = format _localizationArray; - - _localizationArray = [_content]; - - { - _localizationArray pushBack _x; - false - } count _parameters; - - _content = format _localizationArray; - - [_title, _content, _type] call FUNC(displayMessage); - }; -};