Grenades - Fix flashbangs causing pain for invulnerable units (#9981)

Disable flashbang pain for invulnerable units
This commit is contained in:
johnb432 2024-04-28 18:07:15 +02:00 committed by GitHub
parent 6e32fc1144
commit 7c4f4cf8f8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -118,7 +118,7 @@ if (hasInterface && {!isNull ACE_player} && {alive ACE_player}) then {
};
// add ace_medical pain effect:
if (["ace_medical"] call EFUNC(common,isModLoaded) && {_strength > 0.1}) then {
if (["ace_medical"] call EFUNC(common,isModLoaded) && {_strength > 0.1} && {isDamageAllowed _unit} && {_unit getVariable [QEGVAR(medical,allowDamage), true]}) then {
[ACE_player, _strength / 2] call EFUNC(medical,adjustPainLevel);
};