ACE3/addons/common/functions/fnc_isModLoaded.sqf
GhostIsSpooky 9ff5d34ce7
Common - Add cache to fnc_isModLoaded (#8794)
* add isModLoaded cache

* add missing brackets

* missed one

* Update fnc_handlePunjiTrapDamage.sqf

* Update fnc_isModLoaded.sqf

Co-authored-by: PabstMirror <pabstmirror@gmail.com>
2022-01-30 11:56:20 -06:00

28 lines
582 B
Plaintext

#include "script_component.hpp"
/*
* Author: Glowbal, GhostIsSpooky
* Check in CfgPatches if modification is loaded
*
* Arguments:
* 0: Mod Name or Classname of the mod in CfgPatches <STRING>
*
* Return Value:
* if modification is loaded <BOOL>
*
* Example:
* ["class"] call ace_common_fnc_isModLoaded
*
* Public: Yes
*/
params [["_modName", "", [""]]];
private _return = GVAR(isModLoadedCache) get _modName;
if (isNil "_return") then {
_return = isClass (configFile >> "CfgPatches" >> _modName);
GVAR(isModLoadedCache) set [_modName, _return];
};
_return