From bcf533292ab336e0b6b6e7ba46c05fb1735f02f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Badano?= Date: Sat, 7 Mar 2015 14:12:00 -0300 Subject: [PATCH] Remove weapon initVelocities for guns with FCS --- addons/fcs/functions/fnc_firedEH.sqf | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/addons/fcs/functions/fnc_firedEH.sqf b/addons/fcs/functions/fnc_firedEH.sqf index 4c553883e2..67c7e1d301 100644 --- a/addons/fcs/functions/fnc_firedEH.sqf +++ b/addons/fcs/functions/fnc_firedEH.sqf @@ -12,7 +12,7 @@ #include "script_component.hpp" -private ["_vehicle", "_weapon", "_ammo", "_magazine", "_projectile"]; +private ["_vehicle", "_weapon", "_ammo", "_magazine", "_projectile","_velocityCorrection"]; _vehicle = _this select 0; _weapon = _this select 1; @@ -43,8 +43,12 @@ _offset = 0; }; } forEach _FCSMagazines; -[_projectile, (_vehicle getVariable format ["%1_%2", QGVAR(Azimuth), _turret]), _offset, 0] call EFUNC(common,changeProjectileDirection); +// Correct velocity for weapons that have initVelocity +// @todo: Take into account negative initVelocities +_velocityCorrection = (vectorMagnitude velocity _projectile) - + getNumber (configFile >> "CfgMagazines" >> _magazine >> "initSpeed"); +[_projectile, (_vehicle getVariable format ["%1_%2", QGVAR(Azimuth), _turret]), _offset, _velocityCorrection] call EFUNC(common,changeProjectileDirection); // Air burst missile // handle locally only