mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Hearing - Fix explosions from AI fire (#10204)
This commit is contained in:
parent
3229336018
commit
3728bc4b8b
@ -11,6 +11,23 @@ if (isServer) then {
|
||||
}] call CBA_fnc_addEventHandler;
|
||||
};
|
||||
|
||||
["CBA_settingsInitialized", {
|
||||
TRACE_1("settingInit - common",GVAR(enableCombatDeafness));
|
||||
// Only install event handler if combat deafness is enabled
|
||||
if (!GVAR(enableCombatDeafness)) exitWith {};
|
||||
|
||||
addMissionEventHandler ["ProjectileCreated", {
|
||||
params ["_projectile"];
|
||||
|
||||
if (!local _projectile) exitWith {};
|
||||
|
||||
// Rockets only explode on local clients
|
||||
_projectile addEventHandler ["Explode", {
|
||||
[QGVAR(explosion), _this] call CBA_fnc_globalEvent;
|
||||
}];
|
||||
}];
|
||||
}] call CBA_fnc_addEventHandler;
|
||||
|
||||
if (!hasInterface) exitWith {};
|
||||
|
||||
#include "initKeybinds.inc.sqf"
|
||||
@ -27,7 +44,7 @@ GVAR(volumeAttenuation) = 1;
|
||||
GVAR(lastPlayerVehicle) = objNull;
|
||||
|
||||
["CBA_settingsInitialized", {
|
||||
TRACE_1("settingInit",GVAR(enableCombatDeafness));
|
||||
TRACE_1("settingInit - client",GVAR(enableCombatDeafness));
|
||||
|
||||
// Only run PFEH and install event handlers if combat deafness is enabled
|
||||
if (!GVAR(enableCombatDeafness)) exitWith {};
|
||||
@ -92,17 +109,6 @@ GVAR(lastPlayerVehicle) = objNull;
|
||||
call FUNC(updateHearingProtection);
|
||||
}, true] call CBA_fnc_addPlayerEventHandler;
|
||||
|
||||
addMissionEventHandler ["ProjectileCreated", {
|
||||
params ["_projectile"];
|
||||
|
||||
if (!local _projectile) exitWith {};
|
||||
|
||||
// Rockets only explode on local clients
|
||||
_projectile addEventHandler ["Explode", {
|
||||
[QGVAR(explosion), _this] call CBA_fnc_globalEvent;
|
||||
}];
|
||||
}];
|
||||
|
||||
// Update protection on possible helmet change
|
||||
["loadout", LINKFUNC(updateHearingProtection), false] call CBA_fnc_addPlayerEventHandler;
|
||||
}] call CBA_fnc_addEventHandler;
|
||||
|
Loading…
Reference in New Issue
Block a user