diff --git a/addons/advanced_throwing/functions/fnc_throw.sqf b/addons/advanced_throwing/functions/fnc_throw.sqf index cf4086229d..038390ee74 100644 --- a/addons/advanced_throwing/functions/fnc_throw.sqf +++ b/addons/advanced_throwing/functions/fnc_throw.sqf @@ -49,10 +49,20 @@ if (!(_unit getVariable [QGVAR(primed), false])) then { _newVelocity = _newVelocity vectorAdd (velocity (vehicle _unit)); }; + // Calculate torque of thrown grenade private _config = configFile >> "CfgAmmo" >> typeOf _activeThrowable; private _torqueDir = getArray (_config >> QGVAR(torqueDirection)); _torqueDir = if (_torqueDir isEqualTypeArray [0,0,0]) then { vectorNormalized _torqueDir } else { [0,0,0] }; private _torqueMag = getNumber (_config >> QGVAR(torqueMagnitude)); + + if (_dropMode) then { + _torqueMag = _torqueMag * THROWSTYLE_DROP_TORQUE_COEF; + } else { + if (_throwType == "high") then { + _torqueMag = _torqueMag * THROWSTYLE_HIGH_TORQUE_COEF; + }; + }; + private _torque = _torqueDir vectorMultiply _torqueMag; // Drop if unit dies during throw process diff --git a/addons/advanced_throwing/script_component.hpp b/addons/advanced_throwing/script_component.hpp index 4beb0ee342..c6ce7dcb84 100644 --- a/addons/advanced_throwing/script_component.hpp +++ b/addons/advanced_throwing/script_component.hpp @@ -23,6 +23,8 @@ #define THROWSTYLE_HIGH_DIR [0, 200, 500] #define THROWSTYLE_HIGH_VEL_COEF 2 #define THROWSTYLE_DROP_VEL 2 +#define THROWSTYLE_HIGH_TORQUE_COEF .6 +#define THROWSTYLE_DROP_TORQUE_COEF .2 #define THROW_TYPE_DEFAULT "normal" #define THROW_SPEED_DEFAULT 18