2016-09-11 18:46:35 +00:00
|
|
|
/*
|
|
|
|
* Author: Glowbal
|
|
|
|
* Handle unit hit eventhandler
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: unit <OBJECT>
|
|
|
|
* 1: caused by <OBJECT>
|
|
|
|
* 2: damage <NUMBER>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
2017-06-08 13:31:51 +00:00
|
|
|
* Example:
|
|
|
|
* [bob, kevin, 5] call ACE_medical_blood_fnc_hit
|
|
|
|
*
|
2016-09-11 18:46:35 +00:00
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
|
|
|
params ["_unit", "_causedBy", "_damage"];
|
|
|
|
|
2016-09-29 15:42:56 +00:00
|
|
|
if (((vehicle _unit) != _unit) && {!((vehicle _unit) isKindOf "StaticWeapon")}) exitWith {}; // Don't bleed on ground if mounted
|
|
|
|
|
2016-09-11 18:46:35 +00:00
|
|
|
if (isNull _causedBy) 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
|
2016-09-29 15:42:56 +00:00
|
|
|
private _bulletDir = _unit getDir _causedBy;
|
2016-09-11 18:46:35 +00:00
|
|
|
|
|
|
|
[QGVAR(spurt), [_unit, _bulletDir, _damage]] call CBA_fnc_serverEvent;
|