hearing: buggy PFH

This commit is contained in:
Nicolás Badano 2015-01-13 23:34:55 -03:00
parent cc7d67a150
commit f082242485

View File

@ -24,27 +24,24 @@ GVAR(newStrength) = GVAR(newStrength) max _strength;
if (missionNamespace getVariable [QGVAR(isEarRingingPlaying), false]) exitWith {}; if (missionNamespace getVariable [QGVAR(isEarRingingPlaying), false]) exitWith {};
_fnc_removeEarRinging = {
GVAR(isEarRingingPlaying) = false;
// Delete this PFH, so it is only executed once
[(_this select 1)] call cba_fnc_removePerFrameHandler;
};
if (_strength > 0.75) exitWith { if (_strength > 0.75) exitWith {
playSound "ACE_EarRinging_Heavy"; playSound "ACE_EarRinging_Heavy";
GVAR(isEarRingingPlaying) = true; GVAR(isEarRingingPlaying) = true;
0 spawn { [_fnc_removeEarRinging, 7.0, [] ] call CBA_fnc_addPerFrameHandler;
sleep 7;
GVAR(isEarRingingPlaying) = false;
};
}; };
if (_strength > 0.5) exitWith { if (_strength > 0.5) exitWith {
playSound "ACE_EarRinging_Medium"; playSound "ACE_EarRinging_Medium";
GVAR(isEarRingingPlaying) = true; GVAR(isEarRingingPlaying) = true;
0 spawn { [_fnc_removeEarRinging, 5.0, [] ] call CBA_fnc_addPerFrameHandler;
sleep 5;
GVAR(isEarRingingPlaying) = false;
};
}; };
if (_strength > 0.2) exitWith { if (_strength > 0.2) exitWith {
playSound "ACE_EarRinging_Weak"; playSound "ACE_EarRinging_Weak";
GVAR(isEarRingingPlaying) = true; GVAR(isEarRingingPlaying) = true;
0 spawn { [_fnc_removeEarRinging, 3.0, [] ] call CBA_fnc_addPerFrameHandler;
sleep 3;
GVAR(isEarRingingPlaying) = false;
};
}; };