Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes for HEMTT 1.13.1 #411

Merged
merged 3 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion addons/danger/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ADDON = false;
#include "XEH_PREP.hpp"

// mod check
GVAR(Loaded_WP) = isClass (configfile >> "CfgPatches" >> "lambs_wp");
GVAR(Loaded_WP) = isClass (configFile >> "CfgPatches" >> "lambs_wp");

#include "settings.inc.sqf"

Expand Down
10 changes: 5 additions & 5 deletions addons/danger/XEH_preInitClient.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ private _fnc_toggle_AI = {
GVAR(disableAIPlayerGroup) = false;
{
_x setVariable [QGVAR(disableAI), false]; // added to ensure it triggers -- nkenny
} foreach units player;
} forEach units player;
} else {
(group player) setVariable [QEGVAR(main,groupMemory), []];
GVAR(disableAIPlayerGroup) = true;
{
_x setUnitPosWeak "AUTO";
_x setVariable [QGVAR(disableAI), true];
} foreach units player;
} forEach units player;
};
private _txt = format ["%1 toggled AI %2", side player, ["on", "off"] select (GVAR(disableAIPlayerGroup))];
[["LAMBS Danger.fsm"], [_txt, 1.4], true] call CBA_fnc_notify;
Expand Down Expand Up @@ -68,7 +68,7 @@ private _fnc_suppress_AI = {
}, [_x, _firePos, true], random 1.5
] call CBA_fnc_waitAndExecute;
};
} foreach _units;
} forEach _units;
private _txt = format ["%1 quick suppression (%2 units)", side player, count _units];
[["LAMBS Danger.fsm"], [_txt, 1.4]] call CBA_fnc_notify;
true
Expand All @@ -81,7 +81,7 @@ private _fnc_hide_AI = {
private _units = (units player) select {player distance2D _x < 55 && {!isPlayer _x}};
{
[_x, _pos, 12, _buildings] call EFUNC(main,doHide);
} foreach _units;
} forEach _units;
private _txt = format ["%1 quick hide (%2 units | %3 spots)", side player, count _units, count _buildings];
[["LAMBS Danger.fsm"], [_txt, 1.4]] call CBA_fnc_notify;
true
Expand Down Expand Up @@ -112,7 +112,7 @@ private _fnc_assault_AI = {
} else {
[_x, _enemy] call EFUNC(main,doAssault);
};
} foreach _units;
} forEach _units;
private _txt = format ["%1 quick assault (%2 units | %3 spots)", side player, count _units, count ((group player) getVariable [QEGVAR(main,groupMemory), []])];
[["LAMBS Danger.fsm"], [_txt, 1.4]] call CBA_fnc_notify;
true
Expand Down
2 changes: 1 addition & 1 deletion addons/danger/functions/fnc_brain.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ private _index = -1;
_index = _forEachIndex;
_priority = _priorities select _cause;
};
} foreach _queue;
} forEach _queue;

// select cause
private _causeArray = _queue select _index;
Expand Down
6 changes: 3 additions & 3 deletions addons/danger/functions/fnc_brainEngage.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ if (
&& {RND(getSuppression _unit)}
&& {_type isEqualTo DANGER_CANFIRE}
) exitWith {
private _posASL = ATLtoASL (_unit getHideFrom _target);
if (((ASLtoAGL _posASL) select 2) > 6) then {
_posASL = ASLtoAGL _posASL;
private _posASL = ATLToASL (_unit getHideFrom _target);
if (((ASLToAGL _posASL) select 2) > 6) then {
_posASL = ASLToAGL _posASL;
_posASL set [2, 0.5];
_posASL = AGLToASL _posASL
};
Expand Down
8 changes: 4 additions & 4 deletions addons/danger/functions/fnc_brainVehicle.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ private _index = -1;
_index = _forEachIndex;
_priority = _priorities select _cause;
};
} foreach _queue;
} forEach _queue;

// select cause
private _causeArray = _queue select _index;
Expand All @@ -57,7 +57,7 @@ private _attack = _cause in [DANGER_ENEMYDETECTED, DANGER_ENEMYNEAR, DANGER_HIT,
if (_attack) then {
private _dangerPos = _unit getHideFrom _dangerCausedBy;
if (_dangerPos isEqualTo [0, 0, 0]) exitWith {_attack = false;};
_dangerPos = ASLtoAGL (ATLtoASL _dangerPos);
_dangerPos = ASLToAGL (ATLToASL _dangerPos);
if ((_dangerPos select 2) > 6 || {(_dangerPos select 2) < 2}) then {_dangerPos set [2, 1]};
};

Expand Down Expand Up @@ -178,7 +178,7 @@ if (_armored && {!isNull _dangerCausedBy}) exitWith {
// delayed unload
[
{
params [["_cargo", []], ["_side", EAST], ["_vehicle", objNull]];
params [["_cargo", []], ["_side", east], ["_vehicle", objNull]];
_cargo orderGetIn false;
_cargo allowGetIn false;
if (EGVAR(main,debug_functions)) then {["%1 %2 unloading %3 carried troops", _side, getText (configOf _vehicle >> "displayName"), count _cargo] call EFUNC(main,debugLog);};
Expand Down Expand Up @@ -226,7 +226,7 @@ if (_car) exitWith {
};

// look to danger
if (_attack && {_vehicle knowsAbout _dangerCausedBy > 3}) then {_vehicle doWatch (AGLtoASL _dangerPos);};
if (_attack && {_vehicle knowsAbout _dangerCausedBy > 3}) then {_vehicle doWatch (AGLToASL _dangerPos);};

// suppression
if (_attack && {_slow}) then {
Expand Down
12 changes: 6 additions & 6 deletions addons/danger/functions/fnc_tacticsAssault.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ if ((_target select 2) > 6) then {
_x setUnitPos "AUTO";
_x doFollow leader _x;
_x forceSpeed -1;
} foreach (units _group);
} forEach (units _group);
};
},
[_group, attackEnabled _group, _unit isIRLaserOn (currentWeapon _unit), speedMode _group, formation _group],
Expand All @@ -77,7 +77,7 @@ _buildings = _buildings apply { _x select 1 };
private _housePos = [];
{
_housePos append (_x buildingPos -1);
} foreach _buildings;
} forEach _buildings;

// add building positions to group memory
_group setVariable [QEGVAR(main,groupMemory), _housePos];
Expand All @@ -87,11 +87,11 @@ if (_housePos isEqualTo []) then {_housePos pushBack _target;};

// find vehicles
private _vehicles = [_unit] call EFUNC(main,findReadyVehicles);
private _overwatch = [ASLtoAGL (getPosASL _unit), EGVAR(main,minSuppressionRange) * 2, EGVAR(main,minSuppressionRange), 4, _target] call EFUNC(main,findOverwatch);
private _overwatch = [ASLToAGL (getPosASL _unit), EGVAR(main,minSuppressionRange) * 2, EGVAR(main,minSuppressionRange), 4, _target] call EFUNC(main,findOverwatch);
if (_overwatch isNotEqualTo []) then {
{
private _roads = _overwatch nearRoads 30;
if (_roads isNotEqualTo []) then {_overwatch = ASLtoAGL (getPosASL (selectRandom _roads))};
if (_roads isNotEqualTo []) then {_overwatch = ASLToAGL (getPosASL (selectRandom _roads))};
_x doMove _overwatch;
_x doWatch (selectRandom _housePos);
} forEach _vehicles;
Expand Down Expand Up @@ -129,7 +129,7 @@ _units doWatch objNull;
// check for reload
{
reload _x;
} foreach (_units select {getSuppression _x < 0.7 && {needReload _x > 0.6}});
} forEach (_units select {getSuppression _x < 0.7 && {needReload _x > 0.6}});

// execute function
[{_this call EFUNC(main,doGroupAssault)}, [_cycle, _units + [_unit], _housePos], 2 + random 3] call CBA_fnc_waitAndExecute;
Expand All @@ -139,7 +139,7 @@ if (EGVAR(main,debug_functions)) then {
["%1 TACTICS ASSAULT (%2 with %3 units @ %4m with %5 buildings)", side _unit, name _unit, count _units, round (_unit distance2D _target), count _buildings] call EFUNC(main,debugLog);
private _m = [_unit, "tactics assault", _unit call EFUNC(main,debugMarkerColor), "hd_arrow"] call EFUNC(main,dotMarker);
private _mt = [_target, "", _unit call EFUNC(main,debugMarkerColor), "hd_join"] call EFUNC(main,dotMarker);
{_x setMarkerSizeLocal [0.6, 0.6];} foreach [_m, _mt];
{_x setMarkerSizeLocal [0.6, 0.6];} forEach [_m, _mt];
_m setMarkerDirLocal (_unit getDir _target);
[{{deleteMarker _x;true} count _this;}, [_m, _mt], _delay + 30] call CBA_fnc_waitAndExecute;
};
Expand Down
4 changes: 2 additions & 2 deletions addons/danger/functions/fnc_tacticsAttack.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,14 @@ private _targetVehicle = vehicle _target;
_x doWatch _targetVehicle;
_x doTarget _targetVehicle;
_x doFire _targetVehicle;
} foreach _units;
} forEach _units;

// debug
if (EGVAR(main,debug_functions)) then {
["%1 TACTICS ATTACK (%2 with %3 units @ %4m)", side _unit, name _unit, count _units, round (_unit distance2D _target)] call EFUNC(main,debugLog);
private _m = [_unit, "tactics attack", _unit call EFUNC(main,debugMarkerColor), "hd_arrow"] call EFUNC(main,dotMarker);
private _mt = [_target, "", _unit call EFUNC(main,debugMarkerColor), "hd_destroy"] call EFUNC(main,dotMarker);
{_x setMarkerSizeLocal [0.6, 0.6];} foreach [_m, _mt];
{_x setMarkerSizeLocal [0.6, 0.6];} forEach [_m, _mt];
_m setMarkerDirLocal (_unit getDir _target);
[{{deleteMarker _x;true} count _this;}, [_m, _mt], _delay + 30] call CBA_fnc_waitAndExecute;
};
Expand Down
6 changes: 3 additions & 3 deletions addons/danger/functions/fnc_tacticsContact.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ if (

// get position
private _posASL = _unit getHideFrom _enemy;
if (((ASLtoAGL _posASL) select 2) > 6) then {_posASL set [2, 0.5];};
if (((ASLToAGL _posASL) select 2) > 6) then {_posASL set [2, 0.5];};
_posASL = ATLToASL _posASL;

// execute suppression
Expand All @@ -135,7 +135,7 @@ if (
[_x, _posASL],
8
] call CBA_fnc_waitAndExecute;
} foreach _units;
} forEach _units;

// group variable
_group setVariable [QEGVAR(main,currentTactic), "Contact! (suppress)", EGVAR(main,debug_functions)];
Expand Down Expand Up @@ -184,7 +184,7 @@ if (
_x forceSpeed 3;
_x setVariable [QEGVAR(main,currentTask), "Assault (contact)", EGVAR(main,debug_functions)];

} foreach _units;
} forEach _units;
_units doMove (selectRandom _buildings);

// group variable
Expand Down
8 changes: 4 additions & 4 deletions addons/danger/functions/fnc_tacticsFlank.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ if (_unit distance2D _target < GVAR(cqbRange)) exitWith {
_x setVariable [QGVAR(forceMove), nil];
_x setUnitPos "AUTO";
[_x] allowGetIn true;
} foreach (units _group);
} forEach (units _group);
};
},
[_group, speedMode _unit, formation _unit],
Expand All @@ -81,7 +81,7 @@ if (_overwatch isEqualTo []) then {
_overwatch = _overwatch select {!(surfaceIsWater (_x select 1))};
_overwatch sort true;
_overwatch = _overwatch apply {_x select 1};
if (_overwatch isEqualTo []) then {_overwatch pushBack ([ASLtoAGL (getPosASL _unit), _distance2D, 100, 8, _target] call EFUNC(main,findOverwatch));};
if (_overwatch isEqualTo []) then {_overwatch pushBack ([ASLToAGL (getPosASL _unit), _distance2D, 100, 8, _target] call EFUNC(main,findOverwatch));};
_overwatch = _overwatch select 0;
};

Expand Down Expand Up @@ -111,7 +111,7 @@ _group setFormation "FILE";
{
_x setUnitPos "DOWN";
_x setVariable [QGVAR(forceMove), true];
} foreach (_units select {isNull objectParent _x});
} forEach (_units select {isNull objectParent _x});

// leader smoke ~ deploy concealment to enable movement
if (!GVAR(disableAutonomousSmokeGrenades)) then {[_unit, _overwatch] call EFUNC(main,doSmoke);};
Expand All @@ -124,7 +124,7 @@ if (EGVAR(main,debug_functions)) then {
["%1 TACTICS FLANK (%2 with %3 units and %6 vehicles @ %4m with %5 positions)", side _unit, name _unit, count _units, round (_unit distance2D _overwatch), count _pos, count _vehicles] call EFUNC(main,debugLog);
private _m = [_unit, "tactics flank", _unit call EFUNC(main,debugMarkerColor), "hd_arrow"] call EFUNC(main,dotMarker);
private _mt = [_overwatch, "", _unit call EFUNC(main,debugMarkerColor), "hd_objective"] call EFUNC(main,dotMarker);
{_x setMarkerSizeLocal [0.6, 0.6];} foreach [_m, _mt];
{_x setMarkerSizeLocal [0.6, 0.6];} forEach [_m, _mt];
_m setMarkerDirLocal (_unit getDir _overwatch);
[{{deleteMarker _x;true} count _this;}, [_m, _mt], _delay + 30] call CBA_fnc_waitAndExecute;
};
Expand Down
2 changes: 1 addition & 1 deletion addons/danger/functions/fnc_tacticsGarrison.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ _buildings = _buildings apply { _x select 1 };

// failsafe
if (_buildings isEqualTo []) exitWith {
{_x doFollow leader _x} foreach _units;
{_x doFollow leader _x} forEach _units;
};

// update target ~ better both for debugging and stacking soldiers
Expand Down
2 changes: 1 addition & 1 deletion addons/danger/functions/fnc_tacticsHide.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ _target = _target call CBA_fnc_getPos;
_group setCombatMode _combatMode;
_group enableAttack _enableAttack;
_group setFormation _formation;
{_x doFollow (leader _x)} foreach units _group;
{_x doFollow (leader _x)} forEach units _group;
};
},
[_group, combatMode _group, attackEnabled _group, formation _group],
Expand Down
2 changes: 1 addition & 1 deletion addons/danger/functions/fnc_tacticsReinforce.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ if (_distance > 500) then {

// pack & deploy static weapons
if !(GVAR(disableAIDeployStaticWeapons)) then {
private _intersect = terrainIntersectASL [eyePos _unit, AGLtoASL (_target vectorAdd [0, 0, 10])];
private _intersect = terrainIntersectASL [eyePos _unit, AGLToASL (_target vectorAdd [0, 0, 10])];
if (_distance > 400 || {_intersect}) then {
_units = [leader _group] call EFUNC(main,doGroupStaticPack);
};
Expand Down
2 changes: 1 addition & 1 deletion addons/danger/functions/fnc_tacticsSuppress.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ if (EGVAR(main,debug_functions)) then {
["%1 TACTICS SUPPRESS (%2 with %3 units and %6 vehicles @ %4m with %5 positions for %7 cycles)", side _unit, name _unit, count _units, round (_unit distance2D _target), count _pos, count _vehicles, _cycle] call EFUNC(main,debugLog);
private _m = [_unit, "tactics suppress", _unit call EFUNC(main,debugMarkerColor), "hd_arrow"] call EFUNC(main,dotMarker);
private _mt = [_target, "", _unit call EFUNC(main,debugMarkerColor), "hd_destroy"] call EFUNC(main,dotMarker);
{_x setMarkerSizeLocal [0.6, 0.6];} foreach [_m, _mt];
{_x setMarkerSizeLocal [0.6, 0.6];} forEach [_m, _mt];
_m setMarkerDirLocal (_unit getDir _target);
[{{deleteMarker _x;true} count _this;}, [_m, _mt], _delay + 30] call CBA_fnc_waitAndExecute;
};
Expand Down
4 changes: 2 additions & 2 deletions addons/main/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ GVAR(CalloutCacheNamespace) = call CBA_fnc_createNamespace;
} forEach _controls;
};
uiNamespace setVariable [_x, []];
} foreach [
} forEach [
QGVAR(debug_drawRectCacheGame),
QGVAR(debug_drawRectCacheEGSpectator),
QGVAR(debug_drawRectCacheCurator)
Expand All @@ -41,7 +41,7 @@ GVAR(debug_sideColorLUT) = createHashMap;
private _b = profileNamespace getVariable [format ["map_%1_b", _name], _default select 2];
private _color = [_r, _g, _b] call BIS_fnc_colorRGBToHTML;
GVAR(debug_sideColorLUT) set [_side, _color];
} foreach [
} forEach [
["blufor", west, [0, 0.3, 0.6]],
["opfor", east, [0.5,0,0]],
["independent", independent, [0,0.5,0]],
Expand Down
2 changes: 1 addition & 1 deletion addons/main/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ADDON = false;
GVAR(ChooseDialogSettingsCache) = false call CBA_fnc_createNamespace;

// check for WP module
GVAR(Loaded_WP) = isClass (configfile >> "CfgPatches" >> "lambs_wp");
GVAR(Loaded_WP) = isClass (configFile >> "CfgPatches" >> "lambs_wp");

GVAR(shareHandlers) = [];

Expand Down
4 changes: 2 additions & 2 deletions addons/main/functions/GroupAction/fnc_doGroupAssault.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ if (_units isEqualTo [] || {_pos isEqualTo []}) exitWith {
_x setVariable [QEGVAR(danger,forceMove), nil];
_x doFollow (leader _x);
_x forceSpeed -1;
} foreach _units;
} forEach _units;
false
};

Expand Down Expand Up @@ -58,7 +58,7 @@ private _targetPos = _pos select 0;

// remove positions
_pos = _pos select {[objNull, "VIEW", objNull] checkVisibility [eyePos _unit, (AGLToASL _x) vectorAdd [0, 0, 0.5]] < 0.01};
} foreach _units;
} forEach _units;

// remove positions
_pos = _pos select {(_units select 0) distance _x > 3};
Expand Down
8 changes: 4 additions & 4 deletions addons/main/functions/GroupAction/fnc_doGroupFlank.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ _vehicles = _vehicles select { canFire _x };
_x setVariable [QEGVAR(danger,forceMove), !_suppressed];

// suppress
private _posASL = AGLtoASL (selectRandom _pos);
private _posASL = AGLToASL (selectRandom _pos);
if (
(_forEachIndex % 2) isEqualTo _teamAlpha
&& {!(terrainIntersectASL [eyePos _x, _posASL vectorAdd [0, 0, 3]])}
) then {
[{_this call FUNC(doSuppress)}, [_x, _posASL vectorAdd [0, 0, random 1], true], 1 + random 3] call CBA_fnc_waitAndExecute;
};
} foreach _units;
} forEach _units;

// reset alpha status
_teamAlpha = parseNumber (_teamAlpha isEqualTo 0);
Expand All @@ -52,11 +52,11 @@ if ((_cycle % 2) isEqualTo 0) then {
private _posAGL = selectRandom _pos;
_x doWatch _posAGL;
[_x, _posAGL] call FUNC(doVehicleSuppress);
} foreach _vehicles;
} forEach _vehicles;
} else {
// check for roads
private _roads = _overwatch nearRoads 50;
if (_roads isNotEqualTo []) exitWith {_vehicles doMove (ASLtoAGL (getPosASL (selectRandom _roads)));};
if (_roads isNotEqualTo []) exitWith {_vehicles doMove (ASLToAGL (getPosASL (selectRandom _roads)));};
_vehicles doMove _overwatch;
};

Expand Down
2 changes: 1 addition & 1 deletion addons/main/functions/GroupAction/fnc_doGroupHide.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ if (_units isEqualTo []) exitWith {false};
[[_unit, _pos, nil, _buildings], _action],
1 + random 2
] call CBA_fnc_waitAndExecute;
} foreach _units;
} forEach _units;

// end
true
8 changes: 4 additions & 4 deletions addons/main/functions/GroupAction/fnc_doGroupStaticDeploy.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ private _assistantIndex = _units findIf {

// define assistant
if (_assistantIndex isEqualTo -1) exitWith {
_units pushback _gunner;
_units pushBack _gunner;
_units
};
private _assistant = _units deleteAt _assistantIndex;
Expand Down Expand Up @@ -98,7 +98,7 @@ if (_weaponPos isEqualTo []) then {
_x setVariable [QGVAR(currentTarget), _weaponPos, GVAR(debug_functions)];
_x doMove _weaponPos;
_x setDestination [_weaponPos, "LEADER DIRECT", true];
} foreach [_gunner, _assistant];
} forEach [_gunner, _assistant];

// do it
[
Expand Down Expand Up @@ -145,7 +145,7 @@ if (_weaponPos isEqualTo []) then {
// reset fsm
{
_x setVariable [QEGVAR(danger,forceMove), nil];
} foreach [_gunner, _assistant];
} forEach [_gunner, _assistant];
},
[_gunner, _assistant, _pos, _weaponPos, _EH], 12,
{
Expand All @@ -154,7 +154,7 @@ if (_weaponPos isEqualTo []) then {
{
[_x] doFollow (leader _x);
_x setVariable [QEGVAR(danger,forceMove), nil];
} foreach [_gunner, _assistant];
} forEach [_gunner, _assistant];
_gunner removeEventHandler ["WeaponAssembled", _EH];
}
] call CBA_fnc_waitUntilAndExecute;
Expand Down
Loading
Loading