diff --git a/addons/medical/functions/fnc_displayPatientInformation.sqf b/addons/medical/functions/fnc_displayPatientInformation.sqf index a501b28927..b5eecbeb8d 100644 --- a/addons/medical/functions/fnc_displayPatientInformation.sqf +++ b/addons/medical/functions/fnc_displayPatientInformation.sqf @@ -61,6 +61,18 @@ if (_show) then { _genericMessages pushback [localize "STR_ACE_MEDICAL_STATUS_PAIN", [1, 1, 1, 1]]; }; + _totalIvVolume = 0; + { + private "_value"; + _value = _target getvariable _x; + if !(isnil "_value") then { + _totalIvVolume = _totalIvVolume + (_target getvariable [_x, 0]); + }; + }foreach GVAR(IVBags); + if (_totalIvVolume >= 1) then { + _genericMessages pushback [format[localize "STR_ACE_MEDICAL_receivingIvVolume", floor _totalIvVolume], [1, 1, 1, 1]]; + }; + _selectionBloodLoss = [0,0,0,0,0,0]; if (GVAR(level) >= 2) then { _openWounds = _target getvariable [QGVAR(openWounds), []]; diff --git a/addons/medical/functions/fnc_getBloodVolumeChange.sqf b/addons/medical/functions/fnc_getBloodVolumeChange.sqf index b031ae4585..f94c5d5b7b 100644 --- a/addons/medical/functions/fnc_getBloodVolumeChange.sqf +++ b/addons/medical/functions/fnc_getBloodVolumeChange.sqf @@ -44,6 +44,12 @@ if (_bloodVolume < 100.0) then { _unit setvariable [_x,_ivVolume]; }; }foreach GVAR(IVBags); +} else { + { + if ((_unit getvariable [_x, 0]) > 0) then { + _unit setvariable [_x, 0]; // lets get rid of exessive IV volume + }; + }foreach GVAR(IVBags); }; _bloodVolumeChange; diff --git a/addons/medical/functions/fnc_handleUnitVitals.sqf b/addons/medical/functions/fnc_handleUnitVitals.sqf index 992ccdc3f2..107480108b 100644 --- a/addons/medical/functions/fnc_handleUnitVitals.sqf +++ b/addons/medical/functions/fnc_handleUnitVitals.sqf @@ -167,4 +167,15 @@ if (GVAR(level) >= 2) then { [_unit] call FUNC(setCardiacArrest); }; }; + + // syncing any remaining values + if (_syncValues) then { + { + private "_value"; + _value = _unit getvariable _x; + if !(isnil "_value") then { + _unit setvariable [_x,(_unit getvariable [_x, 0]), true]; + }; + }foreach GVAR(IVBags); + }; }; diff --git a/addons/medical/functions/fnc_treatmentIVLocal.sqf b/addons/medical/functions/fnc_treatmentIVLocal.sqf index aa7b5dbf17..b0b5ce6a7f 100644 --- a/addons/medical/functions/fnc_treatmentIVLocal.sqf +++ b/addons/medical/functions/fnc_treatmentIVLocal.sqf @@ -19,6 +19,9 @@ private ["_target", "_ivItem", "_config", "_volumeAdded", "_typeOf", "_varName"] _target = _this select 0; _ivItem = _this select 1; +_bloodVolume = _target getvariable [QGVAR(bloodVolume), 100]; +if (_bloodVolume >= 100) exitwith {}; + // Find the proper attributes for the used IV _config = (configFile >> "ACE_Medical_Advanced" >> "Treatment" >> "IV"); _volumeAdded = getNumber (_config >> "volume"); @@ -31,7 +34,7 @@ if (isClass (_config >> _className)) then { }; _varName = format["ACE_Medical_IVVolume_%1",_typeOf]; -_target setvariable [_varName, (_target getvariable [_varName, 0]) + _volumeAdded]; +_target setvariable [_varName, (_target getvariable [_varName, 0]) + _volumeAdded, true]; if !(_varName in GVAR(IVBags)) then { GVAR(IVBags) pushback _varName; diff --git a/addons/medical/stringtable.xml b/addons/medical/stringtable.xml index a23c37c658..0243ab5222 100644 --- a/addons/medical/stringtable.xml +++ b/addons/medical/stringtable.xml @@ -336,6 +336,9 @@ Garot [CAT] Opaska uciskowa [CAT] + + Receiving IV [%1ml] +