mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Further improved the wound merging logic
This commit is contained in:
parent
c431a7d236
commit
31bc54ff33
@ -79,13 +79,16 @@ private _bodyPartDamage = _unit getVariable [QEGVAR(medical,bodyPartDamage), [0,
|
|||||||
private _createNewWound = true;
|
private _createNewWound = true;
|
||||||
{
|
{
|
||||||
_x params ["", "_classID", "_bodyPartN", "_oldAmountOf", "_oldBleeding", "_oldDamage"];
|
_x params ["", "_classID", "_bodyPartN", "_oldAmountOf", "_oldBleeding", "_oldDamage"];
|
||||||
if (_woundClassIDToAdd == _classID && {_bodyPartNToAdd == _bodyPartN && {(round(_damage * 10) / 10) == (round(_oldDamage * 10) / 10)}}) then {
|
if (_woundClassIDToAdd == _classID && {_bodyPartNToAdd == _bodyPartN && {(_damage < PENETRATION_THRESHOLD) isEqualTo (_oldDamage < PENETRATION_THRESHOLD)}}) then {
|
||||||
private _oldCategory = (floor ((0 max _oldBleeding min 0.1) / 0.05));
|
private _oldCategory = (floor ((0 max _oldBleeding min 0.1) / 0.05));
|
||||||
private _newCategory = (floor ((0 max _bleeding min 0.1) / 0.05));
|
private _newCategory = (floor ((0 max _bleeding min 0.1) / 0.05));
|
||||||
if (_oldCategory == _newCategory) exitWith {
|
if (_oldCategory == _newCategory) exitWith {
|
||||||
private _newBleeding = (_oldAmountOf * _oldBleeding + _bleeding);
|
private _newAmountOf = _oldAmountOf + 1;
|
||||||
private _newAmountOf = _newBleeding / _oldBleeding;
|
|
||||||
_x set [3, _newAmountOf];
|
_x set [3, _newAmountOf];
|
||||||
|
private _newBleeding = (_oldAmountOf * _oldBleeding + _bleeding) / _newAmountOf;
|
||||||
|
_x set [4, _newBleeding];
|
||||||
|
private _newDamage = (_oldAmountOf * _oldDamage + _damage) / _newAmountOf;
|
||||||
|
_x set [5, _newDamage];
|
||||||
_createNewWound = false;
|
_createNewWound = false;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -129,13 +129,16 @@ private _woundsCreated = [];
|
|||||||
private _createNewWound = true;
|
private _createNewWound = true;
|
||||||
{
|
{
|
||||||
_x params ["", "_classID", "_bodyPartN", "_oldAmountOf", "_oldBleeding", "_oldDamage"];
|
_x params ["", "_classID", "_bodyPartN", "_oldAmountOf", "_oldBleeding", "_oldDamage"];
|
||||||
if (_woundClassIDToAdd == _classID && {_bodyPartNToAdd == _bodyPartN && {(round(_damage * 10) / 10) == (round(_oldDamage * 10) / 10)}}) then {
|
if (_woundClassIDToAdd == _classID && {_bodyPartNToAdd == _bodyPartN && {(_damage < PENETRATION_THRESHOLD) isEqualTo (_oldDamage < PENETRATION_THRESHOLD)}}) then {
|
||||||
private _oldCategory = (floor ((0 max _oldBleeding min 0.1) / 0.05));
|
private _oldCategory = (floor ((0 max _oldBleeding min 0.1) / 0.05));
|
||||||
private _newCategory = (floor ((0 max _bleeding min 0.1) / 0.05));
|
private _newCategory = (floor ((0 max _bleeding min 0.1) / 0.05));
|
||||||
if (_oldCategory == _newCategory) exitWith {
|
if (_oldCategory == _newCategory) exitWith {
|
||||||
private _newBleeding = (_oldAmountOf * _oldBleeding + _bleeding);
|
private _newAmountOf = _oldAmountOf + 1;
|
||||||
private _newAmountOf = _newBleeding / _oldBleeding;
|
|
||||||
_x set [3, _newAmountOf];
|
_x set [3, _newAmountOf];
|
||||||
|
private _newBleeding = (_oldAmountOf * _oldBleeding + _bleeding) / _newAmountOf;
|
||||||
|
_x set [4, _newBleeding];
|
||||||
|
private _newDamage = (_oldAmountOf * _oldDamage + _damage) / _newAmountOf;
|
||||||
|
_x set [5, _newDamage];
|
||||||
_createNewWound = false;
|
_createNewWound = false;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user