2018-07-30 09:22:14 +00:00
|
|
|
#include "script_component.hpp"
|
2016-10-02 16:35:40 +00:00
|
|
|
/*
|
|
|
|
* Author: Glowbal, commy2
|
|
|
|
* Handle wounds received event.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: unit <OBJECT>
|
|
|
|
* 1: caused by <OBJECT>
|
|
|
|
* 2: damage <NUMBER>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
|
|
|
params ["_unit", "", "_damage", "_shooter"];
|
|
|
|
|
2016-10-31 01:45:02 +00:00
|
|
|
if (GVAR(enabledFor) == 1 && {!isPlayer _unit && {_unit != ACE_player}}) exitWith {};
|
2016-10-02 16:35:40 +00:00
|
|
|
if (vehicle _unit != _unit && {!((vehicle _unit) isKindOf "StaticWeapon")}) exitWith {}; // Don't bleed on ground if mounted
|
|
|
|
|
|
|
|
_damage = _damage min 1;
|
|
|
|
|
|
|
|
if (isNull _shooter) exitWith { // won't be able to calculate the direction properly, so instead we pick something at random
|
|
|
|
[QGVAR(spurt), [_unit, random 360, _damage]] call CBA_fnc_serverEvent;
|
|
|
|
};
|
|
|
|
|
|
|
|
// Calculate bulletDirection
|
|
|
|
private _bulletDir = _shooter getDir _unit;
|
|
|
|
|
|
|
|
[QGVAR(spurt), [_unit, _bulletDir, _damage]] call CBA_fnc_serverEvent;
|