2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2015-01-11 16:42:31 +00:00
|
|
|
/*
|
2024-08-02 11:59:18 +00:00
|
|
|
* Author: commy2, johnb43
|
2015-01-11 16:42:31 +00:00
|
|
|
* Get the muzzles of a weapon.
|
|
|
|
*
|
2015-09-21 11:08:10 +00:00
|
|
|
* Arguments:
|
|
|
|
* 0: Weapon <STRING>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* All weapon muzzles <ARRAY>
|
2015-01-11 16:42:31 +00:00
|
|
|
*
|
2017-06-08 13:31:51 +00:00
|
|
|
* Example:
|
2024-08-02 11:59:18 +00:00
|
|
|
* "arifle_AK12_F" call ace_common_fnc_getWeaponMuzzles
|
2017-06-08 13:31:51 +00:00
|
|
|
*
|
2015-09-21 11:08:10 +00:00
|
|
|
* Public: Yes
|
2015-01-11 16:42:31 +00:00
|
|
|
*/
|
|
|
|
|
2015-12-12 15:48:54 +00:00
|
|
|
params [["_weapon", "", [""]]];
|
2015-01-11 16:42:31 +00:00
|
|
|
|
2024-08-02 11:59:18 +00:00
|
|
|
private _config = configFile >> "CfgWeapons" >> _weapon;
|
2015-01-11 16:42:31 +00:00
|
|
|
|
2024-08-02 11:59:18 +00:00
|
|
|
if (!isClass _config) exitWith {
|
|
|
|
[] // return
|
|
|
|
};
|
|
|
|
|
|
|
|
private _muzzles = [];
|
|
|
|
|
|
|
|
// Get config case muzzle names
|
2015-12-12 15:48:54 +00:00
|
|
|
{
|
|
|
|
if (_x == "this") then {
|
2024-08-02 11:59:18 +00:00
|
|
|
_muzzles pushBack (configName _config);
|
|
|
|
} else {
|
|
|
|
if (isClass (_config >> _x)) then {
|
|
|
|
_muzzles pushBack (configName (_config >> _x));
|
|
|
|
};
|
2015-12-12 15:48:54 +00:00
|
|
|
};
|
2024-08-02 11:59:18 +00:00
|
|
|
} forEach getArray (_config >> "muzzles");
|
2015-01-17 17:26:51 +00:00
|
|
|
|
2024-08-02 11:59:18 +00:00
|
|
|
_muzzles // return
|