Skip to content
Merged
Show file tree
Hide file tree
Changes from 11 commits
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: 2 additions & 0 deletions addons/missileguidance/functions/fnc_attackProfile_JDAM.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ _gpsData params ["", "_impactAngle", "_attackDirection"];
_targetData params ["_directionToTarget", "", "_distanceToTarget"];
_flightParams params ["_pitchRate", "_yawRate"];

if (_seekerTargetPos isEqualTo [0,0,0]) exitWith {_seekerTargetPos}; // Handle dropping JDAM as dumb ordnance

if (_impactAngle <= 0) then {
_impactAngle = 45; // immediate pitch over to attack
};
Expand Down
14 changes: 13 additions & 1 deletion addons/missileguidance/functions/fnc_gps_getAttackData.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,20 @@
*/

if (GVAR(gps_mode) isEqualTo "too") then {
private _target = getPilotCameraTarget (vehicle ACE_PLAYER);
private _focusOn = focusOn;
private _vehFocusOn = vehicle _focusOn;
private _target = getPilotCameraTarget _vehFocusOn;
_target params ["_tracking", "_position", "_object"];
if (driver _vehFocusOn isNotEqualTo _focusOn) then {
_position = _vehFocusOn lockedCameraTo [focusOn call CBA_fnc_turretPath];
if (_position isEqualType objNull) then { // lockedCameraTo has different return types, can be object as well as position.
_position = getPosASL _position;
} else {
if isNil "_position" then { // lockedCameraTo can return nil if the camera is not locked
_position = [0,0,0];
};
};
};
GVAR(gps_currentSettings) set [0, _position]
};

Expand Down
5 changes: 3 additions & 2 deletions addons/missileguidance/functions/fnc_gps_setupVehicle.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ _vehicle setVariable [QGVAR(gps_actionsAdded), true];
TRACE_2("adding gps action",_player,typeOf _vehicle);

private _condition = {
params ["_target", "_player"]; // _player may be the UAV AI
params ["_target"];

private _turretPath = if (_player == (driver _target)) then {[-1]} else {_player call CBA_fnc_turretPath};
private _operator = if (isNull (ACE_controlledUAV select 0)) then {ACE_player} else {ACE_controlledUAV select 1};
private _turretPath = if (_operator == (driver _target)) then {[-1]} else {_operator call CBA_fnc_turretPath};
private _hasJDAM = (_target weaponsTurret _turretPath) findIf {
private _weapon = _x;
GVAR(gps_weapons) getOrDefaultCall [_weapon, {
Expand Down
Loading