2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2022-05-02 23:54:04 +00:00
|
|
|
/*
|
|
|
|
* Author: PabstMirror, Dystopian
|
2024-07-27 17:42:31 +00:00
|
|
|
* Gets magazine that the player can carry, suitable to vehicle magazine.
|
2022-05-02 23:54:04 +00:00
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Vehicle Magazine <STRING>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* Carry Magazine <STRING>
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* "1Rnd_GAT_missiles" call ace_csw_fnc_getCarryMagazine
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
|
|
|
params ["_vehicleMag"];
|
|
|
|
|
|
|
|
private _carryMag = GVAR(vehicleMagCache) get _vehicleMag;
|
|
|
|
if (isNil "_carryMag") then {
|
|
|
|
private _groups = "getNumber (_x >> _vehicleMag) == 1 && {isClass (configFile >> 'CfgMagazines' >> configName _x)}" configClasses (configFile >> QGVAR(groups));
|
|
|
|
_carryMag = configName (_groups param [0, configNull]);
|
|
|
|
GVAR(vehicleMagCache) set [_vehicleMag, _carryMag];
|
|
|
|
TRACE_2("setting cache",_vehicleMag,_carryMag);
|
|
|
|
};
|
|
|
|
|
|
|
|
_carryMag
|