From 9dc33c659d46e432fd2cf4f215a45ad2551f581c Mon Sep 17 00:00:00 2001 From: Glowbal Date: Sun, 22 Feb 2015 10:56:46 +0100 Subject: [PATCH] Now takes selections into account --- addons/medical/functions/fnc_handleDamage_wounds.sqf | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/addons/medical/functions/fnc_handleDamage_wounds.sqf b/addons/medical/functions/fnc_handleDamage_wounds.sqf index 54775bbc10..14e58aed42 100644 --- a/addons/medical/functions/fnc_handleDamage_wounds.sqf +++ b/addons/medical/functions/fnc_handleDamage_wounds.sqf @@ -39,15 +39,19 @@ _allPossibleInjuries = []; _pain = _x select 3;*/ _minDamage = _x select 4; if (_damage >= _minDamage) then { - if (_minDamage > _highestPossibleDamage) then { - _highestPossibleSpot = _foreachIndex; - _highestPossibleDamage = _minDamage; + if ("All" in _selections || _selectionName in _selections) then { + if (_minDamage > _highestPossibleDamage) then { + _highestPossibleSpot = _foreachIndex; + _highestPossibleDamage = _minDamage; + }; + _allPossibleInjuries pushback _x; }; - _allPossibleInjuries pushback _x; }; }foreach _allInjuriesForDamageType; +// No possible wounds available for this damage type or damage amount. if (_highestPossibleSpot < 0) exitwith { + // It appears we are dealing with an unknown type of damage. if (count _allInjuriesForDamageType == 0) then {