diff --git a/addons/fastroping/CfgSounds.hpp b/addons/fastroping/CfgSounds.hpp index e6532146fe..1cdf993adc 100644 --- a/addons/fastroping/CfgSounds.hpp +++ b/addons/fastroping/CfgSounds.hpp @@ -1,12 +1,12 @@ class CfgSounds { class ACE_Fastroping_Rope { name = "ACE_Fastroping_Rope"; - sound[] = {PATHTOF(data\sounds\fastroping_rope.ogg), db0, 1.0}; + sound[] = {QUOTE(PATHTOF(data\sounds\fastroping_rope.ogg)), db0, 1.0}; titles[] = {}; }; class ACE_Fastroping_Thud { name = "ACE_Fastroping_Thud"; - sound[] = {PATHTOF(data\sounds\fastroping_thud.ogg), db0, 1.0}; + sound[] = {QUOTE(PATHTOF(data\sounds\fastroping_thud.ogg)), db0, 1.0}; titles[] = {}; }; }; \ No newline at end of file diff --git a/addons/fastroping/functions/fnc_fastRopeLocalPFH.sqf b/addons/fastroping/functions/fnc_fastRopeLocalPFH.sqf index 7279d4838a..1b41404299 100644 --- a/addons/fastroping/functions/fnc_fastRopeLocalPFH.sqf +++ b/addons/fastroping/functions/fnc_fastRopeLocalPFH.sqf @@ -31,12 +31,16 @@ if (animationState _unit != "ACE_FastRoping") exitWith { [_unit, "ACE_FastRoping", 2] call EFUNC(common,doAnimation); }; -[_unit] spawn { - while {!(isNull attachedTo (_this select 0))} do { - playSound "ACE_Fastroping_Rope"; - sleep 1; - }; -}; +[{ + params ["_args", "_idPFH"]; + _args params ["_unit"]; + + if (isNull (attachedTo _unit)) exitWith { + [_idPFH] call CBA_fnc_removePerFrameHandler; + }; + + playSound "ACE_Fastroping_Rope"; +}, 1, [_unit]] call CBA_fnc_addPerFrameHandler; //End of fast rope if (isNull attachedTo _unit) exitWith {