2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2019-12-16 22:29:33 +00:00
|
|
|
/*
|
|
|
|
* Author: Dystopian
|
|
|
|
* Ejects crew from destroyed vehicle.
|
|
|
|
* Should be called from HandleDamage EH.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* HandleDamage EH <ARRAY>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
2023-11-08 18:00:05 +00:00
|
|
|
* _this call ace_vehicle_damage_fnc_handleDamageEjectIfDestroyed
|
2019-12-16 22:29:33 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
|
|
|
params ["_vehicle", "", "", "", "_ammo"];
|
|
|
|
|
|
|
|
if (alive _vehicle) exitWith {};
|
|
|
|
|
|
|
|
TRACE_2("ejectIfDestroyed HDEH",typeOf _vehicle,_this);
|
|
|
|
|
|
|
|
if (!IS_EXPLOSIVE_AMMO(_ammo)) then {
|
|
|
|
{
|
|
|
|
if (alive _x) then {
|
|
|
|
moveOut _x;
|
|
|
|
};
|
|
|
|
} forEach crew _vehicle;
|
|
|
|
};
|
|
|
|
|
|
|
|
_vehicle removeEventHandler ["HandleDamage", _thisEventHandler];
|