From aa21962f8b58e2cf268fc7423e4b10688adf2382 Mon Sep 17 00:00:00 2001 From: ulteq Date: Fri, 1 May 2015 18:55:44 +0200 Subject: [PATCH] Allowed positive weapon initSpeed values --- addons/fcs/functions/fnc_firedEH.sqf | 10 ++-------- addons/fcs/functions/fnc_keyUp.sqf | 6 ++++++ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/addons/fcs/functions/fnc_firedEH.sqf b/addons/fcs/functions/fnc_firedEH.sqf index 43f6d25ef9..31fe38335d 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", "_velocityCorrection", "_sumVelocity"]; +private ["_vehicle", "_weapon", "_ammo", "_magazine", "_projectile", "_sumVelocity"]; _vehicle = _this select 0; _weapon = _this select 1; @@ -43,14 +43,8 @@ _offset = 0; }; } forEach _FCSMagazines; -// Correct velocity for weapons that have initVelocity -_velocityCorrection = if (getNumber(configFile >> "CfgWeapons" >> _weapon >> "initSpeed") > 0) then { - (vectorMagnitude velocity _projectile) - getNumber(configFile >> "CfgMagazines" >> _magazine >> "initSpeed") -} else { - 0 -}; -[_projectile, (_vehicle getVariable format ["%1_%2", QGVAR(Azimuth), _turret]), _offset, -_velocityCorrection] call EFUNC(common,changeProjectileDirection); +[_projectile, (_vehicle getVariable format ["%1_%2", QGVAR(Azimuth), _turret]), _offset, 0] call EFUNC(common,changeProjectileDirection); // Remove the platform velocity if( (vectorMagnitude velocity _vehicle) > 2) then { diff --git a/addons/fcs/functions/fnc_keyUp.sqf b/addons/fcs/functions/fnc_keyUp.sqf index 1bebd6c919..a7bf8defe5 100644 --- a/addons/fcs/functions/fnc_keyUp.sqf +++ b/addons/fcs/functions/fnc_keyUp.sqf @@ -87,6 +87,9 @@ if (time - GVAR(time) > 1 and GVAR(time) != -1 and count _this < 3) then { if (_initSpeedCoef < 0) then { _initSpeed = _initSpeed * -_initSpeedCoef; }; + if (_initSpeedCoef > 0) then { + _initSpeed = _initSpeedCoef; + }; if (_simulationStep != 0) then { private ["_posX", "_velocityX", "_velocityY", "_timeToTarget"]; @@ -171,6 +174,9 @@ _FCSElevation = []; if (_initSpeedCoef < 0) then { _initSpeed = _initSpeed * -_initSpeedCoef; }; + if (_initSpeedCoef > 0) then { + _initSpeed = _initSpeedCoef; + }; }; } forEach _weapons;