From 677feffcd1f70849b9c38b669efeec3633a4b25e Mon Sep 17 00:00:00 2001 From: "Brandon-PC\\Brandon" Date: Thu, 3 Jan 2019 07:35:32 -0700 Subject: [PATCH] Add Dragon Attack Profile. Change how missileGuidance guidance_pfh works in order to allow for different types of missiles besides continious thrust --- addons/dragon/CfgAmmo.hpp | 32 +++++++++++++++++++ .../functions/fnc_guidancePFH.sqf | 3 +- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/addons/dragon/CfgAmmo.hpp b/addons/dragon/CfgAmmo.hpp index 860962bd12..6e4f43abaa 100644 --- a/addons/dragon/CfgAmmo.hpp +++ b/addons/dragon/CfgAmmo.hpp @@ -57,6 +57,38 @@ class CfgAmmo { simulationStep = 0.005; maxControlRange = 1500; scope = 2; + + class ace_missileguidance { + enabled = 1; + + minDeflection = 0; + maxDeflection = 0; + incDeflection = 0; + + canVanillaLock = 0; + + // Guidance type for munitions + defaultSeekerType = "SACLOS"; + seekerTypes[] = { "SACLOS" }; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + onFired = QEFUNC(hot,onFired); + + seekLastTargetPos = 0; + seekerAngle = 30; + seekerAccuracy = 1; + + seekerMinRange = 75; + seekerMaxRange = 4000; + + correctionDistance = 15; + offsetFromCrosshair[] = { 0, 0, 0 }; + + defaultAttackProfile = "DRAGON"; + attackProfiles[] = {"DRAGON"}; + }; }; class ShellBase; diff --git a/addons/missileguidance/functions/fnc_guidancePFH.sqf b/addons/missileguidance/functions/fnc_guidancePFH.sqf index 8196de8057..e4e01d067f 100644 --- a/addons/missileguidance/functions/fnc_guidancePFH.sqf +++ b/addons/missileguidance/functions/fnc_guidancePFH.sqf @@ -55,7 +55,8 @@ private _seekerTargetPos = [[0,0,0], _args, _seekerStateParams, _lastKnownPosSta private _profileAdjustedTargetPos = [_seekerTargetPos, _args, _attackProfileStateParams] call FUNC(doAttackProfile); // If we have no seeker target, then do not change anything -if (!(_profileAdjustedTargetPos isEqualTo [0,0,0])) then { +// If there is no deflection on the missile, this cannot change and therefore is redundant. Avoid calculations for missiles without any deflection +if ((_minDeflection != 0 || _maxDeflection != 0) && { !(_profileAdjustedTargetPos isEqualTo [0,0,0]) }) then { private _targetVector = _projectilePos vectorFromTo _profileAdjustedTargetPos; private _adjustVector = _targetVector vectorDiff (vectorDir _projectile);