From 7ac665018e97a3188ad913e1d41dcc8681a5e04e Mon Sep 17 00:00:00 2001 From: mrschick <58027418+mrschick@users.noreply.github.com> Date: Sun, 10 Sep 2023 16:47:35 +0200 Subject: [PATCH] Re-implement turning work-knob in steps --- addons/sys_rack/fnc_rackChildrenActions.sqf | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/addons/sys_rack/fnc_rackChildrenActions.sqf b/addons/sys_rack/fnc_rackChildrenActions.sqf index f17240622..5b0d694a8 100644 --- a/addons/sys_rack/fnc_rackChildrenActions.sqf +++ b/addons/sys_rack/fnc_rackChildrenActions.sqf @@ -151,13 +151,18 @@ if (_mountedRadio == "") then { // Empty _direction = 1; }; - // After a delay, turn the work knob N times towards the desired position + // After a delay, turn the work knob N times towards the desired position in 0.2s intervals [{ params ["_direction", "_curWorkPos", "_newWorkPos"]; private _i = 0; + private _delay = 0; while {_i < abs (_curWorkPos - _newWorkPos)} do { - [0, _direction] call EFUNC(sys_intercom,vic3ffcsOnWorkKnobPress); + [{ + params ["_direction"]; + [0, _direction] call EFUNC(sys_intercom,vic3ffcsOnWorkKnobPress); + }, [_direction], _delay] call CBA_fnc_waitAndExecute; _i = _i + 1; + _delay = _delay + 0.2; }; }, [_direction, _curWorkPos, _newWorkPos], 0.5] call CBA_fnc_waitAndExecute; },