Skip to content

Commit

Permalink
Medical & Vehicle Damage - Fix end key fix (#10410)
Browse files Browse the repository at this point in the history
Co-authored-by: Grim <[email protected]>
  • Loading branch information
johnb432 and LinkIsGrim authored Oct 13, 2024
1 parent d9d3e95 commit a10d93e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion addons/medical_engine/functions/fnc_handleDamage.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
4 changes: 3 additions & 1 deletion addons/vehicle_damage/functions/fnc_handleDamage.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a10d93e

Please sign in to comment.