Medical Feedback - Stop effects on featureCamera (#8373)

Co-authored-by: Kyle Mckay <5459452+kymckay@users.noreply.github.com>
This commit is contained in:
GhostIsSpooky 2021-10-10 11:24:10 -03:00 committed by GitHub
parent 755c5ea50d
commit 0a203fdde4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 28 additions and 1 deletions

View File

@ -78,6 +78,27 @@ GVAR(bloodTickCounter) = 0;
["unconscious", _status] call EFUNC(common,setDisableUserInputStatus); ["unconscious", _status] call EFUNC(common,setDisableUserInputStatus);
}] call CBA_fnc_addPlayerEventHandler; }] call CBA_fnc_addPlayerEventHandler;
// Update effects for featureCamera (curator, arsenal, etc)
["featureCamera", {
params ["_unit", "_newCamera"];
[true] call FUNC(handleEffects);
private _volume = missionNamespace getVariable [QEGVAR(hearing,unconsciousnessVolume), VOL_UNCONSCIOUS];
if (_newCamera == "") then { // switched back to player view
private _status = IS_UNCONSCIOUS(_unit);
[!_status, _unit] call EFUNC(common,setVolume);
[QUOTE(ADDON), _volume, _status] call EFUNC(common,setHearingCapability);
["unconscious", _status] call EFUNC(common,setDisableUserInputStatus);
} else { // camera view
[true, _unit] call EFUNC(common,setVolume);
[QUOTE(ADDON), 1, false] call EFUNC(common,setHearingCapability);
};
}] call CBA_fnc_addPlayerEventHandler;
// Forced say3D // Forced say3D
[QGVAR(forceSay3D), { [QGVAR(forceSay3D), {
params ["_unit", "_sound", "_distance"]; params ["_unit", "_sound", "_distance"];

View File

@ -15,8 +15,12 @@
* Public: No * Public: No
*/ */
private _heartRate = GET_HEART_RATE(ACE_player); if (EGVAR(common,OldIsCamera)) exitWith {
TRACE_2("Ending heart beat effect - scripted camera",_heartRate,EGVAR(common,OldIsCamera));
GVAR(heartBeatEffectRunning) = false;
};
private _heartRate = GET_HEART_RATE(ACE_player);
if (_heartRate == 0) exitWith { if (_heartRate == 0) exitWith {
TRACE_1("Ending heart beat effect - zero",_heartRate); TRACE_1("Ending heart beat effect - zero",_heartRate);
GVAR(heartBeatEffectRunning) = false; GVAR(heartBeatEffectRunning) = false;

View File

@ -41,6 +41,8 @@ if (_causeOfDeath != "#scripted") then {
_this set [1, _killer]; _this set [1, _killer];
_this set [2, _instigator]; _this set [2, _instigator];
}; };
} else { // in that case, call setDead manually to prevent any issues
[_unit, "#scripted"] call FUNC(setDead);
}; };
TRACE_3("killer info",_killer,_instigator,_causeOfDeath); TRACE_3("killer info",_killer,_instigator,_causeOfDeath);