diff --git a/addons/patrol/functions/fnc_sm_business.sqf b/addons/patrol/functions/fnc_sm_business.sqf index d01c3aa4..4f6e90d4 100644 --- a/addons/patrol/functions/fnc_sm_business.sqf +++ b/addons/patrol/functions/fnc_sm_business.sqf @@ -15,7 +15,7 @@ private _bus_patrol = [ { _this call FUNC(sm_business_state_patrol_enter) }, { _this call FUNC(sm_business_state_patrol_exit) }, QUOTE(bus_patrol) -] call EFUNC(cba_statemachine,addState);; +] call EFUNC(cba_statemachine,addState); // TRANSITIONS patrol: diff --git a/addons/patrol/functions/fnc_sm_business_state_patrol_enter.sqf b/addons/patrol/functions/fnc_sm_business_state_patrol_enter.sqf index 63c55057..4d6efc53 100644 --- a/addons/patrol/functions/fnc_sm_business_state_patrol_enter.sqf +++ b/addons/patrol/functions/fnc_sm_business_state_patrol_enter.sqf @@ -1,17 +1,14 @@ #include "..\script_component.hpp" -if (_this == leader _this) then { +private _leader = leader _this; + +_this stop false; +_this call EFUNC(activities,forceEmotionSpeed); +_this doFollow _leader; + +if (_this == _leader) then { private _grp = group _this; - (units _grp) doFollow (leader _this); - [_this, _this, 400 - (random 300), [3,6], [0,2,10]] call FUNC(taskPatrol); + _grp setSpeedMode "LIMITED"; - { // TODO why am I doing this, and if yes, why only here and not when entering other states? - _x setSpeedMode "LIMITED"; - _x forceSpeed -1; - _x stop false; // should not be necessary - _x playMoveNow "AmovPercMstpSnonWnonDnon"; - _x enableDynamicSimulation true; - false - } count (units _grp); - _this call EFUNC(activities,forceEmotionSpeed); + [_this, _this, 400 - (random 300), [3,6], [0,2,10]] call FUNC(taskPatrol); };