diff --git a/addons/medical/functions/fnc_getTypeOfDamage.sqf b/addons/medical/functions/fnc_getTypeOfDamage.sqf index 4dd517679a..85d1a876ba 100644 --- a/addons/medical/functions/fnc_getTypeOfDamage.sqf +++ b/addons/medical/functions/fnc_getTypeOfDamage.sqf @@ -27,7 +27,6 @@ _typeOfInjury = switch (true) do { case (_typeOfProjectile iskindof "LaserBombCore"): {"Explosive"}; case (_typeOfProjectile iskindof "BombCore"): {"Explosive"}; case (_typeOfProjectile iskindof "Grenade"): {"Grenade"}; - case (_typeOfProjectile == "VehicleCrash"): {"VehicleCrash"}; default {_typeOfProjectile}; }; // TODO replace the capitalization on the switch results instead.. diff --git a/addons/medical/functions/fnc_handleDamage_advancedSetDamage.sqf b/addons/medical/functions/fnc_handleDamage_advancedSetDamage.sqf index f464ef5a94..56264f24b2 100644 --- a/addons/medical/functions/fnc_handleDamage_advancedSetDamage.sqf +++ b/addons/medical/functions/fnc_handleDamage_advancedSetDamage.sqf @@ -13,42 +13,24 @@ #include "script_component.hpp" -private ["_unit", "_bodyStatus", "_headDamage", "_torsoDamage", "_handsDamage", "_legsDamage"]; -_unit = _this select 0; +PARAMS_1(_unit); if (!local _unit) exitwith {}; -_bodyStatus = _unit getvariable [QGVAR(bodyPartStatus),[0,0,0,0,0,0]]; +private ["_bodyStatus", "_headDamage", "_torsoDamage", "_handsDamage", "_legsDamage"]; + // ["head", "body", "hand_l", "hand_r", "leg_l", "leg_r"] -_headDamage = _bodyStatus select 0; -if (_headDamage > 0.95) then { - _unit setHitPointDamage ["hitHead", 0.95]; -} else { - _unit setHitPointDamage ["hitHead", _headDamage]; -}; +_bodyStatus = _unit getVariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0]]; -_torsoDamage = _bodyStatus select 1; -if (_torsoDamage > 0.95) then { - _unit setHitPointDamage ["hitBody", 0.95]; -} else { - _unit setHitPointDamage ["hitBody", _torsoDamage]; -}; +EXPLODE_6_PVT(_bodyStatus,_headDamage,_torsoDamage,_handsDamageR,_handsDamageL,_legsDamageR,_legsDamageL); +_unit setHitPointDamage ["hitHead", _headDamage min 0.95]; +_unit setHitPointDamage ["hitBody", _torsoDamage min 0.95]; +_unit setHitPointDamage ["hitHands", (_handsDamageR + _handsDamageL) min 0.95]; +_unit setHitPointDamage ["hitLegs", (_legsDamageR + _legsDamageL) min 0.95]; -_handsDamage = (_bodyStatus select 2) + (_bodyStatus select 3); -if (_handsDamage > 0.95) then { - _unit setHitPointDamage ["hitHands", 0.95]; -} else { - _unit setHitPointDamage ["hitHands", _handsDamage]; -}; +hintSilent Str(_bodyStatus); -_legsDamage = (_bodyStatus select 4) + (_bodyStatus select 5); -if (_legsDamage > 0.95) then { - _unit setHitPointDamage ["hitLegs", 0.95]; -} else { - _unit setHitPointDamage ["hitLegs", _legsDamage]; -}; - -if ({_x > 0} count _bodyStatus == 0) then { +if (_bodyStatus isEqualTo [0,0,0,0,0,0]) then { _unit setDamage 0; };