diff --git a/addons/hellfire/functions/fnc_attackProfile.sqf b/addons/hellfire/functions/fnc_attackProfile.sqf index afbedb239a..9d03a69d5d 100644 --- a/addons/hellfire/functions/fnc_attackProfile.sqf +++ b/addons/hellfire/functions/fnc_attackProfile.sqf @@ -43,15 +43,17 @@ if (_returnTargetPos isEqualTo [0, 0, 0]) then { }; private _closingRate = vectorMagnitude velocity _projectile; -private _timeToGo = (_projectilePos distance _seekerTargetPos) / _closingRate; +// subtract 500 meters to account for the fact that we don't want to be at the perfect pitch exactly when we cross the target +// 500 seemed good in testing +private _timeToGo = ((_projectilePos distance2d _seekerTargetPos) - 500) / _closingRate; // we could do stuff like desired attack angle, but I'm not going that far today -private _los = vectorNormalized (_seekerTargetPos vectorDiff _projectilePos); +private _los = _projectilePos vectorFromTo _seekerTargetPos; _flightParams params ["_pitchRate", "_yawRate"]; private _angleToTarget = acos ((vectorDir _projectile) vectorCos _los); -private _atMinRotationAngle = _angleToTarget >= (0.5 * _pitchRate * _timeToGo); +private _atMinRotationAngle = _angleToTarget >= (_pitchRate * _timeToGo); switch (_attackStage) do { case STAGE_LAUNCH: { // Gain height quickly to pass terrain mask diff --git a/addons/hellfire/functions/fnc_midCourseTransition.sqf b/addons/hellfire/functions/fnc_midCourseTransition.sqf index 1369e162b0..a24915f00a 100644 --- a/addons/hellfire/functions/fnc_midCourseTransition.sqf +++ b/addons/hellfire/functions/fnc_midCourseTransition.sqf @@ -25,5 +25,5 @@ _seekerParams params ["_seekerAngle", "_seekerAccuracy", "_seekerMaxRange", "_se _targetData params ["_targetDirection", "_attackProfileDirection", "_targetRange", "_targetVelocity", "_targetAcceleration"]; _attackProfileStateParams params ["_state"]; -_state in [STAGE_ATTACK_TERMINAL, STAGE_ATTACK_CRUISE]; +_state isEqualTo STAGE_ATTACK_TERMINAL; diff --git a/addons/hellfire/script_component.hpp b/addons/hellfire/script_component.hpp index 4ab934511b..6d16736a9c 100644 --- a/addons/hellfire/script_component.hpp +++ b/addons/hellfire/script_component.hpp @@ -3,7 +3,7 @@ #include "\z\ace\addons\main\script_mod.hpp" // #define DEBUG_MODE_FULL - #define DISABLE_COMPILE_CACHE +// #define DISABLE_COMPILE_CACHE // #define ENABLE_PERFORMANCE_COUNTERS #ifdef DEBUG_ENABLED_HELLFIRE