Correct use of medical handleDamage calls

This commit is contained in:
Glowbal 2015-04-02 22:56:23 +02:00
parent 6f630d4c03
commit 6f4b53ed9e
2 changed files with 6 additions and 12 deletions

View File

@ -53,12 +53,11 @@ if (_distance < _backblastRange) then {
_alpha = sqrt (1 - _distance / _backblastRange); _alpha = sqrt (1 - _distance / _backblastRange);
_beta = sqrt 0.5; _beta = sqrt 0.5;
_damage = 2 * _alpha * _beta * _backblastDamage; _damage = _alpha * _beta * _backblastDamage;
[_damage * 100] call BIS_fnc_bloodEffect; [_damage * 100] call BIS_fnc_bloodEffect;
// TODO: Sort this interaction with medical if (isClass (configFile >> "CfgPatches" >> "ACE_Medical") && {([_firer] call EFUNC(medical,hasMedicalEnabled))}) then {
if (isClass (configFile >> "CfgPatches" >> "ACE_Medical")) then { [_firer, "HitBody", [_firer, "body", ((_firer getHitPointDamage "HitBody") + _damage), _firer, "backblast"] call EFUNC(medical,handleDamage)] call EFUNC(medical,setHitPointDamage);
[_firer, "HitBody", ([_firer, "", ((_firer getHitPointDamage "HitBody") + _damage), objNull, objNull] call EFUNC(medical,handleDamage))] call EFUNC(medical,setHitPointDamage);
} else { } else {
_firer setDamage (damage _firer + _damage); _firer setDamage (damage _firer + _damage);
}; };

View File

@ -50,18 +50,13 @@ if (!surfaceIsWater _pos) then {
_alpha = sqrt (1 - _distance / _overpressureRange); _alpha = sqrt (1 - _distance / _overpressureRange);
_beta = sqrt (1 - _angle / _overpressureAngle); _beta = sqrt (1 - _angle / _overpressureAngle);
_damage = 2 * _alpha * _beta * _overpressureDamage; _damage = _alpha * _beta * _overpressureDamage;
// If the target is the ACE_player // If the target is the ACE_player
if (_x == ACE_player) then {[_damage * 100] call BIS_fnc_bloodEffect}; if (_x == ACE_player) then {[_damage * 100] call BIS_fnc_bloodEffect};
// TODO: Sort this interaction with medical if (isClass (configFile >> "CfgPatches" >> "ACE_Medical") && {([_x] call EFUNC(medical,hasMedicalEnabled))}) then {
if (isClass (configFile >> "CfgPatches" >> "ACE_Medical")) then { [_x, "HitBody", [_x, "body", (_x getHitPointDamage "HitBody") + _damage, _firer, "backblast"] call EFUNC(medical,handleDamage)] call EFUNC(medical,setHitPointDamage);
[_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);
};
} else { } else {
_x setDamage (damage _x + _damage); _x setDamage (damage _x + _damage);
}; };