diff --git a/addons/weaponselect/functions/fnc_countMagazinesForGrenadeMuzzle.sqf b/addons/weaponselect/functions/fnc_countMagazinesForGrenadeMuzzle.sqf index f45ed0ea57..44a60b8f13 100644 --- a/addons/weaponselect/functions/fnc_countMagazinesForGrenadeMuzzle.sqf +++ b/addons/weaponselect/functions/fnc_countMagazinesForGrenadeMuzzle.sqf @@ -12,10 +12,10 @@ */ #include "script_component.hpp" -PARAMS_2(_unit,_muzzle); - private ["_uniformMags", "_vestMags", "_backpackMags", "_numberOfMagazines", "_magazineClasses", "_firstMagazine"]; +params ["_unit", "_muzzle"]; + _uniformMags = getMagazineCargo uniformContainer _unit; _vestMags = getMagazineCargo vestContainer _unit; _backpackMags = getMagazineCargo backpackContainer _unit; diff --git a/addons/weaponselect/functions/fnc_displayGrenadeTypeAndNumber.sqf b/addons/weaponselect/functions/fnc_displayGrenadeTypeAndNumber.sqf index 81cb57d9f3..e9ae53f3b3 100644 --- a/addons/weaponselect/functions/fnc_displayGrenadeTypeAndNumber.sqf +++ b/addons/weaponselect/functions/fnc_displayGrenadeTypeAndNumber.sqf @@ -12,11 +12,11 @@ */ #include "script_component.hpp" +private ["_color", "_name", "_text", "_picture"]; + if !(GVAR(DisplayText)) exitwith {}; -PARAMS_2(_magazine,_numberofMagazines); - -private ["_color", "_name", "_text", "_picture"]; +params ["_magazine", "_numberofMagazines"]; _color = [[1,0,0], [1,1,1]] select (_numberofMagazines > 0); _name = getText (configFile >> "CfgMagazines" >> _magazine >> "displayNameShort"); diff --git a/addons/weaponselect/functions/fnc_findNextGrenadeMagazine.sqf b/addons/weaponselect/functions/fnc_findNextGrenadeMagazine.sqf index 65d62826e5..244f85b5ab 100644 --- a/addons/weaponselect/functions/fnc_findNextGrenadeMagazine.sqf +++ b/addons/weaponselect/functions/fnc_findNextGrenadeMagazine.sqf @@ -1,17 +1,25 @@ -// by commy2 +/* + * Author: commy2 + * + * Find the next Grenade Magazine. + * + * Argument: + * 0: Grenade Type ("All", "Frag", "NonFrag") + * + * Return value: + * Magazine classname + */ #include "script_component.hpp" -private ["_allMags", "_allMuzzles", "_magazines"]; +private ["_allMags", "_allMuzzles", "_magazines", "_start", "_index", "_nextMagazine"]; -PARAMS_1(_type); //"All", "Frag" or "NonFrag" +params ["_type"]; _allMags = missionNamespace getVariable [format [QGVAR(%1Magazines), _type], []]; _allMuzzles = missionNamespace getVariable [format [QGVAR(%1Muzzles), _type], []]; _magazines = magazines ACE_player; -private ["_start", "_index", "_nextMagazine"]; - _start = [GVAR(CurrentGrenadeMuzzleOther), GVAR(CurrentGrenadeMuzzleFrag)] select GVAR(CurrentGrenadeMuzzleIsFrag); _index = _allMuzzles find _start; diff --git a/addons/weaponselect/functions/fnc_findNextGrenadeMuzzle.sqf b/addons/weaponselect/functions/fnc_findNextGrenadeMuzzle.sqf index 0491afa413..39c4e84d1c 100644 --- a/addons/weaponselect/functions/fnc_findNextGrenadeMuzzle.sqf +++ b/addons/weaponselect/functions/fnc_findNextGrenadeMuzzle.sqf @@ -1,17 +1,25 @@ -// by commy2 +/* + * Author: commy2 + * + * Find the next Grenade Muzzle. + * + * Argument: + * 0: Grenade Type ("All", "Frag", "NonFrag") + * + * Return value: + * Class name of next throw muzzle + */ #include "script_component.hpp" -private ["_allMags", "_allMuzzles", "_magazines"]; +private ["_allMags", "_allMuzzles", "_magazines", "_start", "_index", "_nextMuzzle"]; -PARAMS_1(_type); //"All", "Frag" or "NonFrag" +params ["_type"]; _allMags = missionNamespace getVariable [format [QGVAR(%1Magazines), _type], []]; _allMuzzles = missionNamespace getVariable [format [QGVAR(%1Muzzles), _type], []]; _magazines = magazines ACE_player; -private ["_start", "_index", "_nextMuzzle"]; - _start = [GVAR(CurrentGrenadeMuzzleOther), GVAR(CurrentGrenadeMuzzleFrag)] select GVAR(CurrentGrenadeMuzzleIsFrag); _index = _allMuzzles find _start; diff --git a/addons/weaponselect/functions/fnc_fireSmokeLauncher.sqf b/addons/weaponselect/functions/fnc_fireSmokeLauncher.sqf index 37e2b1c873..9e9369ce26 100644 --- a/addons/weaponselect/functions/fnc_fireSmokeLauncher.sqf +++ b/addons/weaponselect/functions/fnc_fireSmokeLauncher.sqf @@ -1,9 +1,19 @@ -// by commy2 +/* + * Author: commy2 + * + * Fire Vehicle Smoke Launcher. + * + * Argument: + * 0: Vehicle + * + * Return value: + * None + */ #include "script_component.hpp" private ["_turret", "_weapons"]; -PARAMS_1(_vehicle); +params ["_vehicle"]; _turret = [_vehicle] call EFUNC(common,getTurretCommander); diff --git a/addons/weaponselect/functions/fnc_getSelectedGrenade.sqf b/addons/weaponselect/functions/fnc_getSelectedGrenade.sqf index 5e8c3f920f..53fabde032 100644 --- a/addons/weaponselect/functions/fnc_getSelectedGrenade.sqf +++ b/addons/weaponselect/functions/fnc_getSelectedGrenade.sqf @@ -1,4 +1,14 @@ -// by commy2 +/* + * Author: commy2 + * + * Returns the selected Grenade Muzzle. + * + * Argument: + * None + * + * Return value: + * Class name of selected throw muzzle. + */ #include "script_component.hpp" [GVAR(CurrentGrenadeMuzzleOther), GVAR(CurrentGrenadeMuzzleFrag)] select GVAR(CurrentGrenadeMuzzleIsFrag) diff --git a/addons/weaponselect/functions/fnc_playChangeFiremodeSound.sqf b/addons/weaponselect/functions/fnc_playChangeFiremodeSound.sqf index 45e84d631d..a64203fda8 100644 --- a/addons/weaponselect/functions/fnc_playChangeFiremodeSound.sqf +++ b/addons/weaponselect/functions/fnc_playChangeFiremodeSound.sqf @@ -1,9 +1,20 @@ -// by commy2 +/* + * Author: commy2 + * + * Play the change firemode sound for specified weapon at units position. + * + * Argument: + * 0: Unit + * 1: Weapon + * + * Return value: + * None + */ #include "script_component.hpp" private ["_sound"]; -PARAMS_2(_unit,_weapon); +params ["_unit", "_weapon"]; _sound = getArray (configFile >> "CfgWeapons" >> _weapon >> "changeFiremodeSound"); diff --git a/addons/weaponselect/functions/fnc_putWeaponAway.sqf b/addons/weaponselect/functions/fnc_putWeaponAway.sqf index a4cd743bfb..4c55bd04fc 100644 --- a/addons/weaponselect/functions/fnc_putWeaponAway.sqf +++ b/addons/weaponselect/functions/fnc_putWeaponAway.sqf @@ -4,14 +4,14 @@ * The unit will put its current weapon away. * * Argument: - * 0: What unit should put the current weapon on back? (Object) + * 0: Unit * * Return value: - * None. + * None */ #include "script_component.hpp" -PARAMS_1(_unit); +params ["_unit"]; [_unit] call EFUNC(common,fixLoweredRifleAnimation); diff --git a/addons/weaponselect/functions/fnc_selectGrenadeAll.sqf b/addons/weaponselect/functions/fnc_selectGrenadeAll.sqf index 69ea5cdf99..c5a8032d84 100644 --- a/addons/weaponselect/functions/fnc_selectGrenadeAll.sqf +++ b/addons/weaponselect/functions/fnc_selectGrenadeAll.sqf @@ -4,7 +4,7 @@ * Cycle through all grenades. * * Argument: - * None + * 0: Unit * * Return value: * None @@ -13,13 +13,12 @@ private ["_text", "_nextMuzzle"]; -PARAMS_1(_unit); +params ["_unit"]; _nextMuzzle = ["All"] call FUNC(findNextGrenadeMuzzle); if (_nextMuzzle != "") then { - private ["_magazines", "_magazine", "_count", "_return"]; _magazines = GVAR(AllMagazines) select (GVAR(AllMuzzles) find _nextMuzzle); reverse _magazines; diff --git a/addons/weaponselect/functions/fnc_selectGrenadeFrag.sqf b/addons/weaponselect/functions/fnc_selectGrenadeFrag.sqf index 91d0023e47..d1dc4e3442 100644 --- a/addons/weaponselect/functions/fnc_selectGrenadeFrag.sqf +++ b/addons/weaponselect/functions/fnc_selectGrenadeFrag.sqf @@ -4,7 +4,7 @@ * Cycle through frags. * * Argument: - * None + * 0: Unit * * Return value: * None @@ -13,7 +13,7 @@ private ["_text", "_nextMuzzle"]; -PARAMS_1(_unit); +params ["_unit"]; _nextMuzzle = ["Frag"] call FUNC(findNextGrenadeMuzzle); diff --git a/addons/weaponselect/functions/fnc_selectGrenadeOther.sqf b/addons/weaponselect/functions/fnc_selectGrenadeOther.sqf index 28cc0e74d8..5c7b712aa8 100644 --- a/addons/weaponselect/functions/fnc_selectGrenadeOther.sqf +++ b/addons/weaponselect/functions/fnc_selectGrenadeOther.sqf @@ -4,7 +4,7 @@ * Cycle through non explosive grenades. * * Argument: - * None + * 0: Unit * * Return value: * None @@ -13,7 +13,7 @@ private ["_nextMuzzle", "_text"]; -PARAMS_1(_unit); +params ["_unit"]; _nextMuzzle = ["NonFrag"] call FUNC(findNextGrenadeMuzzle); diff --git a/addons/weaponselect/functions/fnc_selectWeaponMode.sqf b/addons/weaponselect/functions/fnc_selectWeaponMode.sqf index 012bf94898..37f4a125e0 100644 --- a/addons/weaponselect/functions/fnc_selectWeaponMode.sqf +++ b/addons/weaponselect/functions/fnc_selectWeaponMode.sqf @@ -4,14 +4,15 @@ * The player will select the specified weapon or will change to the next firing mode if the weapon was already selected. * * Argument: - * 0: A weapon (String) + * 0: Unit + * 1: Weapon * * Return value: - * None. + * None */ #include "script_component.hpp" -PARAMS_2(_unit,_weapon); +params ["_unit", "_weapon"]; if (_weapon == "") exitWith {}; diff --git a/addons/weaponselect/functions/fnc_selectWeaponMuzzle.sqf b/addons/weaponselect/functions/fnc_selectWeaponMuzzle.sqf index 67e63cd830..11c360817e 100644 --- a/addons/weaponselect/functions/fnc_selectWeaponMuzzle.sqf +++ b/addons/weaponselect/functions/fnc_selectWeaponMuzzle.sqf @@ -4,14 +4,15 @@ * The player will select the specified weapon and change to the first additional muzzle. E.g. the grenade launcher of a assault rifle. * * Argument: - * 0: A weapon (String) + * 0: Unit + * 1: Weapon * * Return value: - * None. + * None */ #include "script_component.hpp" -PARAMS_2(_unit,_weapon); +params ["_unit", "_weapon"]; if (_weapon == "") exitWith {}; diff --git a/addons/weaponselect/functions/fnc_selectWeaponVehicle.sqf b/addons/weaponselect/functions/fnc_selectWeaponVehicle.sqf index 9507c23a30..952b28c5ef 100644 --- a/addons/weaponselect/functions/fnc_selectWeaponVehicle.sqf +++ b/addons/weaponselect/functions/fnc_selectWeaponVehicle.sqf @@ -1,7 +1,19 @@ -// by commy2 +/* + * Author: commy2 + * + * Select weapon for unit in vehicle. + * + * Argument: + * 0: Unit + * 1: Vehicle + * 2: Weapon index + * + * Return value: + * None + */ #include "script_component.hpp" -PARAMS_3(_unit,_vehicle,_index); +params ["_unit", "_vehicle", "_index"]; private "_turret"; _turret = [_unit] call EFUNC(common,getTurretIndex); diff --git a/addons/weaponselect/functions/fnc_setNextGrenadeMuzzle.sqf b/addons/weaponselect/functions/fnc_setNextGrenadeMuzzle.sqf index 4bf970fab1..f89b690e5e 100644 --- a/addons/weaponselect/functions/fnc_setNextGrenadeMuzzle.sqf +++ b/addons/weaponselect/functions/fnc_setNextGrenadeMuzzle.sqf @@ -4,18 +4,18 @@ * Select the next grenade muzzle to throw. * * Argument: - * muzzle name + * 0: Unit + * 1: Muzzlename * * Return value: * None - * */ #include "script_component.hpp" -PARAMS_2(_unit,_muzzle); - private ["_uniformMags", "_vestMags", "_backpackMags", "_i", "_uniformMagsToRemove", "_vestMagsToRemove", "_backpackMagsToRemove", "_firstMagazine", "_throwMuzzleNames"]; +params ["_unit", "_muzzle"]; + _uniformMags = getMagazineCargo uniformContainer _unit; _vestMags = getMagazineCargo vestContainer _unit; _backpackMags = getMagazineCargo backpackContainer _unit; diff --git a/addons/weaponselect/functions/fnc_throwGrenade.sqf b/addons/weaponselect/functions/fnc_throwGrenade.sqf index ab06fd5b5d..2dc8ddf2f8 100644 --- a/addons/weaponselect/functions/fnc_throwGrenade.sqf +++ b/addons/weaponselect/functions/fnc_throwGrenade.sqf @@ -1,11 +1,19 @@ -// by commy2 +/* + * Author: commy2 + * + * Display Grenade information on grenade throw. + * + * Argument: + * 0: Unit + * 1: Weapon + * 2: Magazine + * + * Return value: + * None + */ #include "script_component.hpp" -private ["_unit","_weapon","_magazine"]; - -_unit = _this select 0; -_weapon = _this select 1; -_magazine = _this select 5; +params ["_unit", "_weapon", "_magazine"]; if (_weapon != "Throw") exitWith {};