Created
February 5, 2017 20:13
-
-
Save jameslkingsley/80384ac05033333bd0e4c9ff587f720e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[{!isNil "arc_param_theme"}, { | |
private _unit = _this select 0; | |
if (!local _unit) exitWith {}; | |
if (isPlayer _unit) exitWith {}; | |
if (_unit getVariable ["ARC_assignedAIGear", false]) exitWith {}; | |
private _isMan = _unit isKindOf "CAManBase"; | |
private _side = side _unit; | |
private _faction = _side call ARC_fnc_getFactionFromSide; | |
if (!_isMan || !(_side in [west,east,resistance,civilian])) exitWith {}; | |
private _enabled = if (arc_param_theme != "Default" && {getNumber (missionConfigFile >> "Header" >> "sandbox") == 1}) then { | |
(missionConfigFile >> "CfgSandboxThemes" >> arc_param_theme >> "AIGear" >> _faction >> "enabled") call ARC_fnc_getCfgBool; | |
} else { | |
(missionConfigFile >> "CfgARCMF" >> "ai" >> "gear" >> _faction >> "enabled") call ARC_fnc_getCfgBool; | |
}; | |
if (!_enabled) exitWith { | |
// Fix for naked units bug in Zeus | |
[_unit, [_unit, "ARC_SavedInventory"]] call BIS_fnc_saveInventory; | |
[_unit, [_unit, "ARC_SavedInventory"]] call BIS_fnc_loadInventory; | |
_unit setVariable ["ARC_assignedAIGear_dummy", true, true]; | |
}; | |
_unit setVariable ["ARC_assignedAIGear", false, true]; | |
switch (true) do { | |
case (random 1 < 0.7): {["r", _unit] call f_fnc_assignGear;}; | |
case (random 1 < 0.2): {["ar", _unit] call f_fnc_assignGear;}; | |
}; | |
_unit setVariable ["ARC_assignedAIGear", true, true]; | |
}, _this] call CBA_fnc_waitUntilAndExecute; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment