Skip to content

Commit

Permalink
Fixes some instances of groups shooting into air (#383)
Browse files Browse the repository at this point in the history
* Fixes some instances of groups shooting into air

Fixes Suppress, Flank and Assault group level actions -- where sometimes Units would shoot into air
Fixes units shooting UGL sometimes not partaking in assault.

* Fixes lack of hegiht check in tacticsContact
  • Loading branch information
nk3nny authored May 5, 2024
1 parent adfe03d commit bf6e891
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
5 changes: 4 additions & 1 deletion addons/danger/functions/fnc_tacticsAssault.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ private _unit = leader _group;

// find target
_target = _target call CBA_fnc_getPos;
if ((_target select 2) > 6) then {
_target set [2, 0.5];
};

// reset tactics
[
Expand Down Expand Up @@ -117,7 +120,7 @@ _units doWatch objNull;
} foreach (_units select {getSuppression _x < 0.7 && {needReload _x > 0.6}});

// execute function
[{_this call EFUNC(main,doGroupAssault)}, [_cycle, _units, _housePos], 2 + random 3] call CBA_fnc_waitAndExecute;
[{_this call EFUNC(main,doGroupAssault)}, [_cycle, _units + [_unit], _housePos], 2 + random 3] call CBA_fnc_waitAndExecute;

// debug
if (EGVAR(main,debug_functions)) then {
Expand Down
5 changes: 3 additions & 2 deletions addons/danger/functions/fnc_tacticsContact.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,9 @@ if (
) exitWith {

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

// execute suppression
{
Expand Down
3 changes: 3 additions & 0 deletions addons/danger/functions/fnc_tacticsFlank.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ private _unit = leader _group;

// find target
_target = _target call CBA_fnc_getPos;
if ((_target select 2) > 6) then {
_target set [2, 0.5];
};

// check CQB ~ exit if in close combat other functions will do the work - nkenny
if (_unit distance2D _target < GVAR(cqbRange)) exitWith {
Expand Down
3 changes: 3 additions & 0 deletions addons/danger/functions/fnc_tacticsSuppress.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ private _unit = leader _group;

// find target
_target = _target call CBA_fnc_getPos;
if ((_target select 2) > 6) then {
_target set [2, 0.5];
};

// exit with flank squad leader cannot suppress from here
if !([_unit, (ATLToASL _target) vectorAdd [0, 0, 5]] call EFUNC(main,shouldSuppressPosition)) exitWith {
Expand Down

0 comments on commit bf6e891

Please sign in to comment.