diff --git a/addons/common/functions/fnc_filter.sqf b/addons/common/functions/fnc_filter.sqf index 3d84d9d3a2..0b30e59cf9 100644 --- a/addons/common/functions/fnc_filter.sqf +++ b/addons/common/functions/fnc_filter.sqf @@ -1,6 +1,5 @@ /* * Author: KoffeinFlummi, commy2 - * * Filters array and removes every element not fitting the condition * * Arguments: @@ -12,22 +11,21 @@ * * Usage: * [[0,1,2,3,4], {_this > 2}] call FUNC(filter) ==> [3,4] + * + * Public: Yes */ #include "script_component.hpp" -private ["_newArray", "_index"]; +params ["_array", "_code"]; -PARAMS_2(_array,_code); +private "_result"; +_result = []; -if (isNil "_array") exitWith { - ACE_LOGERROR_1("No array for function filter in %1.",_fnc_scriptNameParent); - [] -}; - -_newArray = []; -for "_index" from 0 to (count _array - 1) do { - if ((_array select _index) call _code) then { - _newArray pushBack (_array select _index); +{ + if (_x call _code) then { + _result pushBack _x; }; -}; -_newArray + false +} count _array; + +_result diff --git a/addons/common/functions/fnc_fixCollision.sqf b/addons/common/functions/fnc_fixCollision.sqf index 6b43cec469..1d55eb1454 100644 --- a/addons/common/functions/fnc_fixCollision.sqf +++ b/addons/common/functions/fnc_fixCollision.sqf @@ -1,13 +1,14 @@ /* * Author: commy2 - * Attempt to fix physx collisions causing unreasonable impact forces and damage. + * Attempt to fix PhysX collisions causing unreasonable impact forces and damage. * * Arguments: - * 0: Object <OBJECT> + * Object <OBJECT> * * Return Value: - * Nothing + * None * + * Public: No */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_fixCrateContent.sqf b/addons/common/functions/fnc_fixCrateContent.sqf index ad3ed8e528..a067c29c63 100644 --- a/addons/common/functions/fnc_fixCrateContent.sqf +++ b/addons/common/functions/fnc_fixCrateContent.sqf @@ -1,9 +1,20 @@ -// by commy2 +/* + * Author: commy2 + * Fixes zeus placed crates containing buged mine detectors and ace items. + * + * Arguments: + * 0: Crate <OBJECT> + * + * Return Value: + * None + * + * Public: No + */ #include "script_component.hpp" -private ["_weapons", "_items"]; +params ["_crate"]; -PARAMS_1(_crate); +private ["_weapons", "_items"]; // get all weapons inside the crate _weapons = weaponCargo _crate; diff --git a/addons/common/functions/fnc_fixFloating.sqf b/addons/common/functions/fnc_fixFloating.sqf index 6f08af1482..5fe94dcef7 100644 --- a/addons/common/functions/fnc_fixFloating.sqf +++ b/addons/common/functions/fnc_fixFloating.sqf @@ -3,16 +3,16 @@ * Attempt to fix floating physx with disabled damage after setPosXXX commands. * * Arguments: - * Physx object (Object) + * PhysX object <OBJECT> * * Return Value: - * Nothing + * None * + * Public: No */ #include "script_component.hpp" private "_object"; - _object = _this; // setHitPointDamage requires local object diff --git a/addons/common/functions/fnc_fixLoweredRifleAnimation.sqf b/addons/common/functions/fnc_fixLoweredRifleAnimation.sqf index f39f85cc94..9e230b00ad 100644 --- a/addons/common/functions/fnc_fixLoweredRifleAnimation.sqf +++ b/addons/common/functions/fnc_fixLoweredRifleAnimation.sqf @@ -15,8 +15,8 @@ */ #include "script_component.hpp" -PARAMS_1(_unit); +params ["_unit"]; -if (currentWeapon _unit != "" && {currentWeapon _unit == primaryWeapon _unit} && {weaponLowered _unit} && {stance _unit == "STAND"} && {(vehicle _unit) == _unit}) then { +if (currentWeapon _unit != "" && {currentWeapon _unit == primaryWeapon _unit} && {weaponLowered _unit} && {stance _unit == "STAND"} && {vehicle _unit == _unit}) then { [_unit, "amovpercmstpsraswrfldnon", 0] call FUNC(doAnimation); }; diff --git a/addons/common/functions/fnc_fixPosition.sqf b/addons/common/functions/fnc_fixPosition.sqf index 32cde87e52..54d0cdfbf6 100644 --- a/addons/common/functions/fnc_fixPosition.sqf +++ b/addons/common/functions/fnc_fixPosition.sqf @@ -4,10 +4,12 @@ * Fixes position of an object. E.g. moves object above ground and adjusts to terrain slope. Requires local object. * * Argument: - * Object (Object) + * Object <OBJECT> * - * Return value: - * NONE + * Return Value: + * None + * + * Public: No */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_isAlive.sqf b/addons/common/functions/fnc_isAlive.sqf index f9e8caadec..343466c00d 100644 --- a/addons/common/functions/fnc_isAlive.sqf +++ b/addons/common/functions/fnc_isAlive.sqf @@ -3,10 +3,10 @@ * Check if the object still exists and is alive. This function exists because 'alive objNull' actually returns true. * * Argument: - * 0: Any object (Object) + * 0: Any object <OBJECT> * * Return value: - * The object exists and is alive (Bool). + * The object exists and is alive <BOOL>. * * Public: Yes * @@ -14,4 +14,6 @@ */ #include "script_component.hpp" -!isNull (_this select 0) && {alive (_this select 0)} // return +params ["_unit"]; + +!isNull _unit && {alive _unit} // return diff --git a/addons/common/functions/fnc_map.sqf b/addons/common/functions/fnc_map.sqf index 30499a2ef2..a727de08bf 100644 --- a/addons/common/functions/fnc_map.sqf +++ b/addons/common/functions/fnc_map.sqf @@ -12,7 +12,7 @@ * Usage: * [["2", "gobblecock", "25"], {parseNumber _this}] call FUNC(map) ==> [2, 0, 25] * - * Public: No + * Public: Yes */ #include "script_component.hpp"