ACE3/addons/zeus/functions/fnc_handleZeusUnitAssigned.sqf

47 lines
1.1 KiB
Plaintext
Raw Normal View History

#include "..\script_component.hpp"
2015-05-18 19:43:02 +00:00
/*
* Author: kymckay
2015-05-18 21:50:36 +00:00
* Contextually removes addons (given in ACE_Curator) from zeus based on their required addon(s)
*
* ACE_Curator format:
* ModuleAddon = "RequiredAddon";
* OR
* ModuleAddon[] = {"RequiredAddon1","RequiredAddon2",...}
2015-05-18 19:43:02 +00:00
*
* Arguments:
* 0: The zeus logic <LOGIC>
* 1: The zeus player <UNIT>
*
* Return Value:
* None
2015-05-18 19:43:02 +00:00
*
* Example:
* [LOGIC, bob] call ace_zeus_fnc_handleZeusUnitAssigned
*
2015-05-18 19:43:02 +00:00
* Public: No
*/
2015-05-18 21:50:36 +00:00
if !(isClass (configFile >> "ACE_Curator")) exitWith { ERROR("The ACE_Curator class does not exist") };
2015-08-04 22:16:23 +00:00
params ["_logic"];
2015-05-18 21:50:36 +00:00
private _removeAddons = [];
{
private _addon = _x;
if (isArray _addon) then {
2015-05-18 21:50:36 +00:00
{
if !([_x] call EFUNC(common,isModLoaded)) exitWith {
_removeAddons pushBack (configName _addon);
2015-05-18 21:50:36 +00:00
};
} forEach (getArray _addon);
2015-05-18 21:50:36 +00:00
};
if (isText _addon) then {
if !([getText _addon] call EFUNC(common,isModLoaded)) then {
_removeAddons pushBack (configName _addon);
2015-05-18 21:50:36 +00:00
};
};
} forEach configProperties [configFile >> "ACE_Curator"];
2015-05-18 19:43:02 +00:00
_logic removeCuratorAddons _removeAddons;