ACE3/addons/common/functions/fnc_getWeaponMuzzles.sqf
johnb432 6a25e9365a
Safemode - Refactor (#10111)
* Refactor safemode

* Further improvements and fixes

* Update XEH_postInit.sqf

* Don't allow binoculars to be set to safe

* Add API for getting weapon safety status

* Update fnc_jamWeapon.sqf

* Added doc

* Update fnc_playChangeFiremodeSound.sqf

* Update addons/overheating/functions/fnc_jamWeapon.sqf

Co-authored-by: PabstMirror <pabstmirror@gmail.com>

* Update addons/weaponselect/functions/fnc_selectWeaponMode.sqf

Co-authored-by: PabstMirror <pabstmirror@gmail.com>

---------

Co-authored-by: PabstMirror <pabstmirror@gmail.com>
2024-08-02 13:59:18 +02:00

40 lines
758 B
Plaintext

#include "..\script_component.hpp"
/*
* Author: commy2, johnb43
* Get the muzzles of a weapon.
*
* Arguments:
* 0: Weapon <STRING>
*
* Return Value:
* All weapon muzzles <ARRAY>
*
* Example:
* "arifle_AK12_F" call ace_common_fnc_getWeaponMuzzles
*
* Public: Yes
*/
params [["_weapon", "", [""]]];
private _config = configFile >> "CfgWeapons" >> _weapon;
if (!isClass _config) exitWith {
[] // return
};
private _muzzles = [];
// Get config case muzzle names
{
if (_x == "this") then {
_muzzles pushBack (configName _config);
} else {
if (isClass (_config >> _x)) then {
_muzzles pushBack (configName (_config >> _x));
};
};
} forEach getArray (_config >> "muzzles");
_muzzles // return