diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index 7ec022023a..c057b8d440 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -249,7 +249,6 @@ PREP(canGoUnconsciousState); PREP(setWeaponsCorrectUnconscious); PREP(limitMovementSpeed); -PREP(limitSpeed); PREP(setArrestState); PREP(isArrested); PREP(loadPerson_F); diff --git a/addons/common/functions/fnc_limitSpeed.sqf b/addons/common/functions/fnc_limitSpeed.sqf deleted file mode 100644 index 7062d43736..0000000000 --- a/addons/common/functions/fnc_limitSpeed.sqf +++ /dev/null @@ -1,44 +0,0 @@ -/** - * fn_limitSpeed.sqf - * @Descr: Limits the speed of an object - * @Author: Glowbal - * - * @Arguments: [vehicle OBJECT, maxSpeed NUMBER] - * @Return: void - * @PublicAPI: true - */ - -#include "script_component.hpp" - -private ["_vehicle", "_maxSpeed"]; -_vehicle = _this select 0; -_maxSpeed = _this select 1; - -if ((_vehicle getvariable [QGVAR(limitSpeed_f),false])) then { - _vehicle setvariable [QGVAR(limitSpeed_f),nil,true]; -}; - -if (_maxSpeed < 0) exitwith {}; -_vehicle setvariable [QGVAR(limitSpeed_f),true,true]; - -[{ - private["_vehicle","_maxSpeed","_speed","_x","_y","_z", "_diff","_percentage","_newVelocity","_velocity"]; - _vehicle = (_this select 0) select 0; - _maxSpeed = (_this select 0) select 1; - if !(_vehicle getvariable [QGVAR(limitSpeed_f),false]) exitwith { - [(_this select 1)] call cba_fnc_removePerFrameHandler; - }; - - _speed = speed _vehicle; - if (_speed > _maxSpeed) then { - _velocity = velocity _vehicle; - _x = _velocity select 0; - _y = _velocity select 1; - _z = _velocity select 2; - - _diff = _speed - _maxSpeed; - _percentage = (_speed / 100) * _diff; - _newVelocity = [_x - (_x * _percentage), _y - (_y * _percentage), _z - (_z * _percentage)]; - _vehicle setVelocity _newVelocity; - }; -}, 0, [_vehicle,_maxSpeed] ] call CBA_fnc_addPerFrameHandler; diff --git a/addons/common/functions/fnc_resetAllDefaults_f.sqf b/addons/common/functions/fnc_resetAllDefaults_f.sqf index 0b078ad0e8..b43ae1534c 100644 --- a/addons/common/functions/fnc_resetAllDefaults_f.sqf +++ b/addons/common/functions/fnc_resetAllDefaults_f.sqf @@ -20,7 +20,6 @@ if (isPlayer _unit) then { [true] call FUNC(setVolume_f); [false] call FUNC(disableKeyInput_f); [false] call EFUNC(GUI,effectBlackOut); - [player, -1] call FUNC(limitSpeed); if !(isnil QGVAR(DISABLE_USER_INPUT_COLLECTION_F)) then { // clear all disable user input