mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Remove duplicate bleeding code
This commit is contained in:
parent
ba377dfd3a
commit
71b19b4621
@ -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).
|
||||
|
@ -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);
|
||||
};
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user