diff --git a/.hemtt/missions/test.Stratis/mission.sqm b/.hemtt/missions/test.Stratis/mission.sqm index 8d3662f..f9c553d 100644 Binary files a/.hemtt/missions/test.Stratis/mission.sqm and b/.hemtt/missions/test.Stratis/mission.sqm differ diff --git a/addons/m119/XEH_postInit.sqf b/addons/m119/XEH_postInit.sqf index 28bf132..bf5f24f 100644 --- a/addons/m119/XEH_postInit.sqf +++ b/addons/m119/XEH_postInit.sqf @@ -36,7 +36,7 @@ GVAR(towingList) = [ ["gm_ge_army_u1300l_container", [0, -2.69, -2.47], -0.18], ["gm_ge_army_kat1_45,1.*", [-0.04, -3.34, -2.37], -0.20], ["gm_ge_army_kat1_454.*", [-0.02, -4.62, -1.84], -0.20], - ["gm_ge_army_fuchsa0.*", [-0.27, -3.42, -2.6], -0.16], + ["gm_ge_army_fuchsa0.*", [-0.27, -3.42, -2.6], -0.16] ]; [QGVAR(detached), { diff --git a/addons/m119/XEH_preInit.sqf b/addons/m119/XEH_preInit.sqf index 265801b..d05a943 100644 --- a/addons/m119/XEH_preInit.sqf +++ b/addons/m119/XEH_preInit.sqf @@ -32,17 +32,23 @@ ADDON = true; } ] call CBA_fnc_addEventHandler; +GVAR(LAST_ROT_RIGHT) = 0; +GVAR(LAST_ROT_LEFT) = 0; [LLSTRING(name), "RotateRight", [LLSTRING(rotright), LLSTRING(rotright_desc)], { if (vehicle player == player) exitWith {}; if (typeOf (vehicle player) != QUOTE(TBD_M119)) exitWith {}; + if (GVAR(LAST_ROT_RIGHT) > time + 0.05) exitWith {}; + GVAR(LAST_ROT_RIGHT) = time; call FUNC(rotateRight); }, {}, -[0x20, [false, false, false]], true, 0.1] call CBA_fnc_addKeybind; +[0x20, [false, false, false]], true] call CBA_fnc_addKeybind; [LLSTRING(name), "RotateLeft", [LLSTRING(rotleft), LLSTRING(rotleft_desc)], { if (vehicle player == player) exitWith {}; if (typeOf (vehicle player) != QUOTE(TBD_M119)) exitWith {}; + if (GVAR(LAST_ROT_LEFT) > time + 0.05) exitWith {}; + GVAR(LAST_ROT_LEFT) = time; call FUNC(rotateLeft); }, {}, -[0x1E, [false, false, false]], true, 0.1] call CBA_fnc_addKeybind; +[0x1E, [false, false, false]], true] call CBA_fnc_addKeybind; diff --git a/addons/m119/functions/fnc_rotateLeft.sqf b/addons/m119/functions/fnc_rotateLeft.sqf index 6857cbe..a961a7b 100644 --- a/addons/m119/functions/fnc_rotateLeft.sqf +++ b/addons/m119/functions/fnc_rotateLeft.sqf @@ -32,11 +32,7 @@ private _arty = vehicle player; // Get the current animation source phase private _currentPhase = _arty animationSourcePhase "howitzer_rotation_source"; // Edit it -_currentPhase = _currentPhase - 4; - -if (_currentPhase < -1440) then { - _currentPhase = 1440; -}; +_currentPhase = _currentPhase - 1; // Set the new animation source phase -_arty animateSource ["howitzer_rotation_source", _currentPhase, 30]; +_arty animateSource ["howitzer_rotation_source", _currentPhase, true]; diff --git a/addons/m119/functions/fnc_rotateRight.sqf b/addons/m119/functions/fnc_rotateRight.sqf index 2838445..de9290e 100644 --- a/addons/m119/functions/fnc_rotateRight.sqf +++ b/addons/m119/functions/fnc_rotateRight.sqf @@ -32,11 +32,7 @@ private _arty = vehicle player; // Get the current animation source phase private _currentPhase = _arty animationSourcePhase "howitzer_rotation_source"; // Edit it -_currentPhase = _currentPhase + 4; - -if (_currentPhase > 1440) then { - _currentPhase = 1440; -}; +_currentPhase = _currentPhase + 1; // Set the new animation source phase -_arty animateSource ["howitzer_rotation_source", _currentPhase, 30]; \ No newline at end of file +_arty animateSource ["howitzer_rotation_source", _currentPhase, true]; diff --git a/addons/m119/tbd_m119/CfgVehicles.hpp b/addons/m119/tbd_m119/CfgVehicles.hpp index 1c0f109..c71524d 100644 --- a/addons/m119/tbd_m119/CfgVehicles.hpp +++ b/addons/m119/tbd_m119/CfgVehicles.hpp @@ -194,7 +194,7 @@ class CfgVehicles { class rest_rotation_source { source = "user"; initPhase = 0; - animPeriod = 0; + animPeriod = 0.05; }; class howitzer_rotation_source { source = "user"; diff --git a/addons/m119/tbd_m119/model.cfg b/addons/m119/tbd_m119/model.cfg index bf0c696..8fb70fb 100644 --- a/addons/m119/tbd_m119/model.cfg +++ b/addons/m119/tbd_m119/model.cfg @@ -83,6 +83,7 @@ class CfgModels { source = "howitzer_rotation_source"; selection = "leftwheel"; axis = "axis_wheels"; + sourceAddress = "loop"; minValue = -1440; maxValue = 1440; angle0 = "rad -2880"; @@ -94,6 +95,7 @@ class CfgModels { source = "howitzer_rotation_source"; selection = "rightwheel"; axis = "axis_wheels"; + sourceAddress = "loop"; minValue = -1440; maxValue = 1440; angle0 = "rad +2880"; @@ -105,10 +107,11 @@ class CfgModels { source = "howitzer_rotation_source"; selection = "dummy_bone"; axis = "axis_howitzer"; + sourceAddress = "loop"; minValue = -1440; maxValue = 1440; - angle0 = "rad -1440"; - angle1 = "rad +1440"; + angle0 = "rad -360"; + angle1 = "rad +360"; }; class rest {