Skip to content

Commit

Permalink
Update fn_ReinforcementsCreateUnits.sqf
Browse files Browse the repository at this point in the history
Moved `setWaypointStatements` closer to `addWaypoint` to reduce chance of race condition.
  • Loading branch information
ampersand38 committed Aug 31, 2019
1 parent 28f48cd commit 6da31d4
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,15 @@ switch (_groupBehaviour) do
private _rpLogic = [_lzPos, _allRpLogics, _rpAlgorithm] call Achilles_fnc_logicSelector;
private _rpPos = position _rpLogic;
private _infantryRallyWp = _infantryGroup addWaypoint [_rpPos, _rpSize];
//Check ACEX Headless Client
if (isClass (configFile >> "CfgPatches" >> "acex_headless") && {acex_headless_enabled}) then
{
//to ensure unload, blacklist
_infantryGroup setVariable ["acex_headless_blacklist", true, true];

//after rally, unblacklist _infantryGroup
_infantryRallyWp setWaypointStatements ["true", "(group this) setVariable ['acex_headless_blacklist', false, true];"];
};

// Load the units into the vehicle.
{
Expand Down Expand Up @@ -306,12 +315,9 @@ if (isClass (configFile >> "CfgPatches" >> "acex_headless") && {acex_headless_en
{
//to ensure unload, blacklist
_vehicleGroup setVariable ["acex_headless_blacklist", true, true];
_infantryGroup setVariable ["acex_headless_blacklist", true, true];

//after unload, unblacklist _vehicleGroup
_vehicleUnloadWp setWaypointStatements ["true", "(group this) setVariable ['acex_headless_blacklist', false, true];"];
//after rally, unblacklist _infantryGroup
_infantryRallyWp setWaypointStatements ["true", "(group this) setVariable ['acex_headless_blacklist', false, true];"];
};

// print a confirmation
Expand Down

0 comments on commit 6da31d4

Please sign in to comment.