From dbb538dc56e547e5462690ab4755ebd41f9626f9 Mon Sep 17 00:00:00 2001 From: SilentSpike Date: Wed, 9 May 2018 13:37:07 +0100 Subject: [PATCH] Fix GVARs moved out of `medical` --- addons/medical_statemachine/Statemachine.hpp | 8 ++++---- .../functions/fnc_enteredStateCardiacArrest.sqf | 6 +++--- .../functions/fnc_handleStateUnconscious.sqf | 6 +++--- addons/medical_status/functions/fnc_getBloodLoss.sqf | 2 +- .../medical_status/functions/fnc_getBloodVolumeChange.sqf | 2 +- addons/medical_status/functions/fnc_isMedic.sqf | 6 +++--- addons/medical_status/functions/fnc_setCardiacArrest.sqf | 2 +- addons/medical_status/functions/fnc_setUnconscious.sqf | 2 +- .../medical_vitals/functions/fnc_updatePainSuppress.sqf | 2 +- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/addons/medical_statemachine/Statemachine.hpp b/addons/medical_statemachine/Statemachine.hpp index f858a87542..707f4df9fe 100644 --- a/addons/medical_statemachine/Statemachine.hpp +++ b/addons/medical_statemachine/Statemachine.hpp @@ -47,7 +47,7 @@ class ACE_Medical_StateMachine { onStateEntered = QUOTE([ARR_2(_this,(true))] call FUNC(setUnconsciousStatemachine)); class DeathAI { targetState = "Dead"; - condition = QUOTE(!isPlayer _this && {GVAR(unconsciousConditionAI)}); + condition = QUOTE(!isPlayer _this && {EGVAR(medical,unconsciousConditionAI)}); }; class WakeUp { targetState = "Injured"; @@ -71,12 +71,12 @@ class ACE_Medical_StateMachine { class DeathAI { events[] = {QGVAR(FatalInjuryInstantTransition)}; targetState = "Dead"; - condition = QUOTE(!isPlayer _this && {GVAR(fatalInjuryConditionAI)}); + condition = QUOTE(!isPlayer _this && {EGVAR(medical,fatalInjuryConditionAI)}); }; class SecondChance { events[] = {QGVAR(FatalInjuryInstantTransition)}; targetState = "CardiacArrest"; - condition = QUOTE(GVAR(fatalInjuryCondition) > 0); + condition = QUOTE(EGVAR(medical,fatalInjuryCondition) > 0); onTransition = QFUNC(transitionSecondChance); }; class Death { @@ -90,7 +90,7 @@ class ACE_Medical_StateMachine { onStateLeaving = QFUNC(leftStateCardiacArrest); class DeathAI { targetState = "Dead"; - condition = QUOTE(!isPlayer _this && {GVAR(fatalInjuryConditionAI)}); + condition = QUOTE(!isPlayer _this && {EGVAR(medical,fatalInjuryConditionAI)}); }; class Timeout { targetState = "Dead"; diff --git a/addons/medical_statemachine/functions/fnc_enteredStateCardiacArrest.sqf b/addons/medical_statemachine/functions/fnc_enteredStateCardiacArrest.sqf index d3a6167976..6f8fcea695 100644 --- a/addons/medical_statemachine/functions/fnc_enteredStateCardiacArrest.sqf +++ b/addons/medical_statemachine/functions/fnc_enteredStateCardiacArrest.sqf @@ -15,10 +15,10 @@ params ["_unit"]; // 10% possible variance in cardiac arrest time -private _time = GVAR(cardiacArrestTime); +private _time = EGVAR(medical,cardiacArrestTime); _time = _time + random [_time*-0.1, 0, _time*0.1]; -_unit setVariable [QGVAR(cardiacArrestTime), _time]; -_unit setVariable [QGVAR(cardiacArrestStart), CBA_missionTime]; +_unit setVariable [QEGVAR(medical,cardiacArrestTime), _time]; +_unit setVariable [QEGVAR(medical,cardiacArrestStart), CBA_missionTime]; [_unit] call EFUNC(medical_status,setCardiacArrest); diff --git a/addons/medical_statemachine/functions/fnc_handleStateUnconscious.sqf b/addons/medical_statemachine/functions/fnc_handleStateUnconscious.sqf index b0abdc7289..979d2ec1fe 100644 --- a/addons/medical_statemachine/functions/fnc_handleStateUnconscious.sqf +++ b/addons/medical_statemachine/functions/fnc_handleStateUnconscious.sqf @@ -22,13 +22,13 @@ if (_painLevel > 0) then { }; // Handle spontaneous wakeup from unconsciousness -if (GVAR(spontaneousWakeUpChance) > 0) then { +if (EGVAR(medical,spontaneousWakeUpChance) > 0) then { if (_unit call EFUNC(medical_status,hasStableVitals)) then { private _lastWakeUpCheck = _unit getVariable [QGVAR(lastWakeUpCheck), CBA_missionTime]; if (CBA_missionTime - _lastWakeUpCheck > SPONTANEOUS_WAKE_UP_INTERVAL) then { - TRACE_2("Checking for wake up",_unit,GVAR(spontaneousWakeUpChance)); + TRACE_2("Checking for wake up",_unit,EGVAR(medical,spontaneousWakeUpChance)); _unit setVariable [QGVAR(lastWakeUpCheck), CBA_missionTime]; - if ((random 1) < GVAR(spontaneousWakeUpChance)) then { + if ((random 1) < EGVAR(medical,spontaneousWakeUpChance)) then { TRACE_1("Spontaneous wake up!",_unit); [QGVAR(WakeUp), _unit] call CBA_fnc_localEvent; }; diff --git a/addons/medical_status/functions/fnc_getBloodLoss.sqf b/addons/medical_status/functions/fnc_getBloodLoss.sqf index 21fd31bd49..3ce1790e8b 100644 --- a/addons/medical_status/functions/fnc_getBloodLoss.sqf +++ b/addons/medical_status/functions/fnc_getBloodLoss.sqf @@ -37,4 +37,4 @@ _limbBleedingRate = _limbBleedingRate * (1 - _bodyBleedingRate); private _cardiacOutput = [_unit] call FUNC(getCardiacOutput); -((_bodyBleedingRate + _limbBleedingRate) * _cardiacOutput * GVAR(bleedingCoefficient)) +((_bodyBleedingRate + _limbBleedingRate) * _cardiacOutput * EGVAR(medical,bleedingCoefficient)) diff --git a/addons/medical_status/functions/fnc_getBloodVolumeChange.sqf b/addons/medical_status/functions/fnc_getBloodVolumeChange.sqf index f4908406fc..59088856bb 100644 --- a/addons/medical_status/functions/fnc_getBloodVolumeChange.sqf +++ b/addons/medical_status/functions/fnc_getBloodVolumeChange.sqf @@ -30,7 +30,7 @@ if (!isNil {_unit getVariable QGVAR(ivBags)}) then { _x params ["_bagVolumeRemaining", "_type", "_bodyPart"]; if (_tourniquets select _bodyPart == 0) then { - private _bagChange = (_deltaT * GVAR(ivFlowRate) * IV_CHANGE_PER_SECOND) min _bagVolumeRemaining; // absolute value of the change in miliLiters + private _bagChange = (_deltaT * EGVAR(medical,ivFlowRate) * IV_CHANGE_PER_SECOND) min _bagVolumeRemaining; // absolute value of the change in miliLiters _bagVolumeRemaining = _bagVolumeRemaining - _bagChange; _bloodVolumeChange = _bloodVolumeChange + (_bagChange / 1000); }; diff --git a/addons/medical_status/functions/fnc_isMedic.sqf b/addons/medical_status/functions/fnc_isMedic.sqf index de00803804..4de3b3c105 100644 --- a/addons/medical_status/functions/fnc_isMedic.sqf +++ b/addons/medical_status/functions/fnc_isMedic.sqf @@ -21,11 +21,11 @@ params ["_unit", ["_medicN", 1]]; private _class = _unit getVariable [QGVAR(medicClass), [0, 1] select (_unit getUnitTrait "medic")]; -if (_class >= _medicN min GVAR(medicSetting)) exitWith {true}; -if (!GVAR(increaseTrainingInLocations)) exitWith {false}; +if (_class >= _medicN min EGVAR(medical,medicSetting)) exitWith {true}; +if (!EGVAR(medical,increaseTrainingInLocations)) exitWith {false}; if (([_unit] call FUNC(isInMedicalVehicle)) || {[_unit] call FUNC(isInMedicalFacility)}) then { _class = _class + 1; //boost by one: untrained becomes medic, medic becomes doctor }; -_class >= _medicN min GVAR(medicSetting) +_class >= _medicN min EGVAR(medical,medicSetting) diff --git a/addons/medical_status/functions/fnc_setCardiacArrest.sqf b/addons/medical_status/functions/fnc_setCardiacArrest.sqf index 120cf79cf7..e6b9689df2 100644 --- a/addons/medical_status/functions/fnc_setCardiacArrest.sqf +++ b/addons/medical_status/functions/fnc_setCardiacArrest.sqf @@ -26,4 +26,4 @@ SET_HEART_RATE(_unit,0); ["ace_cardiacArrestEntered", [_unit]] call CBA_fnc_localEvent; -[_unit, true] call FUNC(setUnconsciousStatemachine); +[_unit, true] call EFUNC(medical,setUnconsciousStatemachine); diff --git a/addons/medical_status/functions/fnc_setUnconscious.sqf b/addons/medical_status/functions/fnc_setUnconscious.sqf index 381f01dd2d..6d7b50601e 100644 --- a/addons/medical_status/functions/fnc_setUnconscious.sqf +++ b/addons/medical_status/functions/fnc_setUnconscious.sqf @@ -59,7 +59,7 @@ if (_knockOut) then { }; }, [_unit], _minWaitingTime] call CBA_fnc_waitAndExecute; }; - if (GVAR(spontaneousWakeUpChance) > 0) then { + if (EGVAR(medical,spontaneousWakeUpChance) > 0) then { _unit setVariable [QGVAR(lastWakeUpCheck), CBA_missionTime + _minWaitingTime - SPONTANEOUS_WAKE_UP_INTERVAL]; }; }; diff --git a/addons/medical_vitals/functions/fnc_updatePainSuppress.sqf b/addons/medical_vitals/functions/fnc_updatePainSuppress.sqf index aeae8e99db..550cd626a7 100644 --- a/addons/medical_vitals/functions/fnc_updatePainSuppress.sqf +++ b/addons/medical_vitals/functions/fnc_updatePainSuppress.sqf @@ -48,7 +48,7 @@ private _pain = GET_PAIN_TOTAL(_unit); _unit setVariable [QEGVAR(medical_status,pain), 0 max (_pain - _deltaT / PAIN_FADE_TIME), _syncValue]; // Handles simple medication -if (!GVAR(advancedMedication)) then { +if (!EGVAR(medical,advancedMedication)) then { private _painSupress = _unit getVariable [QGVAR(painSuppress), 0]; _painSupress = _painSupress - _deltaT / PAIN_SUPPRESSION_FADE_TIME; _unit setVariable [QGVAR(painSuppress), 0 max _painSupress, _syncValue];