diff --git a/addons/medical_damage/functions/fnc_woundsHandlerBase.sqf b/addons/medical_damage/functions/fnc_woundsHandlerBase.sqf index 92effda9bd5..0955e3c693c 100644 --- a/addons/medical_damage/functions/fnc_woundsHandlerBase.sqf +++ b/addons/medical_damage/functions/fnc_woundsHandlerBase.sqf @@ -53,6 +53,13 @@ private _bodyPartVisParams = [_unit, false, false, false, false]; // params arra continue }; + // Check if current body part damage has reached the cap + if (_bodyPartDamage select _bodyPartNToAdd >= EGVAR(medical,partDamageCap)) then { + TRACE_1("damage cap reached for body part",_bodyPart); + continue // Skip further processing for this body part if cap is reached + }; + + // determine how many wounds to create private _nWounds = [_damage, _thresholds, true] call FUNC(interpolatePoints); if (_nWounds < 1) then { diff --git a/addons/medical_damage/initSettings.inc.sqf b/addons/medical_damage/initSettings.inc.sqf index c6d7f49e343..5e3eece1dbd 100644 --- a/addons/medical_damage/initSettings.inc.sqf +++ b/addons/medical_damage/initSettings.inc.sqf @@ -16,6 +16,15 @@ true ] call CBA_fnc_addSetting; +[ + QEGVAR(medical,partDamageCap), + "SLIDER", + [LSTRING(partDamageCap_DisplayName), LSTRING(partDamageCap_Description)], + ELSTRING(medical,Category), + [30, 150, 60, 0], + true +] call CBA_fnc_addSetting; + [ QEGVAR(medical,AIDamageThreshold), "SLIDER", diff --git a/addons/medical_damage/stringtable.xml b/addons/medical_damage/stringtable.xml index cd5ae547805..3ebd54b5010 100644 --- a/addons/medical_damage/stringtable.xml +++ b/addons/medical_damage/stringtable.xml @@ -853,6 +853,12 @@ Порог повреждения конечностей 手足のダメージしきい値 + + Sets the amount of damage a body part can receive before preventing more wounds from occurring. + + + Body Part Damage Cap + Controls whether limb damage is taken into account for sum of trauma calculations. Определяет, учитывается ли повреждение конечностей при расчете совокупности травм.