Skip to content

Commit f8b258b

Browse files
authored
Merge pull request #4 from johnb432/dev
1.0.5.0
2 parents 53e6157 + 0a5f7d1 commit f8b258b

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Changelog for Armor Modifier - ACE 9.2.2025
2+
3+
1.0.5.0
4+
- Added compatibility with ACE 3.19.0
5+
16
# Changelog for Armor Modifier - ACE 8.12.2024
27

38
1.0.4.0

addons/main/functions/fnc_handleDamage.sqf

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
* Public: No
1818
*/
1919

20+
#define INSTAKILL_ALLOWED(unit) (unit isNotEqualTo (unit getVariable ["ace_medical_engine_blockInstaKill", objNull]))
21+
2022
params ["_args", ["_ignoreAllowDamageACE", false]];
2123
_args params ["_unit", "_selection", "_damage", "_shooter", "_ammo", "_hitPointIndex", "_instigator", "_hitpoint", "_directHit", "_context"];
2224

@@ -40,13 +42,21 @@ if !(isDamageAllowed _unit && {_unit getVariable ["ace_medical_allowDamage", tru
4042
// Killing units via End key is an edge case (#10375)
4143
// This didn't matter pre-Arma 3 2.18 but now this goes through the event handler
4244
// 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
45+
// Also triggers for catastrophic vehicle explosions which would kill crew outright, check for blocking
4346
private _newDamage = _damage - _oldDamage;
44-
if (_structuralDamage && {(abs (_newDamage - 1)) < 0.001 && _ammo == "" && isNull _shooter && isNull _instigator}) exitWith {_damage};
47+
if (_structuralDamage && {(abs (_newDamage - 1)) < 0.001 && _ammo == "" && isNull _shooter && isNull _instigator} && {INSTAKILL_ALLOWED(_unit)}) exitWith {_damage};
4548

4649
// _newDamage == 0 happens occasionally for vehiclehit events (see line 80 onwards), just exit early to save some frametime
4750
// context 4 is engine "bleeding". For us, it's just a duplicate event for #structural which we can ignore without any issues
51+
// Leverage this to block insta-kills on the same frame (see above)
4852
if (_context != 2 && {_context == 4 || _newDamage == 0}) exitWith {
4953
TRACE_4("Skipping engine bleeding or zero damage",_ammo,_newDamage,_directHit,_context);
54+
55+
if (INSTAKILL_ALLOWED(_unit)) then {
56+
_unit setVariable ["ace_medical_engine_blockInstaKill", _unit];
57+
[{_this setVariable ["ace_medical_engine_blockInstaKill", nil]}, _unit] call CBA_fnc_execNextFrame;
58+
};
59+
5060
_oldDamage
5161
};
5262

addons/main/script_version.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#define MAJOR 1
22
#define MINOR 0
3-
#define PATCHLVL 4
3+
#define PATCHLVL 5
44
#define BUILD 0

0 commit comments

Comments
 (0)