From dfdee62732d28ca22f97df065a4b49cc159edd09 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Fri, 27 Feb 2015 23:12:54 -0600 Subject: [PATCH] Movement Comments/Formating --- addons/movement/functions/fnc_canClimb.sqf | 18 +++++++++++-- addons/movement/functions/fnc_climb.sqf | 26 ++++++++++++++----- addons/movement/functions/fnc_getWeight.sqf | 16 +++++++++++- addons/movement/functions/fnc_handleClimb.sqf | 17 +++++++++++- 4 files changed, 67 insertions(+), 10 deletions(-) diff --git a/addons/movement/functions/fnc_canClimb.sqf b/addons/movement/functions/fnc_canClimb.sqf index bd62bfb768..27753d8a12 100644 --- a/addons/movement/functions/fnc_canClimb.sqf +++ b/addons/movement/functions/fnc_canClimb.sqf @@ -1,4 +1,18 @@ -// by commy2 +/* + * Author: commy2 + * Tests the the player can climb. + * + * Arguments: + * 0: The Unit (usually the player) + * + * Return Value: + * The return value + * + * Example: + * _bool = [player] call ace_movement_fnc_canClimb + * + * Public: No + */ #include "script_component.hpp" private ["_unit", "_pos", "_dir"]; @@ -20,6 +34,6 @@ _checkPos1end = _checkPos1beg vectorAdd _dir; /* drawLine3D [ASLToATL _checkPos0beg, ASLToATL _checkPos0end, [1,0,0,1]]; drawLine3D [ASLToATL _checkPos1beg, ASLToATL _checkPos1end, [1,0,0,1]]; -*/ + */ lineIntersects [_checkPos0beg, _checkPos0end] && {!(lineIntersects [_checkPos1beg, _checkPos1end])} diff --git a/addons/movement/functions/fnc_climb.sqf b/addons/movement/functions/fnc_climb.sqf index 3f09b82a15..aff27ffe9d 100644 --- a/addons/movement/functions/fnc_climb.sqf +++ b/addons/movement/functions/fnc_climb.sqf @@ -1,4 +1,18 @@ -// by commy2 +/* + * Author: commy2 + * Make the player climb over short walls. + * + * Arguments: + * 0: The Unit (usually the player) + * + * Return Value: + * Nothing + * + * Example: + * [player] call ace_movement_fnc_climb + * + * Public: No + */ #include "script_component.hpp" private "_unit"; @@ -6,15 +20,15 @@ private "_unit"; _unit = _this select 0; if !([_unit] call FUNC(canClimb)) exitWith { - [localize "STR_ACE_Movement_CanNotClimb"] call EFUNC(common,displayTextStructured); + [localize "STR_ACE_Movement_CanNotClimb"] call EFUNC(common,displayTextStructured); }; if !(_unit getVariable [QGVAR(isClimbInit), false]) then { - _unit addEventHandler ["AnimDone", { - if (local (_this select 0) && {_this select 1 == "ACE_Climb"}) then {_this call FUNC(handleClimb)}; - }]; + _unit addEventHandler ["AnimDone", { + if (local (_this select 0) && {_this select 1 == "ACE_Climb"}) then {_this call FUNC(handleClimb)}; + }]; - _unit setVariable [QGVAR(isClimbInit), true]; + _unit setVariable [QGVAR(isClimbInit), true]; }; [_unit] call EFUNC(common,fixLoweredRifleAnimation); diff --git a/addons/movement/functions/fnc_getWeight.sqf b/addons/movement/functions/fnc_getWeight.sqf index 254b706d56..955be1a215 100644 --- a/addons/movement/functions/fnc_getWeight.sqf +++ b/addons/movement/functions/fnc_getWeight.sqf @@ -1,4 +1,18 @@ -// by commy2 +/* + * Author: commy2 + * Returns the weight (from the loadAbs command) in lbs/kg (based on user option) + * + * Arguments: + * 0: The Unit (usually the player) + * + * Return Value: + * The return value + * + * Example: + * _bool = [player] call ace_movement_fnc_getWeight + * + * Public: No + */ #include "script_component.hpp" private ["_unit", "_weight"]; diff --git a/addons/movement/functions/fnc_handleClimb.sqf b/addons/movement/functions/fnc_handleClimb.sqf index a96beccc2c..da0f8e0224 100644 --- a/addons/movement/functions/fnc_handleClimb.sqf +++ b/addons/movement/functions/fnc_handleClimb.sqf @@ -1,4 +1,19 @@ -// by commy2 +/* + * Author: commy2 + * Handles the climb animation finishing. Called from "AnimDone" event handler. + * + * Arguments: + * 0: The Unit (usually the player) + * 1: The finisehd animation + * + * Return Value: + * Nothing + * + * Example: + * [player, "ACE_climb"] call ace_movement_fnc_handleClimb + * + * Public: No + */ #include "script_component.hpp" private ["_unit", "_anim", "_pos"];