From 6f4b53ed9e55c2f044b7d26647e9324613b3efb3 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Thu, 2 Apr 2015 22:56:23 +0200 Subject: [PATCH] Correct use of medical handleDamage calls --- .../functions/fnc_fireLauncherBackblast.sqf | 7 +++---- .../overpressure/functions/fnc_overpressureDamage.sqf | 11 +++-------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/addons/overpressure/functions/fnc_fireLauncherBackblast.sqf b/addons/overpressure/functions/fnc_fireLauncherBackblast.sqf index d63f3b2359..d5c28cca44 100644 --- a/addons/overpressure/functions/fnc_fireLauncherBackblast.sqf +++ b/addons/overpressure/functions/fnc_fireLauncherBackblast.sqf @@ -53,12 +53,11 @@ if (_distance < _backblastRange) then { _alpha = sqrt (1 - _distance / _backblastRange); _beta = sqrt 0.5; - _damage = 2 * _alpha * _beta * _backblastDamage; + _damage = _alpha * _beta * _backblastDamage; [_damage * 100] call BIS_fnc_bloodEffect; - // TODO: Sort this interaction with medical - if (isClass (configFile >> "CfgPatches" >> "ACE_Medical")) then { - [_firer, "HitBody", ([_firer, "", ((_firer getHitPointDamage "HitBody") + _damage), objNull, objNull] call EFUNC(medical,handleDamage))] call EFUNC(medical,setHitPointDamage); + if (isClass (configFile >> "CfgPatches" >> "ACE_Medical") && {([_firer] call EFUNC(medical,hasMedicalEnabled))}) then { + [_firer, "HitBody", [_firer, "body", ((_firer getHitPointDamage "HitBody") + _damage), _firer, "backblast"] call EFUNC(medical,handleDamage)] call EFUNC(medical,setHitPointDamage); } else { _firer setDamage (damage _firer + _damage); }; diff --git a/addons/overpressure/functions/fnc_overpressureDamage.sqf b/addons/overpressure/functions/fnc_overpressureDamage.sqf index 2fbbcf9aa8..d1280b682f 100644 --- a/addons/overpressure/functions/fnc_overpressureDamage.sqf +++ b/addons/overpressure/functions/fnc_overpressureDamage.sqf @@ -50,18 +50,13 @@ if (!surfaceIsWater _pos) then { _alpha = sqrt (1 - _distance / _overpressureRange); _beta = sqrt (1 - _angle / _overpressureAngle); - _damage = 2 * _alpha * _beta * _overpressureDamage; + _damage = _alpha * _beta * _overpressureDamage; // If the target is the ACE_player if (_x == ACE_player) then {[_damage * 100] call BIS_fnc_bloodEffect}; - // TODO: Sort this interaction with medical - if (isClass (configFile >> "CfgPatches" >> "ACE_Medical")) then { - [_x, "HitBody", ([_x, "", (_x getHitPointDamage "HitBody") + _damage, objNull, objNull] call EFUNC(medical,handleDamage))] call EFUNC(medical,setHitPointDamage); - _x spawn { - sleep 0.5; - [_this, "", 0, objNull, objNull] call EFUNC(medical,handleDamage); - }; + if (isClass (configFile >> "CfgPatches" >> "ACE_Medical") && {([_x] call EFUNC(medical,hasMedicalEnabled))}) then { + [_x, "HitBody", [_x, "body", (_x getHitPointDamage "HitBody") + _damage, _firer, "backblast"] call EFUNC(medical,handleDamage)] call EFUNC(medical,setHitPointDamage); } else { _x setDamage (damage _x + _damage); };