Cookoff - Tweaked effects cleanup to add Deleted EH globally and trigger a local cleanup event (#9000)

This commit is contained in:
JonBons 2022-08-20 14:38:06 -07:00 committed by GitHub
parent f846b9ab82
commit 8e06f2ec6b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -20,7 +20,7 @@
private _deletedEH = _vehicle addEventHandler ["Deleted", { private _deletedEH = _vehicle addEventHandler ["Deleted", {
params ["_vehicle"]; params ["_vehicle"];
[QGVAR(cleanupEffects), [_vehicle]] call CBA_fnc_globalEvent; [QGVAR(cleanupEffects), [_vehicle]] call CBA_fnc_localEvent;
}]; }];
_vehicle setVariable [QGVAR(deletedEH), _deletedEH]; _vehicle setVariable [QGVAR(deletedEH), _deletedEH];

View File

@ -30,7 +30,7 @@ TRACE_9("cooking off",_vehicle,_intensity,_instigator,_smokeDelayEnabled,_ammoDe
if (_vehicle getVariable [QGVAR(isCookingOff), false]) exitWith {}; if (_vehicle getVariable [QGVAR(isCookingOff), false]) exitWith {};
_vehicle setVariable [QGVAR(isCookingOff), true, true]; _vehicle setVariable [QGVAR(isCookingOff), true, true];
[QGVAR(addCleanupHandlers), [_vehicle]] call CBA_fnc_serverEvent; [QGVAR(addCleanupHandlers), [_vehicle]] call CBA_fnc_globalEvent;
// limit maximum value of intensity to prevent very long cook-off times // limit maximum value of intensity to prevent very long cook-off times
_intensity = _intensity min _maxIntensity; _intensity = _intensity min _maxIntensity;