Medical Engine - Fix script error for 0 overall hitpoint armor (#9633)

* Update fnc_getHitpointArmor.sqf

* Update addons/medical_engine/functions/fnc_getHitpointArmor.sqf

Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>

---------

Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>
This commit is contained in:
johnb432 2023-11-10 23:49:09 +01:00 committed by GitHub
parent 9f9507931f
commit 0ae00248c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -44,6 +44,10 @@ if (_rags != _prevRags) then {
_armorScaled = _armorScaled + _itemArmorScaled;
} forEach _gear;
// Armor should be at least 1 to prevent dividing by 0
_armor = _armor max 1;
_armorScaled = _armorScaled max 1;
_unit setVariable [_var, [_rags, _armor, _armorScaled]];
};