From a10d93ebf68758c34a10ee32dc29960e6ce7e50b Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Sun, 13 Oct 2024 16:38:15 +0200 Subject: [PATCH] Medical & Vehicle Damage - Fix end key fix (#10410) Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> --- addons/medical_engine/functions/fnc_handleDamage.sqf | 4 +++- addons/vehicle_damage/functions/fnc_handleDamage.sqf | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/addons/medical_engine/functions/fnc_handleDamage.sqf b/addons/medical_engine/functions/fnc_handleDamage.sqf index 3e976c28990..422daffcc14 100644 --- a/addons/medical_engine/functions/fnc_handleDamage.sqf +++ b/addons/medical_engine/functions/fnc_handleDamage.sqf @@ -33,7 +33,9 @@ if (_structuralDamage) then { if !(isDamageAllowed _unit && {_unit getVariable [QEGVAR(medical,allowDamage), true]}) exitWith {_oldDamage}; // Killing units via End key is an edge case (#10375) -if (_structuralDamage && {_damage == 1 && _ammo == "" && isNull _shooter && isNull _instigator}) exitWith {_damage}; +// This didn't matter pre-Arma 3 2.18 but now this goes through the event handler +// TODO: Structural fire damage >= 1 in a single damage event could still be caught here and we don't want that, but we haven't found a better way to catch this, fire damage should be small most of the time anyway +if (_structuralDamage && {_damage >= 1 && _ammo == "" && isNull _shooter && isNull _instigator}) exitWith {_damage}; private _newDamage = _damage - _oldDamage; diff --git a/addons/vehicle_damage/functions/fnc_handleDamage.sqf b/addons/vehicle_damage/functions/fnc_handleDamage.sqf index 09a2b6f4c2b..6436c4fe7df 100644 --- a/addons/vehicle_damage/functions/fnc_handleDamage.sqf +++ b/addons/vehicle_damage/functions/fnc_handleDamage.sqf @@ -28,7 +28,9 @@ TRACE_9("handleDamage",_vehicle,_selection,_newDamage,_source,_projectile,_hitIn if (!local _vehicle) exitWith {}; // Killing units via End key is an edge case (#10375) -if (_context == 0 && {_newDamage == 1 && _projectile == "" && isNull _source && isNull _instigator}) exitWith {_newDamage}; +// This didn't matter pre-Arma 3 2.18 but now this goes through the event handler +// TODO: Structural fire damage >= 1 in a single damage event could still be caught here and we don't want that, but we haven't found a better way to catch this, fire damage should be small most of the time anyway +if (_context == 0 && {_newDamage >= 1 && _projectile == "" && isNull _source && isNull _instigator}) exitWith {_newDamage}; private _currentDamage = if (_selection != "") then { _vehicle getHitIndex _hitIndex