ACE3/addons/hearing/functions/fnc_explosionNear.sqf
Dedmen Miller 81e02a7336 Refactor private ARRAY to private keyword (#5598)
* Everything

* Fixed missing ;

* Fix missing ; and double private

* Fixed cannot isNull on number

* Turn _temparture back to isNil

* Fix error from merge
2017-10-10 09:39:59 -05:00

28 lines
685 B
Plaintext

/*
* 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
*/
#include "script_component.hpp"
params ["_unit", "_damage"];
TRACE_2("explosion near player",_unit,_damage);
private _strength = (0 max _damage) * 30;
if (_strength < 0.01) exitWith {};
// Call inmediately, as it will get pick up later anyway by the update thread
[_strength] call FUNC(earRinging);