diff --git a/addons/laser/functions/fnc_showVehicleHud.sqf b/addons/laser/functions/fnc_showVehicleHud.sqf index 35120a294d6..cf9d57fb73d 100644 --- a/addons/laser/functions/fnc_showVehicleHud.sqf +++ b/addons/laser/functions/fnc_showVehicleHud.sqf @@ -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"; diff --git a/addons/missileguidance/functions/fnc_ahr_onFired.sqf b/addons/missileguidance/functions/fnc_ahr_onFired.sqf index 0618c046ad4..1c4dca54d03 100644 --- a/addons/missileguidance/functions/fnc_ahr_onFired.sqf +++ b/addons/missileguidance/functions/fnc_ahr_onFired.sqf @@ -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; }; @@ -56,7 +60,7 @@ private _shooterHasActiveRadar = { false } forEach listVehicleSensors vehicle _shooter; -if !(isVehicleRadarOn vehicle _shooter) then { +if (!(isVehicleRadarOn vehicle _shooter) && !_isRemoteTarget) then { _isActive = true; }; diff --git a/addons/missileguidance/functions/fnc_onFired.sqf b/addons/missileguidance/functions/fnc_onFired.sqf index 1d63d120a9a..8eede171848 100644 --- a/addons/missileguidance/functions/fnc_onFired.sqf +++ b/addons/missileguidance/functions/fnc_onFired.sqf @@ -40,16 +40,26 @@ TRACE_4("enabled",_shooter,_ammo,_projectile,typeOf _shooter); private _config = configFile >> "CfgAmmo" >> _ammo >> QUOTE(ADDON); +private _configurationSource = _shooter; +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);