Run attack profile even if no target

This commit is contained in:
PabstMirror 2016-11-14 20:19:24 -06:00
parent ae0eab3a51
commit 4bb02a320b
4 changed files with 10 additions and 3 deletions

View File

@ -27,6 +27,8 @@ params ["_seekerTargetPos", "_args", "_attackProfileStateParams"];
_args params ["_firedEH"];
_firedEH params ["_shooter","","","","","","_projectile"];
if (_seekerTargetPos isEqualTo [0,0,0]) exitWith {_seekerTargetPos};
if (_attackProfileStateParams isEqualTo []) then {
_attackProfileStateParams set [0, STAGE_LAUNCH];
};

View File

@ -27,6 +27,8 @@ params ["_seekerTargetPos", "_args", "_attackProfileStateParams"];
_args params ["_firedEH"];
_firedEH params ["_shooter","","","","","","_projectile"];
if (_seekerTargetPos isEqualTo [0,0,0]) exitWith {_seekerTargetPos};
if (_attackProfileStateParams isEqualTo []) then {
_attackProfileStateParams set [0, STAGE_LAUNCH];
};

View File

@ -22,6 +22,8 @@ params ["_seekerTargetPos", "_args"];
_args params ["_firedEH"];
_firedEH params ["_shooter","","","","","","_projectile"];
if (_seekerTargetPos isEqualTo [0,0,0]) exitWith {_seekerTargetPos};
private _shooterPos = getPosASL _shooter;
private _projectilePos = getPosASL _projectile;

View File

@ -52,10 +52,11 @@ private _projectilePos = getPosASL _projectile;
// Run seeker function:
private _seekerTargetPos = [[0,0,0], _args, _seekerStateParams, _lastKnownPosState] call FUNC(doSeekerSearch);
// Run attack profile function:
private _profileAdjustedTargetPos = [_seekerTargetPos, _args, _attackProfileStateParams] call FUNC(doAttackProfile);
// If we have no seeker target, then do not change anything
if (!(_seekerTargetPos isEqualTo [0,0,0])) then {
// Run attack profile function:
private _profileAdjustedTargetPos = [_seekerTargetPos, _args, _attackProfileStateParams] call FUNC(doAttackProfile);
if (!(_profileAdjustedTargetPos isEqualTo [0,0,0])) then {
private _targetVector = _projectilePos vectorFromTo _profileAdjustedTargetPos;
private _adjustVector = _targetVector vectorDiff (vectorDir _projectile);