ACE3/addons/hearing/functions/fnc_explosionNear.sqf
johnb432 dc3753893f
Hearing - Improve and cleanup code (#9933)
Co-authored-by: Jouni Järvinen <rautamiekka@users.noreply.github.com>
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>
2024-05-24 20:05:19 -03:00

27 lines
653 B
Plaintext

#include "..\script_component.hpp"
/*
* Author: KoffeinFlummi, commy2, Ruthberg
* Handles deafness due to explosions going off near the player.
*
* Arguments:
* 0: vehicle - Object the event handler is assigned to (player) <OBJECT>
* 1: damage - Damage inflicted to the object <NUMBER>
*
* Return Value:
* None
*
* Example:
* [clientExplosionEvent] call ace_hearing_fnc_explosionNear
*
* Public: No
*/
params ["_unit", "_damage"];
TRACE_2("explosion near player",_unit,_damage);
private _strength = (0 max _damage) * 30;
// Call inmediately, as it will get pick up later anyway by the update thread
[_strength] call FUNC(earRinging);