ACE3/addons/intelitems/functions/fnc_handleMagIndex.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

30 lines
561 B
Plaintext

#include "..\script_component.hpp"
/*
* Author: PabstMirror, mharis001
* Handles assigning a unique intel index to a magazine id.
*
* Arguments:
* 0: Magazine id <STRING>
*
* Return Value:
* Intel Index <NUMBER>
*
* Example:
* ["001"] call ace_intelitems_fnc_handleMagIndex
*
* Public: No
*/
params ["_magazineId"];
private _index = GVAR(intelMap) getVariable _magazineId;
if (isNil "_index") then {
_index = GVAR(intelCount);
GVAR(intelCount) = GVAR(intelCount) + 1;
};
GVAR(intelMap) setVariable [_magazineId, _index, true];
_index