Skip to content
Open
Show file tree
Hide file tree
Changes from all 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: 1 addition & 1 deletion addons/laser/functions/fnc_showVehicleHud.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ GVAR(pfID) = [{
private _laserCode = _vehicle getVariable [QGVAR(code), ACE_DEFAULT_LASER_CODE];
private _seekerAngle = getNumber (configFile >> "CfgAmmo" >> _ammo >> "ace_missileguidance" >> "seekerAngle");
private _seekerMaxRange = getNumber (configFile >> "CfgAmmo" >> _ammo >> "ace_missileguidance" >> "seekerMaxRange");
private _laserResult = [_laserSource, vectorDir _vehicle, _seekerAngle, _seekerMaxRange, [ACE_DEFAULT_LASER_WAVELENGTH,ACE_DEFAULT_LASER_WAVELENGTH], _laserCode, _vehicle] call EFUNC(laser,seekerFindLaserSpot);
private _laserResult = [_laserSource, vectorDir _vehicle, _seekerAngle, _seekerMaxRange, [ACE_DEFAULT_LASER_WAVELENGTH,ACE_DEFAULT_LASER_WAVELENGTH], _laserCode, _vehicle] call FUNC(seekerFindLaserSpot);
private _foundTargetPos = _laserResult select 0;
private _haveLock = !isNil "_foundTargetPos";

Expand Down
6 changes: 5 additions & 1 deletion addons/missileguidance/functions/fnc_ahr_onFired.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ _target = missileTarget _projectile;
if (isNull _target && isVehicleRadarOn vehicle _shooter) then {
_target = cursorTarget;
};
private _isRemoteTarget = ((listRemoteTargets side _shooter) findIf {_x#0 == cursorTarget}) != -1;
if (isNull _target && _isRemoteTarget) then {
_target = cursorTarget;
};
if !(_target isKindOf "AllVehicles") then {
_target = nil;
};
Expand Down Expand Up @@ -56,7 +60,7 @@ private _shooterHasActiveRadar = {
false
} forEach listVehicleSensors vehicle _shooter;

if !(isVehicleRadarOn vehicle _shooter) then {
if (!(isVehicleRadarOn vehicle _shooter) && !_isRemoteTarget) then {
_isActive = true;
};

Expand Down
16 changes: 13 additions & 3 deletions addons/missileguidance/functions/fnc_onFired.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,26 @@ TRACE_4("enabled",_shooter,_ammo,_projectile,typeOf _shooter);

private _config = configFile >> "CfgAmmo" >> _ammo >> QUOTE(ADDON);

private _configurationSource = _shooter;
Copy link
Contributor

@PabstMirror PabstMirror Nov 10, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have an example where _configurationSource will be different from _shooter
This even will be triggered from the object that fired the missile
edit: _shooter is arg0, not the newish arg7

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will try to get a vanilla repro this evening, but I was testing with an Apache, where the hellfires are launched by the gunner.
For months until I investigated and made this change, my pilot guys had hellfires never track the laser if the laser wasn't the default code. I enabled tracing and found that the laser was being set on the player object rather than the vehicle.

_currentShooter setVariable [QGVAR(code), _newLaserCode, true];

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this work with

private _vehicleLockMode = _vehicle getVariable [QEGVAR(missileguidance,attackProfile), _defaultAttackProfile];
? I am worried about this breaking something somewhere else unintentionally, I think this was assumed to be the vehicle from the get-go

if (isNull (ACE_controlledUAV param [0, objNull])) then {
if (((vehicle _shooter) == _shooter) || {_shooter call CBA_fnc_canUseWeapon}) then {
_configurationSource = _shooter;
} else {
_configurationSource = vehicle _shooter;
};
} else {
_configurationSource = ACE_controlledUAV select 0;
};

private _target = _shooter getVariable [QGVAR(target), nil];
private _targetPos = _shooter getVariable [QGVAR(targetPosition), nil];
private _seekerType = _shooter getVariable [QGVAR(seekerType), nil];
private _attackProfile = _shooter getVariable [QGVAR(attackProfile), nil];
private _attackProfile = _configurationSource getVariable [QGVAR(attackProfile), nil];
if ((getNumber (configFile >> "CfgAmmo" >> _ammo >> QUOTE(ADDON) >> "useModeForAttackProfile")) == 1) then {
_attackProfile = getText (configFile >> "CfgWeapons" >> _weapon >> _mode >> QGVAR(attackProfile))
};
private _lockMode = _shooter getVariable [QGVAR(lockMode), nil];

private _laserCode = _shooter getVariable [QEGVAR(laser,code), ACE_DEFAULT_LASER_CODE];
private _laserCode = _configurationSource getVariable [QEGVAR(laser,code), ACE_DEFAULT_LASER_CODE];
private _laserInfo = [_laserCode, ACE_DEFAULT_LASER_WAVELENGTH, ACE_DEFAULT_LASER_WAVELENGTH];

TRACE_6("getVars",_target,_targetPos,_seekerType,_attackProfile,_lockMode,_laserCode);
Expand Down