change respawn button use warning to use ace_killed CBA event
All checks were successful
Generate testing snapshot / Create testing release (push) Successful in 41s

This commit is contained in:
2024-02-19 16:11:42 -08:00
parent 7d10d2622d
commit f3c95322e9

View File

@@ -2,11 +2,12 @@
if ( !hasInterface ) exitWith {};
player addEventHandler["Respawn",
{
params ["_unit", "_corpse"];
private _killer = _corpse getVariable ["ace_medical_causeOfDeath", "#scripted"];
if (_killer == "respawn_button") then {
["ace_killed", {
params ["_unit", "_causeOfDeath", "_killer", "_instigator"];
if (!local _unit) exitWith {};
if (_causeOfDeath == "respawn_button") then {
private _timeWentUnconscious = _corpse getVariable [QGVARMAIN(lastTimeKnockedOut), -1];
private _durationSpentUnconscious = -1;
if (_timeWentUnconscious > -1) then {
@@ -23,8 +24,7 @@ player addEventHandler["Respawn",
] remoteExec [QEFUNC(common,log), 2];
// format["%1 was unconscious then clicked the respawn button", name _unit] remoteExec["systemChat", 0];
};
}
];
}] call CBA_fnc_addEventHandler;
[