ACE3/addons/vehicle_damage/functions/fnc_detonate.sqf
johnb432 dc56cdbd8b
Vehicle Damage - Fix applying medical damage to non-local and invulnerable units (#9988)
* Make medical damage apply to non-local units

* Update addons/vehicle_damage/functions/fnc_medicalDamage.sqf

Co-authored-by: PabstMirror <pabstmirror@gmail.com>

* Update addons/vehicle_damage/functions/fnc_medicalDamage.sqf

* Update fnc_medicalDamage.sqf

* Specify reason for death

---------

Co-authored-by: PabstMirror <pabstmirror@gmail.com>
2024-05-31 13:15:46 -07:00

33 lines
807 B
Plaintext

#include "..\script_component.hpp"
/*
* Author: tcvm
* Detonates vehicle ammo and heavily wounds all inside.
*
* Arguments:
* 0: The vehicle <OBJECT>
* 1: Person who caused detonation <OBJECT> (default: objNull)
* 2: An array of vehicle ammo in vehicle <ARRAY> (default: [])
*
* Return Value:
* None
*
* Example:
* [tank2] call ace_vehicle_damage_fnc_detonate;
*
* Public: No
*/
params ["_vehicle", ["_injurer", objNull], ["_vehicleAmmo", []]];
if (_vehicleAmmo isEqualTo []) then {
_vehicleAmmo = [_vehicle] call EFUNC(cookoff,getVehicleAmmo);
};
([_vehicle] + _vehicleAmmo) call EFUNC(cookoff,detonateAmmunition);
if ((_vehicleAmmo select 1) > 0) then {
{
[QGVAR(medicalDamage), [_x, _injurer, _injurer], _x] call CBA_fnc_targetEvent;
} forEach (crew _vehicle);
};