diff --git a/addons/medical/dev/watchVariable.sqf b/addons/medical/dev/watchVariable.sqf index 5fc0b1a065..05966d907a 100644 --- a/addons/medical/dev/watchVariable.sqf +++ b/addons/medical/dev/watchVariable.sqf @@ -85,7 +85,7 @@ // Wounds: _return pushBack "------- Wounds: -------"; - private _wounds = _unit getVariable [QEGVAR(medical,openWounds), []]; + private _wounds = GET_OPEN_WOUNDS(_unit); { _x params ["_xClassID", "_xBodyPartN", "_xAmountOf", "_xBleeding", "_xDamage"]; _return pushBack format ["%1: [%2] [x%3] [Bld: %4] [Dmg: %5]", ALL_SELECTIONS select _xBodyPartN, _xClassID, _xAmountOf toFixed 1, _xBleeding toFixed 4, _xDamage toFixed 2]; @@ -93,7 +93,7 @@ // Bandaged Wounds: _return pushBack "------- Bandaged Wounds: -------"; - private _wounds = _unit getVariable [QEGVAR(medical,bandagedWounds), []]; + private _wounds = GET_BANDAGED_WOUNDS(_unit); { _x params ["_xClassID", "_xBodyPartN", "_xAmountOf", "_xBleeding", "_xDamage"]; _return pushBack format ["%1: [%2] [x%3] [Bld: %4] [Dmg: %5]", ALL_SELECTIONS select _xBodyPartN, _xClassID, _xAmountOf toFixed 1, _xBleeding toFixed 4, _xDamage toFixed 2]; @@ -101,7 +101,7 @@ // Stitched Wounds: _return pushBack "------- Stitched Wounds: -------"; - private _wounds = _unit getVariable [QEGVAR(medical,stitchedWounds), []]; + private _wounds = GET_STITCHED_WOUNDS(_unit); { _x params ["_xClassID", "_xBodyPartN", "_xAmountOf", "_xBleeding", "_xDamage"]; _return pushBack format ["%1: [%2] [x%3] [Bld: %4] [Dmg: %5]", ALL_SELECTIONS select _xBodyPartN, _xClassID, _xAmountOf toFixed 1, _xBleeding toFixed 4, _xDamage toFixed 2]; diff --git a/addons/medical_damage/functions/fnc_handleIncapacitation.sqf b/addons/medical_damage/functions/fnc_handleIncapacitation.sqf index 1adaf997b8..1a5b2a313b 100644 --- a/addons/medical_damage/functions/fnc_handleIncapacitation.sqf +++ b/addons/medical_damage/functions/fnc_handleIncapacitation.sqf @@ -28,7 +28,7 @@ _bodyPartDamage params ["_headDamage", "_bodyDamage", "_leftArmDamage", "_rightA if (_bodyPartN == 1 && {_damage < PENETRATION_THRESHOLD}) then { _bodyDamage = _bodyDamage - (_amountOf * _damage); }; -} forEach (_unit getVariable [QEGVAR(medical,openWounds), []]); +} forEach GET_OPEN_WOUNDS(_unit); private _damageThreshold = [ EGVAR(medical,AIDamageThreshold), diff --git a/addons/medical_damage/functions/fnc_woundsHandler.sqf b/addons/medical_damage/functions/fnc_woundsHandler.sqf index 41bc97e609..630f387fa5 100644 --- a/addons/medical_damage/functions/fnc_woundsHandler.sqf +++ b/addons/medical_damage/functions/fnc_woundsHandler.sqf @@ -32,7 +32,7 @@ if (isNil {GVAR(allDamageTypesData) getVariable _typeOfDamage} ) then { }; // Administration for open wounds and ids -private _openWounds = _unit getVariable [QEGVAR(medical,openWounds), []]; +private _openWounds = GET_OPEN_WOUNDS(_unit); private _woundID = _unit getVariable [QEGVAR(medical,lastUniqueWoundID), 1]; // Unique wound ids are not used anywhere: ToDo Remove from openWounds array TRACE_4("extension call",_bodyPart,_damage,_typeOfDamage,_woundID); @@ -128,7 +128,7 @@ private _bodyPartVisParams = [_unit, false, false, false, false]; // params arra }; } forEach _woundsCreated; -_unit setVariable [QEGVAR(medical,openWounds), _openWounds, true]; +_unit setVariable [VAR_OPEN_WOUNDS, _openWounds, true]; _unit setVariable [QEGVAR(medical,bodyPartDamage), _bodyPartDamage, true]; [_unit] call EFUNC(medical_status,updateWoundBloodLoss); @@ -141,4 +141,4 @@ if (_critialDamage || {_painLevel > PAIN_UNCONSCIOUS}) then { [_unit] call FUNC(handleIncapacitation); }; -TRACE_5("exit",_unit,_painLevel,GET_PAIN(_unit),_unit getVariable QEGVAR(medical,openWounds),_woundsCreated); +TRACE_5("exit",_unit,_painLevel,GET_PAIN(_unit),GET_OPEN_WOUNDS(_unit),_woundsCreated); diff --git a/addons/medical_damage/functions/fnc_woundsHandlerSQF.sqf b/addons/medical_damage/functions/fnc_woundsHandlerSQF.sqf index e2fe8c1f5a..d1edaa7ccc 100644 --- a/addons/medical_damage/functions/fnc_woundsHandlerSQF.sqf +++ b/addons/medical_damage/functions/fnc_woundsHandlerSQF.sqf @@ -65,7 +65,7 @@ private _allPossibleInjuries = []; if (_highestPossibleSpot < 0) exitWith { TRACE_2("no wounds possible",_damage,_highestPossibleSpot); }; // Administration for open wounds and ids -private _openWounds = _unit getVariable [QEGVAR(medical,openWounds), []]; +private _openWounds = GET_OPEN_WOUNDS(_unit); private _updateDamageEffects = false; private _painLevel = 0; @@ -187,7 +187,7 @@ if (_updateDamageEffects) then { [_unit] call EFUNC(medical_engine,updateDamageEffects); }; -_unit setVariable [QEGVAR(medical,openWounds), _openWounds, true]; +_unit setVariable [VAR_OPEN_WOUNDS, _openWounds, true]; _unit setVariable [QEGVAR(medical,bodyPartDamage), _bodyPartDamage, true]; [_unit] call EFUNC(medical_status,updateWoundBloodLoss); @@ -200,4 +200,4 @@ if (_critialDamage || {_painLevel > PAIN_UNCONSCIOUS}) then { [_unit] call FUNC(handleIncapacitation); }; -TRACE_4("exit",_unit,_painLevel,GET_PAIN(_unit),_unit getVariable QEGVAR(medical,openWounds)); +TRACE_4("exit",_unit,_painLevel,GET_PAIN(_unit),GET_OPEN_WOUNDS(_unit)); diff --git a/addons/medical_engine/functions/fnc_updateDamageEffects.sqf b/addons/medical_engine/functions/fnc_updateDamageEffects.sqf index 6fa09effcc..9adfc2e855 100644 --- a/addons/medical_engine/functions/fnc_updateDamageEffects.sqf +++ b/addons/medical_engine/functions/fnc_updateDamageEffects.sqf @@ -46,9 +46,9 @@ if (EGVAR(medical,fractures) > 0) then { }; if (!_isLimping && {EGVAR(medical,limping) > 0}) then { - private _woundsToCheck = _unit getVariable [QEGVAR(medical,openWounds), []]; + private _woundsToCheck = GET_OPEN_WOUNDS(_unit); if (EGVAR(medical,limping) == 2) then { - _woundsToCheck = _woundsToCheck + (_unit getVariable [QEGVAR(medical,bandagedWounds), []]); // do not append + _woundsToCheck = _woundsToCheck + GET_BANDAGED_WOUNDS(_unit); // do not append }; { _x params ["_xClassID", "_xBodyPartN", "_xAmountOf", "", "_xDamage"]; diff --git a/addons/medical_engine/script_macros_medical.hpp b/addons/medical_engine/script_macros_medical.hpp index a56e357fe1..cffa87d5cf 100644 --- a/addons/medical_engine/script_macros_medical.hpp +++ b/addons/medical_engine/script_macros_medical.hpp @@ -118,38 +118,44 @@ // - Unit Variables ---------------------------------------------------- // These variables get stored in object space and used across components // Defined here for easy consistency with GETVAR/SETVAR (also a list for reference) -#define VAR_BLOOD_PRESS QEGVAR(medical,bloodPressure) -#define VAR_BLOOD_VOL QEGVAR(medical,bloodVolume) -#define VAR_WOUND_BLEEDING QEGVAR(medical,woundBleeding) -#define VAR_CRDC_ARRST QEGVAR(medical,inCardiacArrest) -#define VAR_HEART_RATE QEGVAR(medical,heartRate) -#define VAR_PAIN QEGVAR(medical,pain) -#define VAR_PAIN_SUPP QEGVAR(medical,painSuppress) -#define VAR_PERIPH_RES QEGVAR(medical,peripheralResistance) -#define VAR_UNCON "ACE_isUnconscious" +#define VAR_BLOOD_PRESS QEGVAR(medical,bloodPressure) +#define VAR_BLOOD_VOL QEGVAR(medical,bloodVolume) +#define VAR_WOUND_BLEEDING QEGVAR(medical,woundBleeding) +#define VAR_CRDC_ARRST QEGVAR(medical,inCardiacArrest) +#define VAR_HEART_RATE QEGVAR(medical,heartRate) +#define VAR_PAIN QEGVAR(medical,pain) +#define VAR_PAIN_SUPP QEGVAR(medical,painSuppress) +#define VAR_PERIPH_RES QEGVAR(medical,peripheralResistance) +#define VAR_UNCON "ACE_isUnconscious" +#define VAR_OPEN_WOUNDS QEGVAR(medical,openWounds) +#define VAR_BANDAGED_WOUNDS QEGVAR(medical,bandagedWounds) +#define VAR_STITCHED_WOUNDS QEGVAR(medical,stitchedWounds) // These variables track gradual adjustments (from medication, etc.) -#define VAR_MEDICATIONS QEGVAR(medical,medications) +#define VAR_MEDICATIONS QEGVAR(medical,medications) // These variables track the current state of status values above -#define VAR_HEMORRHAGE QEGVAR(medical,hemorrhage) -#define VAR_IN_PAIN QEGVAR(medical,inPain) -#define VAR_TOURNIQUET QEGVAR(medical,tourniquets) -#define VAR_FRACTURES QEGVAR(medical,fractures) +#define VAR_HEMORRHAGE QEGVAR(medical,hemorrhage) +#define VAR_IN_PAIN QEGVAR(medical,inPain) +#define VAR_TOURNIQUET QEGVAR(medical,tourniquets) +#define VAR_FRACTURES QEGVAR(medical,fractures) // - Unit Functions --------------------------------------------------- // Retrieval macros for common unit values // Defined for easy consistency and speed -#define GET_BLOOD_VOLUME(unit) (unit getVariable [VAR_BLOOD_VOL,DEFAULT_BLOOD_VOLUME]) -#define GET_WOUND_BLEEDING(unit) (unit getVariable [VAR_WOUND_BLEEDING,0]) -#define GET_HEART_RATE(unit) (unit getVariable [VAR_HEART_RATE,DEFAULT_HEART_RATE]) -#define GET_HEMORRHAGE(unit) (unit getVariable [VAR_HEMORRHAGE,0]) -#define GET_PAIN(unit) (unit getVariable [VAR_PAIN,0]) -#define GET_PAIN_SUPPRESS(unit) (unit getVariable [VAR_PAIN_SUPP,0]) +#define GET_BLOOD_VOLUME(unit) (unit getVariable [VAR_BLOOD_VOL, DEFAULT_BLOOD_VOLUME]) +#define GET_WOUND_BLEEDING(unit) (unit getVariable [VAR_WOUND_BLEEDING, 0]) +#define GET_HEART_RATE(unit) (unit getVariable [VAR_HEART_RATE, DEFAULT_HEART_RATE]) +#define GET_HEMORRHAGE(unit) (unit getVariable [VAR_HEMORRHAGE, 0]) +#define GET_PAIN(unit) (unit getVariable [VAR_PAIN, 0]) +#define GET_PAIN_SUPPRESS(unit) (unit getVariable [VAR_PAIN_SUPP, 0]) #define GET_TOURNIQUETS(unit) (unit getVariable [VAR_TOURNIQUET, DEFAULT_TOURNIQUET_VALUES]) #define GET_FRACTURES(unit) (unit getVariable [VAR_FRACTURES, DEFAULT_FRACTURE_VALUES]) -#define IN_CRDC_ARRST(unit) (unit getVariable [VAR_CRDC_ARRST,false]) +#define IN_CRDC_ARRST(unit) (unit getVariable [VAR_CRDC_ARRST, false]) #define IS_BLEEDING(unit) (GET_WOUND_BLEEDING(unit) > 0) -#define IS_IN_PAIN(unit) (unit getVariable [VAR_IN_PAIN,false]) -#define IS_UNCONSCIOUS(unit) (unit getVariable [VAR_UNCON,false]) +#define IS_IN_PAIN(unit) (unit getVariable [VAR_IN_PAIN, false]) +#define IS_UNCONSCIOUS(unit) (unit getVariable [VAR_UNCON, false]) +#define GET_OPEN_WOUNDS(unit) (unit getVariable [VAR_OPEN_WOUNDS, []]) +#define GET_BANDAGED_WOUNDS(unit) (unit getVariable [VAR_BANDAGED_WOUNDS, []]) +#define GET_STITCHED_WOUNDS(unit) (unit getVariable [VAR_STITCHED_WOUNDS, []]) // The following function calls are defined here just for consistency #define GET_BLOOD_LOSS(unit) ([unit] call EFUNC(medical_status,getBloodLoss)) diff --git a/addons/medical_gui/functions/fnc_modifyAction.sqf b/addons/medical_gui/functions/fnc_modifyAction.sqf index 7c197cc102..422c73a475 100644 --- a/addons/medical_gui/functions/fnc_modifyAction.sqf +++ b/addons/medical_gui/functions/fnc_modifyAction.sqf @@ -30,7 +30,7 @@ private _bloodLossOnBodyPart = 0; if (_bodyPartN == _partIndex) then { _bloodLossOnBodyPart = _bloodLossOnBodyPart + (_amountOf * _bleeding); }; -} forEach (_target getvariable [QEGVAR(medical,openWounds), []]); +} forEach GET_OPEN_WOUNDS(_target); private _frBL = 0 max (_bloodLossOnBodyPart / BLOOD_LOSS_RED_THRESHOLD) min 1; private _colorInt = ceil (_frBL * (BLOOD_LOSS_TOTAL_COLORS - 1)); // ceil because any bleeding more than zero shouldn't be white diff --git a/addons/medical_gui/functions/fnc_updateBodyImage.sqf b/addons/medical_gui/functions/fnc_updateBodyImage.sqf index 7f08e9bddf..3841f58d2e 100644 --- a/addons/medical_gui/functions/fnc_updateBodyImage.sqf +++ b/addons/medical_gui/functions/fnc_updateBodyImage.sqf @@ -27,7 +27,7 @@ private _bodyPartBloodLoss = [0, 0, 0, 0, 0, 0]; { _x params ["", "_bodyPartN", "_amountOf", "_bleeding"]; _bodyPartBloodLoss set [_bodyPartN, (_bodyPartBloodLoss select _bodyPartN) + (_bleeding * _amountOf)]; -} forEach (_target getVariable [QEGVAR(medical,openWounds), []]); +} forEach GET_OPEN_WOUNDS(_target); { _x params ["_bodyPartIDC", ["_tourniquetIDC", -1], ["_fractureIDC", -1]]; diff --git a/addons/medical_gui/functions/fnc_updateInjuryList.sqf b/addons/medical_gui/functions/fnc_updateInjuryList.sqf index 736be6eba1..2770dc04ea 100644 --- a/addons/medical_gui/functions/fnc_updateInjuryList.sqf +++ b/addons/medical_gui/functions/fnc_updateInjuryList.sqf @@ -128,21 +128,21 @@ private _fnc_getWoundDescription = { }; }; }; -} forEach (_target getVariable [QEGVAR(medical,openWounds), []]); +} forEach GET_OPEN_WOUNDS(_target); { _x params ["_woundClassID", "_bodyPartN", "_amountOf"]; if (_selectionN == _bodyPartN && {_amountOf > 0}) then { _woundEntries pushBack [format ["[B] %1", call _fnc_getWoundDescription], [0.88, 0.7, 0.65, 1]]; }; -} forEach (_target getVariable [QEGVAR(medical,bandagedWounds), []]); +} forEach GET_BANDAGED_WOUNDS(_target); { _x params ["_woundClassID", "_bodyPartN", "_amountOf"]; if (_selectionN == _bodyPartN && {_amountOf > 0}) then { _woundEntries pushBack [format ["[S] %1", call _fnc_getWoundDescription], [0.7, 0.7, 0.7, 1]]; }; -} forEach (_target getVariable [QEGVAR(medical,stitchedWounds), []]); +} forEach GET_STITCHED_WOUNDS(_target); // Handle no wound entries if (_woundEntries isEqualTo []) then { diff --git a/addons/medical_status/functions/fnc_initUnit.sqf b/addons/medical_status/functions/fnc_initUnit.sqf index 0dcf1ee7b4..4700d78393 100644 --- a/addons/medical_status/functions/fnc_initUnit.sqf +++ b/addons/medical_status/functions/fnc_initUnit.sqf @@ -46,9 +46,9 @@ if (_isRespawn) then { _unit setVariable [VAR_PAIN_SUPP, 0, true]; // - Wounds ------------------------------------------------------------------- - _unit setVariable [QEGVAR(medical,openWounds), [], true]; - _unit setVariable [QEGVAR(medical,bandagedWounds), [], true]; - _unit setVariable [QEGVAR(medical,stitchedWounds), [], true]; + _unit setVariable [VAR_OPEN_WOUNDS, [], true]; + _unit setVariable [VAR_BANDAGED_WOUNDS, [], true]; + _unit setVariable [VAR_STITCHED_WOUNDS, [], true]; _unit setVariable [QEGVAR(medical,isLimping), false, true]; _unit setVariable [VAR_FRACTURES, DEFAULT_FRACTURE_VALUES, true]; @@ -57,20 +57,20 @@ if (_isRespawn) then { // - Treatments --------------------------------------------------------------- _unit setVariable [VAR_TOURNIQUET, DEFAULT_TOURNIQUET_VALUES, true]; - _unit setVariable [QEGVAR(medical,occludedMedications), nil, true]; //Delayed Medications (from tourniquets) + _unit setVariable [QEGVAR(medical,occludedMedications), nil, true]; // Delayed Medications (from tourniquets) _unit setVariable [QEGVAR(medical,ivBags), nil, true]; - // - Update wound bleeding + // Update wound bleeding [_unit] call EFUNC(medical_status,updateWoundBloodLoss); - // triage card and logs + // Triage card and logs _unit setVariable [QEGVAR(medical,triageLevel), 0, true]; _unit setVariable [QEGVAR(medical,triageCard), [], true]; - // damage storage + // Damage storage _unit setVariable [QEGVAR(medical,bodyPartDamage), [0,0,0,0,0,0], true]; - // medication + // Medication _unit setVariable [VAR_MEDICATIONS, [], true]; // Unconscious spontanious wake up chance diff --git a/addons/medical_status/functions/fnc_updateWoundBloodLoss.sqf b/addons/medical_status/functions/fnc_updateWoundBloodLoss.sqf index e2953f861d..fe38aabadc 100644 --- a/addons/medical_status/functions/fnc_updateWoundBloodLoss.sqf +++ b/addons/medical_status/functions/fnc_updateWoundBloodLoss.sqf @@ -25,7 +25,7 @@ private _bodyPartBleeding = [0,0,0,0,0,0]; if (_tourniquets select _bodyPart == 0) then { _bodyPartBleeding set [_bodyPart, (_bodyPartBleeding select _bodyPart) + (_amountOf * _bleeeding)]; }; -} forEach (_unit getVariable [QEGVAR(medical,openWounds), []]); +} forEach GET_OPEN_WOUNDS(_unit); if (_bodyPartBleeding isEqualTo [0,0,0,0,0,0]) then { TRACE_1("updateWoundBloodLoss-none",_unit); diff --git a/addons/medical_treatment/functions/fnc_bandageLocal.sqf b/addons/medical_treatment/functions/fnc_bandageLocal.sqf index a27eaa511c..f001d2f0c1 100644 --- a/addons/medical_treatment/functions/fnc_bandageLocal.sqf +++ b/addons/medical_treatment/functions/fnc_bandageLocal.sqf @@ -22,7 +22,7 @@ params ["_patient", "_bodyPart", "_bandage"]; private _partIndex = ALL_BODY_PARTS find toLower _bodyPart; if (_partIndex < 0) exitWith {false}; -private _openWounds = _patient getVariable [QEGVAR(medical,openWounds), []]; +private _openWounds = GET_OPEN_WOUNDS(_patient); if (_openWounds isEqualTo []) exitWith {false}; // Figure out which injury for this bodypart is the best choice to bandage @@ -40,7 +40,7 @@ _amountOf = _amountOf - _impact; _wound set [2, _amountOf]; _openWounds set [_woundIndex, _wound]; -_patient setVariable [QEGVAR(medical,openWounds), _openWounds, true]; +_patient setVariable [VAR_OPEN_WOUNDS, _openWounds, true]; [_patient] call EFUNC(medical_status,updateWoundBloodLoss); diff --git a/addons/medical_treatment/functions/fnc_canBandage.sqf b/addons/medical_treatment/functions/fnc_canBandage.sqf index a67dbb7873..f60836f38c 100644 --- a/addons/medical_treatment/functions/fnc_canBandage.sqf +++ b/addons/medical_treatment/functions/fnc_canBandage.sqf @@ -34,6 +34,6 @@ private _canBandage = false; if (_bodyPartN == _index && {_amountOf * _bleeding > 0}) exitWith { _canBandage = true; }; -} forEach (_patient getVariable [QEGVAR(medical,openWounds), []]); +} forEach GET_OPEN_WOUNDS(_patient); _canBandage diff --git a/addons/medical_treatment/functions/fnc_canStitch.sqf b/addons/medical_treatment/functions/fnc_canStitch.sqf index 738823114f..6d1ab36465 100644 --- a/addons/medical_treatment/functions/fnc_canStitch.sqf +++ b/addons/medical_treatment/functions/fnc_canStitch.sqf @@ -18,4 +18,4 @@ params ["", "_patient"]; -!((_patient getVariable [QEGVAR(medical,bandagedWounds), []]) isEqualTo []) +!(GET_BANDAGED_WOUNDS(_patient) isEqualTo []) diff --git a/addons/medical_treatment/functions/fnc_createLitter.sqf b/addons/medical_treatment/functions/fnc_createLitter.sqf index 587648de49..5aa2a5bed1 100644 --- a/addons/medical_treatment/functions/fnc_createLitter.sqf +++ b/addons/medical_treatment/functions/fnc_createLitter.sqf @@ -28,7 +28,7 @@ if (vehicle _medic != _medic || {vehicle _patient != _patient}) exitWith {}; // Determine if treated body part is bleeding private _index = ALL_BODY_PARTS find toLower _bodyPart; -private _isBleeding = (_patient getVariable [QEGVAR(medical,openWounds), []]) findIf { +private _isBleeding = GET_OPEN_WOUNDS(_patient) findIf { _x params ["", "_bodyPartN", "_amountOf", "_bleeding"]; _bodyPartN == _index && {_amountOf * _bleeding > 0} diff --git a/addons/medical_treatment/functions/fnc_findMostEffectiveWound.sqf b/addons/medical_treatment/functions/fnc_findMostEffectiveWound.sqf index d1a451e3af..7bdff17b4f 100644 --- a/addons/medical_treatment/functions/fnc_findMostEffectiveWound.sqf +++ b/addons/medical_treatment/functions/fnc_findMostEffectiveWound.sqf @@ -29,7 +29,7 @@ if (isClass (_config >> _bandage)) then { }; // Iterate over open wounds to find the most effective target -private _openWounds = _patient getVariable [QEGVAR(medical,openWounds), []]; +private _openWounds = GET_OPEN_WOUNDS(_patient); if (_openWounds isEqualTo []) exitWith { [EMPTY_WOUND, -1, -1] }; private _wound = EMPTY_WOUND; diff --git a/addons/medical_treatment/functions/fnc_fullHealLocal.sqf b/addons/medical_treatment/functions/fnc_fullHealLocal.sqf index d8b53d2718..e1ccc6fddd 100644 --- a/addons/medical_treatment/functions/fnc_fullHealLocal.sqf +++ b/addons/medical_treatment/functions/fnc_fullHealLocal.sqf @@ -35,9 +35,9 @@ _patient setVariable [VAR_TOURNIQUET, DEFAULT_TOURNIQUET_VALUES, true]; _patient setVariable [QGVAR(occludedMedications), nil, true]; // Wounds and Injuries -_patient setVariable [QEGVAR(medical,openWounds), [], true]; -_patient setVariable [QEGVAR(medical,bandagedWounds), [], true]; -_patient setVariable [QEGVAR(medical,stitchedWounds), [], true]; +_patient setVariable [VAR_OPEN_WOUNDS, [], true]; +_patient setVariable [VAR_BANDAGED_WOUNDS, [], true]; +_patient setVariable [VAR_STITCHED_WOUNDS, [], true]; _patient setVariable [QEGVAR(medical,isLimping), false, true]; _patient setVariable [VAR_FRACTURES, DEFAULT_FRACTURE_VALUES, true]; diff --git a/addons/medical_treatment/functions/fnc_getStitchTime.sqf b/addons/medical_treatment/functions/fnc_getStitchTime.sqf index 63e970301b..81bf948ab2 100644 --- a/addons/medical_treatment/functions/fnc_getStitchTime.sqf +++ b/addons/medical_treatment/functions/fnc_getStitchTime.sqf @@ -20,4 +20,4 @@ params ["", "_patient"]; -count (_patient getVariable [QEGVAR(medical,bandagedWounds), []]) * TIME_PER_WOUND +count GET_BANDAGED_WOUNDS(_patient) * TIME_PER_WOUND diff --git a/addons/medical_treatment/functions/fnc_handleBandageOpening.sqf b/addons/medical_treatment/functions/fnc_handleBandageOpening.sqf index 2c8b46b76e..f2966d5f9c 100644 --- a/addons/medical_treatment/functions/fnc_handleBandageOpening.sqf +++ b/addons/medical_treatment/functions/fnc_handleBandageOpening.sqf @@ -58,7 +58,7 @@ if (isClass (_config >> _className)) then { }; TRACE_5("configs",_bandage,_className,_reopeningChance,_reopeningMinDelay,_reopeningMaxDelay); -private _bandagedWounds = _target getVariable [QEGVAR(medical,bandagedWounds), []]; +private _bandagedWounds = GET_BANDAGED_WOUNDS(_target); private _exist = false; { _x params ["_id", "_partN", "_amountOf"]; @@ -76,7 +76,7 @@ if (!_exist) then { _bandagedWounds pushBack _bandagedInjury; }; -_target setVariable [QEGVAR(medical,bandagedWounds), _bandagedWounds, true]; +_target setVariable [VAR_BANDAGED_WOUNDS, _bandagedWounds, true]; // _reopeningChance = 1; // _reopeningMinDelay = 5; @@ -91,7 +91,7 @@ if (random 1 <= _reopeningChance) then { params ["_target", "_impact", "_part", "_injuryIndex", "_injury"]; TRACE_5("reopen delay finished",_target,_impact,_part,_injuryIndex,_injury); - private _openWounds = _target getVariable [QEGVAR(medical,openWounds), []]; + private _openWounds = GET_OPEN_WOUNDS(_target); if (count _openWounds - 1 < _injuryIndex) exitWith { TRACE_2("index bounds",_injuryIndex,count _openWounds); }; _injury params ["_classID", "_bodyPartN"]; @@ -99,7 +99,7 @@ if (random 1 <= _reopeningChance) then { private _selectedInjury = _openWounds select _injuryIndex; _selectedInjury params ["_selClassID", "_selBodyPart", "_selAmmount"]; if ((_selClassID == _classID) && {_selBodyPart == _bodyPartN}) then { // matching the IDs - private _bandagedWounds = _target getVariable [QEGVAR(medical,bandagedWounds), []]; + private _bandagedWounds = GET_BANDAGED_WOUNDS(_target); private _exist = false; { _x params ["_id", "_partN", "_amountOf"]; @@ -113,8 +113,8 @@ if (random 1 <= _reopeningChance) then { if (_exist) then { TRACE_2("Reopening Wound",_bandagedWounds,_openWounds); _selectedInjury set [2, _selAmmount + _impact]; - _target setVariable [QEGVAR(medical,bandagedWounds), _bandagedWounds, true]; - _target setVariable [QEGVAR(medical,openWounds), _openWounds, true]; + _target setVariable [VAR_BANDAGED_WOUNDS, _bandagedWounds, true]; + _target setVariable [VAR_OPEN_WOUNDS, _openWounds, true]; [_target] call EFUNC(medical_status,updateWoundBloodLoss); diff --git a/addons/medical_treatment/functions/fnc_surgicalKitProgress.sqf b/addons/medical_treatment/functions/fnc_surgicalKitProgress.sqf index 565df32e54..e41cdf16b7 100644 --- a/addons/medical_treatment/functions/fnc_surgicalKitProgress.sqf +++ b/addons/medical_treatment/functions/fnc_surgicalKitProgress.sqf @@ -22,8 +22,8 @@ params ["_args", "_elapsedTime", "_totalTime"]; _args params ["", "_patient"]; -private _bandagedWounds = _patient getVariable [QEGVAR(medical,bandagedWounds), []]; -private _stitchedWounds = _patient getVariable [QEGVAR(medical,stitchedWounds), []]; +private _bandagedWounds = GET_BANDAGED_WOUNDS(_patient); +private _stitchedWounds = GET_STITCHED_WOUNDS(_patient); // Stop treatment if there are no wounds that can be stitched remaining if (_bandagedWounds isEqualTo []) exitWith { false }; @@ -32,8 +32,8 @@ if (_bandagedWounds isEqualTo []) exitWith { false }; if (_totalTime - _elapsedTime <= (count _bandagedWounds - 1) * 5) then { private _treatedWound = _bandagedWounds deleteAt 0; _stitchedWounds pushBack _treatedWound; - _patient setVariable [QEGVAR(medical,bandagedWounds), _bandagedWounds, true]; - _patient setVariable [QEGVAR(medical,stitchedWounds), _stitchedWounds, true]; + _patient setVariable [VAR_BANDAGED_WOUNDS, _bandagedWounds, true]; + _patient setVariable [VAR_STITCHED_WOUNDS, _stitchedWounds, true]; TRACE_3("stitched",_treatedWound,count _bandagedWounds,count _stitchedWounds); // Check if we fixed limping from this treatment