Fix QGVAR medical variables

This commit is contained in:
Magnetar 2018-07-16 15:35:34 +02:00
parent 81f1365a41
commit 9b5c5bc866
2 changed files with 5 additions and 5 deletions

View File

@ -40,14 +40,14 @@ if (!isNull _instigator) then {
};
#ifdef DEBUG_TESTRESULTS
private _startDmg = +(_unit getVariable [QGVAR(medical,bodyPartDamage), [-1]]);
private _startDmg = +(_unit getVariable [QEGVAR(medical,bodyPartDamage), [-1]]);
private _startPain = GET_PAIN(_unit);
#endif
[QEGVAR(medical,woundReceived), [_unit, _bodyPart, _damageToAdd, _instigator, _typeOfDamage]] call CBA_fnc_localEvent;
#ifdef DEBUG_TESTRESULTS
private _endDmg = _unit getVariable [QGVAR(medical,bodyPartDamage), [-1]];
private _endDmg = _unit getVariable [QEGVAR(medical,bodyPartDamage), [-1]];
private _endPain = GET_PAIN(_unit);
private _typeOfDamageAdj = _typeOfDamage call EFUNC(medical_damage,getTypeOfDamage);
private _config = configFile >> "ACE_Medical_Injuries" >> "damageTypes" >> _typeOfDamageAdj;

View File

@ -24,10 +24,10 @@ if (_painLevel > 0) then {
// Handle spontaneous wakeup from unconsciousness
if (EGVAR(medical,spontaneousWakeUpChance) > 0) then {
if (_unit call EFUNC(medical_status,hasStableVitals)) then {
private _lastWakeUpCheck = _unit getVariable [EQGVAR(medical,lastWakeUpCheck), CBA_missionTime];
private _lastWakeUpCheck = _unit getVariable [QEGVAR(medical,lastWakeUpCheck), CBA_missionTime];
if (CBA_missionTime - _lastWakeUpCheck > SPONTANEOUS_WAKE_UP_INTERVAL) then {
TRACE_2("Checking for wake up",_unit,EGVAR(medical,spontaneousWakeUpChance));
_unit setVariable [EQGVAR(medical,lastWakeUpCheck), CBA_missionTime];
_unit setVariable [QEGVAR(medical,lastWakeUpCheck), CBA_missionTime];
if ((random 1) < EGVAR(medical,spontaneousWakeUpChance)) then {
TRACE_1("Spontaneous wake up!",_unit);
[QEGVAR(medical,WakeUp), _unit] call CBA_fnc_localEvent;
@ -35,6 +35,6 @@ if (EGVAR(medical,spontaneousWakeUpChance) > 0) then {
};
} else {
// Unstable vitals, procrastinate the next wakeup check
_unit setVariable [EQGVAR(medical,lastWakeUpCheck), CBA_missionTime];
_unit setVariable [QEGVAR(medical,lastWakeUpCheck), CBA_missionTime];
};
};