Fix bandage reopening classname/category lookup

This commit is contained in:
ulteq 2016-12-14 21:17:39 +01:00
parent e817e13cfd
commit 0d0cf38028

View File

@ -21,8 +21,10 @@ params ["_target", "_impact", "_part", "_injuryIndex", "_injury", "_bandage"];
private _classID = _injury select 1;
private _bodyPartN = _injury select 2;
private _className = EGVAR(medical_damage,woundClassNames) select _classID;
private _category = _injury select 6;
private _postfix = ["Minor", "Medium", "Large"] select _category;
private _className = format ["%1%2", EGVAR(medical_damage,woundClassNames) select _classID, _postfix];
// default, just in case..
private _reopeningChance = 0.1;
private _reopeningMinDelay = 120;
@ -62,8 +64,8 @@ TRACE_5("configs",_bandage,_className,_reopeningChance,_reopeningMinDelay,_reope
private _bandagedWounds = _target getVariable [QEGVAR(medical,bandagedWounds), []];
private _exist = false;
{
_x params ["", "_id", "_partN", "_amountOf"];
if (_id == _classID && {_partN == _bodyPartN}) exitWith {
_x params ["", "_id", "_partN", "_amountOf", "_bleeding", "_damage", "_oldCategory"];
if (_id == _classID && {_partN == _bodyPartN && {_oldCategory == _category}}) exitWith {
_x set [3, _amountOf + _impact];
_bandagedWounds set [_forEachIndex, _x];
_exist = true;
@ -97,8 +99,8 @@ if (random 1 <= _reopeningChance) then {
private _bandagedWounds = _target getVariable [QEGVAR(medical,bandagedWounds), []];
private _exist = false;
{
_x params ["", "_id", "_partN", "_amountOf"];
if (_id == _classID && {_partN == _bodyPartN}) exitWith {
_x params ["", "_id", "_partN", "_amountOf", "_bleeding", "_damage", "_oldCategory"];
if (_id == _classID && {_partN == _bodyPartN && {_oldCategory == _category}}) exitWith {
_x set [3, 0 max (_amountOf - _impact)];
_bandagedWounds set [_forEachIndex, _x];
_exist = true;