From 0fafe27da91bf73f44ae8413d3be83ef1bfc6f99 Mon Sep 17 00:00:00 2001 From: Michael Braun Date: Fri, 7 Aug 2015 08:19:15 +0200 Subject: [PATCH] Code cleanup in Tacticalladder module --- addons/tacticalladder/functions/fnc_cancelTLdeploy.sqf | 10 +++++----- .../tacticalladder/functions/fnc_confirmTLdeploy.sqf | 10 +++++----- addons/tacticalladder/functions/fnc_deployTL.sqf | 6 +++--- .../tacticalladder/functions/fnc_handleScrollWheel.sqf | 8 ++++---- addons/tacticalladder/functions/fnc_pickupTL.sqf | 6 +++--- addons/tacticalladder/functions/fnc_positionTL.sqf | 8 ++++---- 6 files changed, 24 insertions(+), 24 deletions(-) diff --git a/addons/tacticalladder/functions/fnc_cancelTLdeploy.sqf b/addons/tacticalladder/functions/fnc_cancelTLdeploy.sqf index 63a97d97e9..456d245832 100644 --- a/addons/tacticalladder/functions/fnc_cancelTLdeploy.sqf +++ b/addons/tacticalladder/functions/fnc_cancelTLdeploy.sqf @@ -9,7 +9,7 @@ * None * * Example: - * [_ladder] call ace_tacticalladder_fnc_cancelTLdeploy; + * [_ladder] call ace_tacticalladder_fnc_cancelTLdeploy * * Public: No */ @@ -17,16 +17,16 @@ #define __ANIMS ["extract_1","extract_2","extract_3","extract_4","extract_5","extract_6","extract_7","extract_8","extract_9","extract_10","extract_11"] -PARAMS_1(_ladder); +params ["_ladder"]; detach _ladder; _ladder animate ["rotate", 0]; { _ladder animate [_x, 0]; -} forEach __ANIMS; +} count __ANIMS; call EFUNC(interaction,hideMouseHint); -[ACE_player, "DefaultAction", ACE_player getVariable [QGVAR(Deploy), -1]] call EFUNC(Common,removeActionEventHandler); -[ACE_player, "zoomtemp", ACE_player getVariable [QGVAR(Cancel), -1]] call EFUNC(Common,removeActionEventHandler); +[ACE_player, "DefaultAction", ACE_player getVariable [QGVAR(Deploy), -1]] call EFUNC(Common,removeActionEventHandler); +[ACE_player, "zoomtemp", ACE_player getVariable [QGVAR(Cancel), -1]] call EFUNC(Common,removeActionEventHandler); GVAR(ladder) = objNull; diff --git a/addons/tacticalladder/functions/fnc_confirmTLdeploy.sqf b/addons/tacticalladder/functions/fnc_confirmTLdeploy.sqf index 93263c6aa0..764e5c73d8 100644 --- a/addons/tacticalladder/functions/fnc_confirmTLdeploy.sqf +++ b/addons/tacticalladder/functions/fnc_confirmTLdeploy.sqf @@ -6,16 +6,16 @@ * 0: ladder * * Return Value: - * Success? + * Success * * Example: - * [_ladder] call ace_tacticalladder_fnc_confirmTLdeploy; + * [_ladder] call ace_tacticalladder_fnc_confirmTLdeploy * * Public: No */ #include "script_component.hpp" -PARAMS_1(_ladder); +params ["_ladder"]; private ["_pos1", "_pos2"]; _pos1 = getPosASL GVAR(ladder); @@ -23,8 +23,8 @@ _pos2 = (GVAR(ladder) modelToWorld (GVAR(ladder) selectionPosition "check2")) ca if (lineIntersects [_pos1, _pos2, GVAR(ladder)]) exitWith { false }; call EFUNC(interaction,hideMouseHint); -[ACE_player, "DefaultAction", ACE_player getVariable [QGVAR(Deploy), -1]] call EFUNC(Common,removeActionEventHandler); -[ACE_player, "zoomtemp", ACE_player getVariable [QGVAR(Cancel), -1]] call EFUNC(Common,removeActionEventHandler); +[ACE_player, "DefaultAction", ACE_player getVariable [QGVAR(Deploy), -1]] call EFUNC(Common,removeActionEventHandler); +[ACE_player, "zoomtemp", ACE_player getVariable [QGVAR(Cancel), -1]] call EFUNC(Common,removeActionEventHandler); detach _ladder; GVAR(ladder) = objNull; diff --git a/addons/tacticalladder/functions/fnc_deployTL.sqf b/addons/tacticalladder/functions/fnc_deployTL.sqf index 7ad135ca90..14c386dda1 100644 --- a/addons/tacticalladder/functions/fnc_deployTL.sqf +++ b/addons/tacticalladder/functions/fnc_deployTL.sqf @@ -3,13 +3,13 @@ * Deploy tactical ladder * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: - * call ace_tacticalladder_fnc_deployTL; + * [] call ace_tacticalladder_fnc_deployTL * * Public: No */ diff --git a/addons/tacticalladder/functions/fnc_handleScrollWheel.sqf b/addons/tacticalladder/functions/fnc_handleScrollWheel.sqf index d08cb6e208..6b5107b814 100644 --- a/addons/tacticalladder/functions/fnc_handleScrollWheel.sqf +++ b/addons/tacticalladder/functions/fnc_handleScrollWheel.sqf @@ -9,13 +9,13 @@ * Handled * * Example: - * 1 call ace_tacticalladder_fnc_handleScrollWheel; + * [1] call ace_tacticalladder_fnc_handleScrollWheel; * * Public: No */ #include "script_component.hpp" -PARAMS_1(_scroll); +params ["_scroll"]; if (isNull GVAR(ladder)) exitWith { false }; @@ -37,7 +37,7 @@ if (GETMVAR(ACE_Modifier,0) == 0) then { if (GVAR(ladder) animationPhase (format["extract_%1", _currentStep]) == 1) then { GVAR(ladder) animate [format["extract_%1", _currentStep], 0]; GVAR(currentStep) = _currentStep - 1; - }; + }; }; } else { // Tilting @@ -45,4 +45,4 @@ if (GETMVAR(ACE_Modifier,0) == 0) then { GVAR(ladder) animate ["rotate", GVAR(currentAngle)]; }; -true \ No newline at end of file +true diff --git a/addons/tacticalladder/functions/fnc_pickupTL.sqf b/addons/tacticalladder/functions/fnc_pickupTL.sqf index c603f1feca..ad409f8870 100644 --- a/addons/tacticalladder/functions/fnc_pickupTL.sqf +++ b/addons/tacticalladder/functions/fnc_pickupTL.sqf @@ -7,10 +7,10 @@ * 1: unit * * Return Value: - * Success? + * Success * * Example: - * [_ladder, _unit] call ace_tacticalladder_fnc_pickupTL; + * [_ladder, _unit] call ace_tacticalladder_fnc_pickupTL * * Public: No */ @@ -18,7 +18,7 @@ if ((backpack ACE_player) != "") exitWith { false }; -PARAMS_2(_ladder,_unit); +params ["_ladder", "_unit"]; deleteVehicle _ladder; _unit addBackpack "ACE_TacticalLadder_Pack"; diff --git a/addons/tacticalladder/functions/fnc_positionTL.sqf b/addons/tacticalladder/functions/fnc_positionTL.sqf index 103792c851..1035101556 100644 --- a/addons/tacticalladder/functions/fnc_positionTL.sqf +++ b/addons/tacticalladder/functions/fnc_positionTL.sqf @@ -10,7 +10,7 @@ * None * * Example: - * [_ladder, _unit] call ace_tacticalladder_fnc_positionTL; + * [_ladder, _unit] call ace_tacticalladder_fnc_positionTL * * Public: No */ @@ -18,11 +18,11 @@ #define __ANIMS ["extract_1","extract_2","extract_3","extract_4","extract_5","extract_6","extract_7","extract_8","extract_9","extract_10","extract_11"] -PARAMS_2(_ladder,_unit); +params ["_ladder", "_unit"]; { _ladder animate [_x, 0]; -} forEach __ANIMS; +} count __ANIMS; _unit switchMove "amovpercmstpslowwrfldnon_player_idlesteady03"; _ladder attachTo [_unit, [0, 0.75, 0], ""]; // Position ladder in front of player @@ -30,7 +30,7 @@ _ladder attachTo [_unit, [0, 0.75, 0], ""]; // Position ladder in front of playe _ladder animate ["rotate", 0]; { _ladder animate [_x, 1]; -} forEach ["extract_1", "extract_2", "extract_3"]; // Extract ladder at head height (extract_3) +} count ["extract_1", "extract_2", "extract_3"]; // Extract ladder at head height (extract_3) GVAR(ladder) = _ladder; GVAR(cancelTime) = ACE_time + 1; // Workaround to prevent accidental canceling