Remove duplicate bleeding code

This commit is contained in:
KoffeinFlummi 2015-04-14 20:40:38 +02:00
parent ba377dfd3a
commit 71b19b4621
2 changed files with 8 additions and 13 deletions

View File

@ -13,7 +13,7 @@
#include "script_component.hpp"
#define BLOODLOSSRATE_BASIC 0.08
#define BLOODLOSSRATE_BASIC 0.2
private ["_totalBloodLoss","_tourniquets","_openWounds", "_value", "_cardiacOutput", "_internalWounds"];
// TODO Only use this calculation if medium or higher, otherwise use vanilla calculations (for basic medical).

View File

@ -28,9 +28,8 @@ if (_syncValues) then {
};
_bloodVolume = (_unit getvariable [QGVAR(bloodVolume), 0]) + ([_unit] call FUNC(getBloodVolumeChange));
if (_bloodVolume <= 0) then {
_bloodVolume = 0;
};
_bloodVolume = _bloodVolume max 0;
_unit setvariable [QGVAR(bloodVolume), _bloodVolume, _syncValues];
// Set variables for synchronizing information across the net
@ -78,15 +77,11 @@ if (GVAR(level) == 1) then {
// bleeding
_blood = _unit getVariable [QGVAR(bloodVolume), 100];
_blood = (_blood - 0.4 * (damage _unit) * _interval) max 0;
if (_blood != (_unit getVariable [QGVAR(bloodVolume), 100])) then {
_unit setVariable [QGVAR(bloodVolume), _blood, _syncValues];
if (_blood <= 35 and !(_unit getVariable ["ACE_isUnconscious", false])) then {
[_unit, true] call FUNC(setUnconscious);
};
if (_blood == 0) then {
[_unit] call FUNC(setDead);
};
if (_blood <= 35 and !(_unit getVariable ["ACE_isUnconscious", false])) then {
[_unit, true] call FUNC(setUnconscious);
};
if (_blood == 0) then {
[_unit] call FUNC(setDead);
};
};