From fc6cd34d33d4cd527d063fafde1bc7b2b02fe612 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sat, 15 Aug 2015 14:35:33 -0500 Subject: [PATCH] params, cleanup --- addons/explosives/XEH_postInit.sqf | 3 ++- .../functions/fnc_addCellphoneIED.sqf | 3 ++- addons/explosives/functions/fnc_addClacker.sqf | 6 +++++- .../functions/fnc_addDetonateActions.sqf | 9 ++++++--- .../functions/fnc_addExplosiveActions.sqf | 12 +++++++----- .../explosives/functions/fnc_addToSpeedDial.sqf | 11 +++++++---- .../functions/fnc_addTransmitterActions.sqf | 10 +++++++--- .../functions/fnc_addTriggerActions.sqf | 7 +++++-- addons/explosives/functions/fnc_canDefuse.sqf | 7 ++++++- addons/explosives/functions/fnc_canDetonate.sqf | 6 +++--- .../functions/fnc_defuseExplosive.sqf | 7 +++++-- .../functions/fnc_detonateExplosive.sqf | 16 ++++++++++------ addons/explosives/functions/fnc_dialPhone.sqf | 8 ++++++-- .../explosives/functions/fnc_dialingPhone.sqf | 9 ++++++--- .../explosives/functions/fnc_getDetonators.sqf | 7 +++++-- .../functions/fnc_getPlacedExplosives.sqf | 11 +++++++---- .../functions/fnc_getSpeedDialExplosive.sqf | 7 ++++++- .../explosives/functions/fnc_hasExplosives.sqf | 10 ++++++---- addons/explosives/functions/fnc_interactEH.sqf | 7 ++++--- addons/explosives/functions/fnc_module.sqf | 17 +++++------------ .../functions/fnc_onIncapacitated.sqf | 6 ++++-- .../functions/fnc_onInventoryChanged.sqf | 5 ++++- .../explosives/functions/fnc_openTimerSetUI.sqf | 5 ++++- .../explosives/functions/fnc_placeExplosive.sqf | 8 +++++--- .../functions/fnc_removeFromSpeedDial.sqf | 6 ++++-- .../explosives/functions/fnc_selectTrigger.sqf | 5 ++++- addons/explosives/functions/fnc_setPosition.sqf | 3 ++- .../explosives/functions/fnc_setSpeedDial.sqf | 2 ++ .../explosives/functions/fnc_setupExplosive.sqf | 7 ++++--- addons/explosives/functions/fnc_startDefuse.sqf | 12 ++++++++---- addons/explosives/functions/fnc_startTimer.sqf | 9 +++++---- addons/explosives/functions/fnc_triggerType.sqf | 5 ++++- 32 files changed, 160 insertions(+), 86 deletions(-) diff --git a/addons/explosives/XEH_postInit.sqf b/addons/explosives/XEH_postInit.sqf index 2043a2a632..e269d733e5 100644 --- a/addons/explosives/XEH_postInit.sqf +++ b/addons/explosives/XEH_postInit.sqf @@ -15,8 +15,9 @@ */ #include "script_component.hpp" +//When getting knocked out in medical, trigger deadman explosives: +//Event is global, only run on server (ref: ace_medical_fnc_setUnconscious) if (isServer) then { - //Event is global, only run on server (ref: ace_medical_fnc_setUnconscious) ["medical_onUnconscious", { params ["_unit", "_isUnconscious"]; if (!_isUnconscious) exitWith {}; diff --git a/addons/explosives/functions/fnc_addCellphoneIED.sqf b/addons/explosives/functions/fnc_addCellphoneIED.sqf index 953476861b..7851b608b5 100644 --- a/addons/explosives/functions/fnc_addCellphoneIED.sqf +++ b/addons/explosives/functions/fnc_addCellphoneIED.sqf @@ -18,7 +18,8 @@ */ #include "script_component.hpp" -EXPLODE_4_PVT(_this,_unit,_explosive,_magazineClass,_extra); +params ["_unit", "_explosive", "_magazineClass", "_extra"]; +TRACE_4("params",_unit,_explosive,_magazineClass,_extra); private["_config", "_detonators", "_hasRequired", "_requiredItems", "_code", "_count", "_codeSet"]; diff --git a/addons/explosives/functions/fnc_addClacker.sqf b/addons/explosives/functions/fnc_addClacker.sqf index d22b15eef4..f90c7d6189 100644 --- a/addons/explosives/functions/fnc_addClacker.sqf +++ b/addons/explosives/functions/fnc_addClacker.sqf @@ -17,8 +17,12 @@ * Public: Yes */ #include "script_component.hpp" + +params ["_unit", "_explosive", "_magazineClass"]; +TRACE_3("params",_unit,_explosive,_magazineClass); + private ["_clacker", "_config", "_requiredItems", "_hasRequired", "_detonators"]; -EXPLODE_3_PVT(_this,_unit,_explosive,_magazineClass); + // Config is the last item in the list of passed in items. _config = (_this select 3) select (count (_this select 3) - 1); diff --git a/addons/explosives/functions/fnc_addDetonateActions.sqf b/addons/explosives/functions/fnc_addDetonateActions.sqf index 5c94649608..04e78f0f82 100644 --- a/addons/explosives/functions/fnc_addDetonateActions.sqf +++ b/addons/explosives/functions/fnc_addDetonateActions.sqf @@ -15,10 +15,13 @@ * Public: No */ #include "script_component.hpp" + +params ["_unit", "_detonator"]; +TRACE_2("params",_unit,_detonator); + private ["_result", "_item", "_children", "_range", "_required"]; -EXPLODE_2_PVT(_this,_unit,_detonator); -_range = GetNumber (ConfigFile >> "CfgWeapons" >> _detonator >> "ACE_Range"); +_range = getNumber (ConfigFile >> "CfgWeapons" >> _detonator >> "ACE_Range"); _result = [_unit] call FUNC(getPlacedExplosives); _children = []; @@ -44,6 +47,6 @@ _children = []; ]; }; }; -} foreach _result; +} forEach _result; _children diff --git a/addons/explosives/functions/fnc_addExplosiveActions.sqf b/addons/explosives/functions/fnc_addExplosiveActions.sqf index 005163f2db..764c0cd7b8 100644 --- a/addons/explosives/functions/fnc_addExplosiveActions.sqf +++ b/addons/explosives/functions/fnc_addExplosiveActions.sqf @@ -1,6 +1,6 @@ /* * Author: Garth 'L-H' de Wet and CAA-Picard - * + * Adds sub actions for all explosive magazines (from insertChildren) * * Arguments: * 0: Unit @@ -11,9 +11,11 @@ * Public: No */ #include "script_component.hpp" -private ["_mags", "_item", "_index", "_children", "_itemCount", "_list"]; -EXPLODE_1_PVT(_this,_unit); +params ["_unit"]; +TRACE_1("params",_unit); + +private ["_mags", "_item", "_index", "_children", "_itemCount", "_list"]; _mags = magazines _unit; _list = []; @@ -41,7 +43,7 @@ _children = []; [ [ format ["Explosive_%1", _forEachIndex], - format [_name + " (%1)", _itemCount select _foreachIndex], + format [_name + " (%1)", _itemCount select _forEachIndex], getText(_x >> "picture"), {_this call FUNC(setupExplosive);}, {true}, @@ -51,6 +53,6 @@ _children = []; [], _unit ]; -} foreach _list; +} forEach _list; _children diff --git a/addons/explosives/functions/fnc_addToSpeedDial.sqf b/addons/explosives/functions/fnc_addToSpeedDial.sqf index 4f0772e601..bf409d5462 100644 --- a/addons/explosives/functions/fnc_addToSpeedDial.sqf +++ b/addons/explosives/functions/fnc_addToSpeedDial.sqf @@ -15,13 +15,16 @@ * Public: Yes */ #include "script_component.hpp" + +params ["_name", "_code"]; +TRACE_2("params",_name,_code); + private ["_speedDial", "_found"]; + _speedDial = ace_player getVariable [QGVAR(SpeedDial), []]; _found = false; -EXPLODE_2_PVT(_this,_name,_code); - -if ((_code) == "") ExitWith { +if ((_code) == "") exitWith { [_name] call FUNC(removeFromSpeedDial); }; { @@ -29,7 +32,7 @@ if ((_code) == "") ExitWith { _speedDial set [_foreachindex, _this]; _found = true; }; -} foreach _speedDial; +} forEach _speedDial; if (!_found) then { _speedDial pushBack _this; }; diff --git a/addons/explosives/functions/fnc_addTransmitterActions.sqf b/addons/explosives/functions/fnc_addTransmitterActions.sqf index abaa57decc..40ec8581d4 100644 --- a/addons/explosives/functions/fnc_addTransmitterActions.sqf +++ b/addons/explosives/functions/fnc_addTransmitterActions.sqf @@ -14,8 +14,12 @@ * Public: No */ #include "script_component.hpp" -private ["_unit", "_children", "_config", "_detonators"]; -_unit = _this select 0; + +params ["_unit"]; +TRACE_1("params",_unit); + +private ["_children", "_config", "_detonators"]; + _detonators = [_unit] call FUNC(getDetonators); _children = []; { @@ -34,6 +38,6 @@ _children = []; [], ACE_Player ]; -} foreach _detonators; +} forEach _detonators; _children diff --git a/addons/explosives/functions/fnc_addTriggerActions.sqf b/addons/explosives/functions/fnc_addTriggerActions.sqf index c8c9fd7b09..ca444a4e31 100644 --- a/addons/explosives/functions/fnc_addTriggerActions.sqf +++ b/addons/explosives/functions/fnc_addTriggerActions.sqf @@ -15,8 +15,11 @@ * Public: No */ #include "script_component.hpp" + +params ["_magazine", "_explosive"]; +TRACE_2("params",_magazine,_explosive); + private ["_hasRequiredItems","_triggerTypes", "_children", "_detonators", "_required", "_magTriggers", "_isAttached"]; -EXPLODE_2_PVT(_this,_magazine,_explosive); _isAttached = !isNull (attachedTo _explosive); _detonators = [ACE_player] call FUNC(getDetonators); @@ -51,6 +54,6 @@ _children = []; ACE_Player ]; }; -} foreach _triggerTypes; +} forEach _triggerTypes; _children diff --git a/addons/explosives/functions/fnc_canDefuse.sqf b/addons/explosives/functions/fnc_canDefuse.sqf index ef4bd10a83..e69ac41dac 100644 --- a/addons/explosives/functions/fnc_canDefuse.sqf +++ b/addons/explosives/functions/fnc_canDefuse.sqf @@ -4,6 +4,7 @@ * * Arguments: * 0: Unit + * 0: Target * * Return Value: * Able to defuse @@ -14,8 +15,12 @@ * Public: Yes */ #include "script_component.hpp" + +params ["_unit", "_target"]; +TRACE_2("params",_unit,_target); + private ["_isSpecialist"]; -EXPLODE_2_PVT(_this,_unit,_target); + if (isNull(_target getVariable [QGVAR(Explosive),objNull])) exitWith { deleteVehicle _target; false diff --git a/addons/explosives/functions/fnc_canDetonate.sqf b/addons/explosives/functions/fnc_canDetonate.sqf index 0b96f66f27..73ca3c4e70 100644 --- a/addons/explosives/functions/fnc_canDetonate.sqf +++ b/addons/explosives/functions/fnc_canDetonate.sqf @@ -14,7 +14,7 @@ * Public: Yes */ #include "script_component.hpp" -private "_unit"; -_unit = _this select 0; -[_unit] call FUNC(hasPlacedExplosives) and {count ([_unit] call FUNC(getDetonators)) > 0} +params ["_unit"]; + +([_unit] call FUNC(hasPlacedExplosives)) && {(count ([_unit] call FUNC(getDetonators))) > 0} diff --git a/addons/explosives/functions/fnc_defuseExplosive.sqf b/addons/explosives/functions/fnc_defuseExplosive.sqf index e0c7f7c85d..0af28788b3 100644 --- a/addons/explosives/functions/fnc_defuseExplosive.sqf +++ b/addons/explosives/functions/fnc_defuseExplosive.sqf @@ -15,9 +15,12 @@ * Public: Yes */ #include "script_component.hpp" -EXPLODE_2_PVT(_this,_unit,_explosive); -if (GVAR(ExplodeOnDefuse) && (random 1.0) < getNumber(ConfigFile >> "CfgAmmo" >> typeOf _explosive >> "ACE_explodeOnDefuse")) exitWith { +params ["_unit", "_explosive"]; +TRACE_2("params",_unit,_explosive); + +if (GVAR(ExplodeOnDefuse) && {(random 1.0) < (getNumber (ConfigFile >> "CfgAmmo" >> typeOf _explosive >> "ACE_explodeOnDefuse"))}) exitWith { + TRACE_1("exploding on defuse",_explosive); [_unit, -1, [_explosive, 1], true] call FUNC(detonateExplosive); }; diff --git a/addons/explosives/functions/fnc_detonateExplosive.sqf b/addons/explosives/functions/fnc_detonateExplosive.sqf index bfdf4a4b92..373e72ac21 100644 --- a/addons/explosives/functions/fnc_detonateExplosive.sqf +++ b/addons/explosives/functions/fnc_detonateExplosive.sqf @@ -19,12 +19,16 @@ * Public: Yes */ #include "script_component.hpp" -private ["_result", "_ignoreRange", "_helpers", "_pos"]; -EXPLODE_3_PVT(_this,_unit,_range,_item); + +params ["_unit", "_range", "_item"]; +TRACE_3("params",_unit,_range,_item); + +private ["_result", "_ignoreRange", "_pos"]; + _ignoreRange = (_range == -1); _result = true; -if (!_ignoreRange && {(_unit distance (_item select 0)) > _range}) exitWith {false}; +if (!_ignoreRange && {(_unit distance (_item select 0)) > _range}) exitWith {TRACE_1("out of range",_range); false}; if (getNumber (ConfigFile >> "CfgAmmo" >> typeof (_item select 0) >> "TriggerWhenDestroyed") == 0) then { private ["_exp", "_previousExp"]; @@ -40,11 +44,11 @@ if (getNumber (ConfigFile >> "CfgAmmo" >> typeof (_item select 0) >> "TriggerWhe }; }; [{ - private ["_explosive"]; - _explosive = _this; + params ["_explosive"]; + TRACE_1("exploding",_explosive); if (!isNull _explosive) then { _explosive setDamage 1; }; -}, _item select 0, _item select 1, 0] call EFUNC(common,waitAndExecute); +}, [_item select 0], (_item select 1)] call EFUNC(common,waitAndExecute); _result diff --git a/addons/explosives/functions/fnc_dialPhone.sqf b/addons/explosives/functions/fnc_dialPhone.sqf index aa163b027f..44addcda9f 100644 --- a/addons/explosives/functions/fnc_dialPhone.sqf +++ b/addons/explosives/functions/fnc_dialPhone.sqf @@ -15,8 +15,12 @@ * Public: Yes */ #include "script_component.hpp" + +params ["_unit", "_code"]; +TRACE_2("params",_unit,_code); + private ["_arr", "_ran", "_i"]; -EXPLODE_2_PVT(_this,_unit,_code); + if (_unit getVariable [QGVAR(Dialing),false]) exitWith {}; if !(alive _unit) exitWith {}; _unit setVariable [QGVAR(Dialing), true, true]; @@ -36,7 +40,7 @@ if (_unit == ace_player) then { [{ playSound3D [QUOTE(PATHTO_R(Data\Audio\Cellphone_Ring.wss)),objNull, false, getPosASL (_this select 1),3.16228,1,75]; (_this select 0) setVariable [QGVAR(Dialing), false, true]; - }, [_unit,_explosive select 0], 0.25 * (count _arr - 4), 0] call EFUNC(common,waitAndExecute); + }, [_unit,_explosive select 0], 0.25 * (count _arr - 4)] call EFUNC(common,waitAndExecute); [_explosive select 0,(0.25 * (count _arr - 1)) + (_explosive select 2)] call FUNC(startTimer); }; }; diff --git a/addons/explosives/functions/fnc_dialingPhone.sqf b/addons/explosives/functions/fnc_dialingPhone.sqf index fa992a9cac..cb9d7f5450 100644 --- a/addons/explosives/functions/fnc_dialingPhone.sqf +++ b/addons/explosives/functions/fnc_dialingPhone.sqf @@ -17,7 +17,10 @@ * Public: No */ #include "script_component.hpp" -EXPLODE_4_PVT(_this select 0,_unit,_i,_arr,_code); + +params ["_args", "_pfID"]; +_args params ["_unit", "_i", "_arr", "_code"]; + if ((_i mod 4) == 0) then { playSound3D [QUOTE(PATHTO_R(Data\Audio\DialTone.wss)), objNull, false, (_unit modelToWorldVisual [0,0.2,2]), 15,1,2.5]; }; @@ -27,7 +30,7 @@ private "_explosive"; _explosive = [_code] call FUNC(getSpeedDialExplosive); if (_i >= (count _arr + 2)) then { - [_this select 1] call CALLSTACK(cba_fnc_removePerFrameHandler); + [_pfID] call CALLSTACK(cba_fnc_removePerFrameHandler); if ((count _explosive) > 0) then { [_unit, -1, [_explosive select 0, _explosive select 2]] call FUNC(detonateExplosive); }; @@ -41,4 +44,4 @@ if (_i == (count _arr)) then { playSound3D [QUOTE(PATHTO_R(Data\Audio\Cellphone_Ring.wss)),objNull, false, getPosASL (_explosive select 0),3.16228,1,75]; }; }; -(_this select 0) set [1, _i + 1]; +_args set [1, _i + 1]; diff --git a/addons/explosives/functions/fnc_getDetonators.sqf b/addons/explosives/functions/fnc_getDetonators.sqf index da0bdc93d2..54c942e9de 100644 --- a/addons/explosives/functions/fnc_getDetonators.sqf +++ b/addons/explosives/functions/fnc_getDetonators.sqf @@ -16,8 +16,11 @@ #include "script_component.hpp" // IGNORE_PRIVATE_WARNING(_detonators); -private ["_unit", "_items", "_result", "_config"]; -_unit = _this select 0; +params ["_unit"]; +TRACE_1("params",_unit); + +private ["_items", "_result", "_config"]; + _items = (items _unit); _result = []; diff --git a/addons/explosives/functions/fnc_getPlacedExplosives.sqf b/addons/explosives/functions/fnc_getPlacedExplosives.sqf index 0c2080923a..56334af65b 100644 --- a/addons/explosives/functions/fnc_getPlacedExplosives.sqf +++ b/addons/explosives/functions/fnc_getPlacedExplosives.sqf @@ -18,8 +18,11 @@ #include "script_component.hpp" // IGNORE_PRIVATE_WARNING(_allExplosives,_deadmanExplosives); -private ["_unit", "_clackerList", "_adjustedList", "_list", "_filter"]; -_unit = _this select 0; +params ["_unit"]; +TRACE_1("params",_unit); + +private ["_clackerList", "_adjustedList", "_list", "_filter"]; + _filter = nil; if (count _this > 1) then { _filter = ConfigFile >> "ACE_Triggers" >> (_this select 1); @@ -30,14 +33,14 @@ _clackerList = _unit getVariable [QGVAR(Clackers), []]; _list = []; { if (isNull (_x select 0)) then { - _clackerList set [_foreachIndex, "X"]; + _clackerList set [_forEachIndex, "X"]; _adjustedList = true; } else { if (isNil "_filter" || {(ConfigFile >> "ACE_Triggers" >> (_x select 4)) == _filter}) then { _list pushBack _x; }; }; -} foreach _clackerList; +} forEach _clackerList; if (_adjustedList) then { _clackerList = _clackerList - ["X"]; if (count _clackerList == 0) then { diff --git a/addons/explosives/functions/fnc_getSpeedDialExplosive.sqf b/addons/explosives/functions/fnc_getSpeedDialExplosive.sqf index b57f4f9f16..b6bd9b6e6f 100644 --- a/addons/explosives/functions/fnc_getSpeedDialExplosive.sqf +++ b/addons/explosives/functions/fnc_getSpeedDialExplosive.sqf @@ -14,8 +14,12 @@ * Public: Yes */ #include "script_component.hpp" -EXPLODE_1_PVT(_this,_code); + +params ["_code"]; +TRACE_1("params",_code); + private ["_explosive"]; + if (isNil QGVAR(CellphoneIEDs)) exitWith {[]}; _explosive = []; { @@ -24,4 +28,5 @@ _explosive = []; }; false } count GVAR(CellphoneIEDs); + _explosive diff --git a/addons/explosives/functions/fnc_hasExplosives.sqf b/addons/explosives/functions/fnc_hasExplosives.sqf index bd790bd12f..4a626e9c63 100644 --- a/addons/explosives/functions/fnc_hasExplosives.sqf +++ b/addons/explosives/functions/fnc_hasExplosives.sqf @@ -9,16 +9,18 @@ * The unit has explosives * * Example: - * _hasExplosives = [player] call ACE_Explosives_fnc_hasExplosives; + * hasExplosives = [player] call ACE_Explosives_fnc_hasExplosives; * * Public: Yes */ #include "script_component.hpp" -// IGNORE_PRIVATE_WARNING(_hasExplosives); -private ["_unit", "_result", "_magazines"]; +params ["_unit"]; +TRACE_1("params",_unit); + +private ["_result", "_magazines"]; + _result = false; -_unit = _this select 0; _magazines = magazines _unit; { if (getNumber (ConfigFile >> "CfgMagazines" >> _x >> "ACE_Placeable") == 1) exitWith { diff --git a/addons/explosives/functions/fnc_interactEH.sqf b/addons/explosives/functions/fnc_interactEH.sqf index 4e916edb82..9be7568530 100644 --- a/addons/explosives/functions/fnc_interactEH.sqf +++ b/addons/explosives/functions/fnc_interactEH.sqf @@ -16,7 +16,8 @@ */ #include "script_component.hpp" -PARAMS_1(_interactionType); +params ["_interactionType"]; +TRACE_1("params",_interactionType); //Ignore self-interaction menu if (_interactionType != 0) exitWith {}; @@ -26,8 +27,8 @@ if ((vehicle ACE_player) != ACE_player) exitWith {}; if (!("ACE_DefusalKit" in (items ACE_player))) exitWith {}; [{ - PARAMS_2(_args,_pfID); - EXPLODE_3_PVT(_args,_setPosition,_addedDefuseHelpers,_minesHelped); + params ["_args", "_pfID"]; + _args params ["_setPosition", "_addedDefuseHelpers", "_minesHelped"]; if (!EGVAR(interact_menu,keyDown)) then { TRACE_1("Cleaning Defuse Helpers",(count _addedDefuseHelpers)); diff --git a/addons/explosives/functions/fnc_module.sqf b/addons/explosives/functions/fnc_module.sqf index 56225d8ca8..c74c73e679 100644 --- a/addons/explosives/functions/fnc_module.sqf +++ b/addons/explosives/functions/fnc_module.sqf @@ -14,20 +14,13 @@ * Public: No */ #include "script_component.hpp" + if !(isServer) exitWith {}; -private["_activated", "_logic"]; +params ["_logic"]; -_logic = _this select 0; -_activated = _this select 2; - -if !(_activated) exitWith {}; - -[_logic, QGVAR(RequireSpecialist), "RequireSpecialist"] - call EFUNC(Common,readSettingFromModule); -[_logic, QGVAR(PunishNonSpecialists),"PunishNonSpecialists"] - call EFUNC(Common,readSettingFromModule); -[_logic, QGVAR(ExplodeOnDefuse),"ExplodeOnDefuse"] - call EFUNC(Common,readSettingFromModule); +[_logic, QGVAR(RequireSpecialist), "RequireSpecialist"] call EFUNC(Common,readSettingFromModule); +[_logic, QGVAR(PunishNonSpecialists),"PunishNonSpecialists"] call EFUNC(Common,readSettingFromModule); +[_logic, QGVAR(ExplodeOnDefuse),"ExplodeOnDefuse"] call EFUNC(Common,readSettingFromModule); diag_log text "[ACE]: Explosive Module Initialized."; diff --git a/addons/explosives/functions/fnc_onIncapacitated.sqf b/addons/explosives/functions/fnc_onIncapacitated.sqf index 979ea7c536..963f106979 100644 --- a/addons/explosives/functions/fnc_onIncapacitated.sqf +++ b/addons/explosives/functions/fnc_onIncapacitated.sqf @@ -15,11 +15,13 @@ */ #include "script_component.hpp" -PARAMS_1(_unit); //Extended_Killed_EventHandlers runs only where _unit is local +//NOTE: Extended_Killed_EventHandlers runs only where _unit is local +params ["_unit"]; +TRACE_1("params",_unit); private ["_deadman"]; _deadman = [_unit, "DeadManSwitch"] call FUNC(getPlacedExplosives); { [_unit, -1, _x, true] call FUNC(detonateExplosive); -} foreach _deadman; +} forEach _deadman; diff --git a/addons/explosives/functions/fnc_onInventoryChanged.sqf b/addons/explosives/functions/fnc_onInventoryChanged.sqf index 53ebb2464d..3e3e1b96d3 100644 --- a/addons/explosives/functions/fnc_onInventoryChanged.sqf +++ b/addons/explosives/functions/fnc_onInventoryChanged.sqf @@ -17,8 +17,11 @@ * Public: No */ #include "script_component.hpp" + +params ["_receiver", "_giver", "_item"]; +TRACE_3("params",_receiver,_giver,_item); + private ["_config", "_detonators"]; -PARAMS_3(_receiver,_giver,_item); if (_receiver != ace_player) exitWith {}; diff --git a/addons/explosives/functions/fnc_openTimerSetUI.sqf b/addons/explosives/functions/fnc_openTimerSetUI.sqf index d08d7444dd..7175f425d4 100644 --- a/addons/explosives/functions/fnc_openTimerSetUI.sqf +++ b/addons/explosives/functions/fnc_openTimerSetUI.sqf @@ -15,7 +15,10 @@ * Public: No */ #include "script_component.hpp" -EXPLODE_2_PVT(_this,_explosive,_mag); + +params ["_explosive", "_mag"]; +TRACE_2("params",_explosive,_mag); + createDialog "RscACE_SelectTimeUI"; sliderSetRange [8845, 5, 900]; // 5seconds - 15minutes sliderSetPosition [8845, 30]; diff --git a/addons/explosives/functions/fnc_placeExplosive.sqf b/addons/explosives/functions/fnc_placeExplosive.sqf index 1740b6213a..0bb751ae64 100644 --- a/addons/explosives/functions/fnc_placeExplosive.sqf +++ b/addons/explosives/functions/fnc_placeExplosive.sqf @@ -21,9 +21,11 @@ * Public: Yes */ #include "script_component.hpp" -private ["_ammo", "_explosive", "_attachedTo", "_expPos", "_magazineTrigger"]; -EXPLODE_6_PVT(_this,_unit,_pos,_dir,_magazineClass,_triggerConfig,_triggerSpecificVars); -DEFAULT_PARAM(6,_setupPlaceholderObject,objNull); + +params ["_unit", "_pos", "_dir", "_magazineClass", "_triggerConfig", "_triggerSpecificVars", ["_setupPlaceholderObject", objNull]]; +TRACE_7("params",_unit,_pos,_dir,_magazineClass,_triggerConfig,_triggerSpecificVars,_setupPlaceholderObject); + +private ["_ammo", "_explosive", "_attachedTo", "_magazineTrigger"]; _unit playActionNow "PutDown"; diff --git a/addons/explosives/functions/fnc_removeFromSpeedDial.sqf b/addons/explosives/functions/fnc_removeFromSpeedDial.sqf index c67313966c..00b1cbba2a 100644 --- a/addons/explosives/functions/fnc_removeFromSpeedDial.sqf +++ b/addons/explosives/functions/fnc_removeFromSpeedDial.sqf @@ -14,13 +14,15 @@ * Public: Yes */ #include "script_component.hpp" + private "_speedDial"; + _speedDial = ace_player getVariable [QGVAR(SpeedDial), []]; if (count _speedDial == 0) exitWith {}; { if ((_x select 0) == (_this select 0)) exitWith { - _speedDial set [_foreachIndex, "x"]; + _speedDial set [_forEachIndex, "x"]; _speedDial = _speedDial - ["x"]; ace_player setVariable [QGVAR(SpeedDial),_speedDial]; }; -} foreach _speedDial; +} forEach _speedDial; diff --git a/addons/explosives/functions/fnc_selectTrigger.sqf b/addons/explosives/functions/fnc_selectTrigger.sqf index 4683aaa717..d225265a68 100644 --- a/addons/explosives/functions/fnc_selectTrigger.sqf +++ b/addons/explosives/functions/fnc_selectTrigger.sqf @@ -16,9 +16,12 @@ * Public: No */ #include "script_component.hpp" + +params ["_explosive", "_magazine", "_trigger"]; +TRACE_3("params",_explosive,_magazine,_trigger); + private ["_config"]; -EXPLODE_3_PVT(_this,_explosive,_magazine,_trigger); _config = ConfigFile >> "ACE_Triggers" >> _trigger; // If the onSetup function returns true, it is handled elsewhere diff --git a/addons/explosives/functions/fnc_setPosition.sqf b/addons/explosives/functions/fnc_setPosition.sqf index e182bc5e8b..8e50ac7f5e 100644 --- a/addons/explosives/functions/fnc_setPosition.sqf +++ b/addons/explosives/functions/fnc_setPosition.sqf @@ -17,7 +17,8 @@ */ #include "script_component.hpp" -EXPLODE_3_PVT(_this,_explosive,_direction,_pitch); +params ["_explosive", "_direction", "_pitch"]; +TRACE_3("params",_explosive,_direction,_pitch); if (isNull (attachedTo _explosive)) then { _explosive setDir _direction; diff --git a/addons/explosives/functions/fnc_setSpeedDial.sqf b/addons/explosives/functions/fnc_setSpeedDial.sqf index adb2e6af03..9013c812cc 100644 --- a/addons/explosives/functions/fnc_setSpeedDial.sqf +++ b/addons/explosives/functions/fnc_setSpeedDial.sqf @@ -15,7 +15,9 @@ * Public: No */ #include "script_component.hpp" + private ["_speedDial", "_amount"]; + _speedDial = ace_player getVariable [QGVAR(SpeedDial), []]; if (count _speedDial == 0) exitWith {}; _amount = if((_this select 0))then{1}else{-1}; diff --git a/addons/explosives/functions/fnc_setupExplosive.sqf b/addons/explosives/functions/fnc_setupExplosive.sqf index 754812f9d3..d09ebd2427 100644 --- a/addons/explosives/functions/fnc_setupExplosive.sqf +++ b/addons/explosives/functions/fnc_setupExplosive.sqf @@ -21,7 +21,8 @@ #define PLACE_RANGE_MAX 1 #define PLACE_RANGE_MIN 0.025 -PARAMS_3(_vehicle,_unit,_magClassname); +params ["_vehicle", "_unit", "_magClassname"]; +TRACE_3("params",_vehicle,_unit,_magClassname); private["_isAttachable", "_setupObjectClass", "_supportedTriggers", "_p3dModel"]; @@ -58,8 +59,8 @@ GVAR(TweakedAngle) = 0; [{ BEGIN_COUNTER(pfeh); - PARAMS_2(_args,_pfID); - EXPLODE_4_PVT(_args,_unit,_magClassname,_setupObjectClass,_isAttachable); + params ["_args", "_pfID"]; + _args params ["_unit", "_magClassname", "_setupObjectClass", "_isAttachable"]; private["_angle", "_attachVehicle", "_badPosition", "_basePosASL", "_cameraAngle", "_distanceFromBase", "_expSetupVehicle", "_index", "_intersectsWith", "_lookDirVector", "_max", "_min", "_modelDir", "_modelOffset", "_modelUp", "_placeAngle", "_realDistance", "_return", "_screenPos", "_testBase", "_testPos", "_testPositionIsValid", "_virtualPosASL"]; diff --git a/addons/explosives/functions/fnc_startDefuse.sqf b/addons/explosives/functions/fnc_startDefuse.sqf index 251e1e213d..2c394a997a 100644 --- a/addons/explosives/functions/fnc_startDefuse.sqf +++ b/addons/explosives/functions/fnc_startDefuse.sqf @@ -15,14 +15,17 @@ * Public: Yes */ #include "script_component.hpp" -EXPLODE_2_PVT(_this,_unit,_target); + +params ["_unit", "_target"]; +TRACE_2("params",_unit,_target); private["_actionToPlay", "_defuseTime", "_isEOD"]; _target = attachedTo (_target); _fnc_DefuseTime = { - EXPLODE_2_PVT(_this,_specialist,_target); + params ["_specialist", "_target"]; + TRACE_2("defuseTime",_specialist,_target); private ["_defuseTime"]; _defuseTime = 5; if (isNumber(ConfigFile >> "CfgAmmo" >> typeOf (_target) >> "ACE_DefuseTime")) then { @@ -48,11 +51,12 @@ if (ACE_player != _unit) then { _unit disableAI "TARGET"; _defuseTime = [[_unit] call EFUNC(Common,isEOD), _target] call _fnc_DefuseTime; [{ - PARAMS_2(_unit,_target); + params ["_unit", "_target"]; + TRACE_2("defuse finished",_unit,_target); [_unit, _target] call FUNC(defuseExplosive); _unit enableAI "MOVE"; _unit enableAI "TARGET"; - }, [_unit, _target], _defuseTime, 0] call EFUNC(common,waitAndExecute); + }, [_unit, _target], _defuseTime] call EFUNC(common,waitAndExecute); }; } else { _unit playActionNow _actionToPlay; diff --git a/addons/explosives/functions/fnc_startTimer.sqf b/addons/explosives/functions/fnc_startTimer.sqf index 9d2ca0aee4..ca219ed13c 100644 --- a/addons/explosives/functions/fnc_startTimer.sqf +++ b/addons/explosives/functions/fnc_startTimer.sqf @@ -16,12 +16,13 @@ */ #include "script_component.hpp" -EXPLODE_2_PVT(_this,_explosive,_delay); +params ["_explosive", "_delay"]; +TRACE_2("params",_explosive,_delay); [{ - private ["_explosive"]; - _explosive = _this; + params ["_explosive"]; + TRACE_1("Explosive Going Boom",_explosive); if (!isNull _explosive) then { [_explosive, -1, [_explosive, 0]] call FUNC(detonateExplosive); }; -}, _explosive, _delay, 0] call EFUNC(common,waitAndExecute); +}, [_explosive], _delay] call EFUNC(common,waitAndExecute); diff --git a/addons/explosives/functions/fnc_triggerType.sqf b/addons/explosives/functions/fnc_triggerType.sqf index 7ca7d27c6a..0fc29e34ad 100644 --- a/addons/explosives/functions/fnc_triggerType.sqf +++ b/addons/explosives/functions/fnc_triggerType.sqf @@ -15,10 +15,13 @@ */ #include "script_component.hpp" +params ["_magazineClassname"]; +TRACE_1("params",_magazineClassname); + private["_result", "_config", "_count", "_index"]; _result = []; -_config = getArray (ConfigFile >> "CfgMagazines" >> (_this select 0) >> "ACE_Triggers" >> "SupportedTriggers"); +_config = getArray (ConfigFile >> "CfgMagazines" >> _magazineClassname >> "ACE_Triggers" >> "SupportedTriggers"); _count = count _config; for "_index" from 0 to (_count - 1) do {