ACE3/addons/advanced_throwing/functions/fnc_getMuzzle.sqf
jonpas 742626ff1a
General - Relative script_component.hpp includes (#9378)
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
2023-09-12 20:58:10 +02:00

26 lines
659 B
Plaintext

#include "..\script_component.hpp"
/*
* Author: PabstMirror
* Retrieve muzzle name from config.
*
* Arguments:
* 0: Magazine Classname <STRING>
*
* Return Value:
* None
*
* Example:
* "magazine" call ace_advanced_throwing_fnc_getMuzzle
*
* Public: No
*/
params ["_magazineClassname"];
_magazineClassname = toLower _magazineClassname;
private _throwMuzzles = getArray (configFile >> "CfgWeapons" >> "Throw" >> "muzzles");
_throwMuzzles = _throwMuzzles select {_magazineClassname in ((getArray (configFile >> "CfgWeapons" >> "Throw" >> _x >> "magazines")) apply {toLower _x})};
[_throwMuzzles select 0, ""] select (_throwMuzzles isEqualTo [])