From 9c00c6ffb58af2e6790d758141913bf7a48be742 Mon Sep 17 00:00:00 2001 From: Thomas Kooi Date: Sun, 15 Jul 2018 13:01:26 +0200 Subject: [PATCH] Fix bunch of script errors related to getVars on start up of game --- addons/medical/script_macros_medical.hpp | 18 +++++++++--------- .../functions/fnc_addHeartRateAdjustment.sqf | 2 +- .../functions/fnc_treatmentMedicationLocal.sqf | 6 +++--- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/addons/medical/script_macros_medical.hpp b/addons/medical/script_macros_medical.hpp index 0770b516d1..4fc990fe56 100644 --- a/addons/medical/script_macros_medical.hpp +++ b/addons/medical/script_macros_medical.hpp @@ -84,15 +84,15 @@ // - Unit Functions --------------------------------------------------- // Retrieval macros for common unit values // Defined for easy consistency and speed -#define GET_BLOOD_VOLUME(unit) (GETVAR(unit,VAR_BLOOD_VOL,DEFAULT_BLOOD_VOLUME)) -#define GET_HEART_RATE(unit) (GETVAR(unit,VAR_HEART_RATE,DEFAULT_HEART_RATE)) -#define GET_HEMORRHAGE(unit) (GETVAR(unit,VAR_HEMORRHAGE,0)) -#define GET_PAIN(unit) (GETVAR(unit,VAR_PAIN,0)) -#define GET_PAIN_SUPPRESS(unit) (GETVAR(unit,VAR_PAIN_SUPP,0)) -#define IN_CRDC_ARRST(unit) (GETVAR(unit,VAR_CRDC_ARRST,false)) -#define IS_BLEEDING(unit) (GETVAR(unit,VAR_IS_BLEEDING,false)) -#define IS_IN_PAIN(unit) (GETVAR(unit,VAR_IN_PAIN,false)) -#define IS_UNCONSCIOUS(unit) (GETVAR(unit,VAR_UNCON,false)) +#define GET_BLOOD_VOLUME(unit) (unit getVariable [VAR_BLOOD_VOL,DEFAULT_BLOOD_VOLUME]) +#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 IN_CRDC_ARRST(unit) (unit getVariable [VAR_CRDC_ARRST,false]) +#define IS_BLEEDING(unit) (unit getVariable [VAR_IS_BLEEDING,false]) +#define IS_IN_PAIN(unit) (unit getVariable [VAR_IN_PAIN,false]) +#define IS_UNCONSCIOUS(unit) (unit getVariable [VAR_UNCON,false]) // 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_status/functions/fnc_addHeartRateAdjustment.sqf b/addons/medical_status/functions/fnc_addHeartRateAdjustment.sqf index 42dd64fb45..4538331617 100644 --- a/addons/medical_status/functions/fnc_addHeartRateAdjustment.sqf +++ b/addons/medical_status/functions/fnc_addHeartRateAdjustment.sqf @@ -14,7 +14,7 @@ #include "script_component.hpp" params ["_unit", "_change", "_timeToMaxEffect", "_maxTimeInSystem"]; -private _adjustments = GETVAR(_unit,VAR_HEART_RATE_ADJ,[]); +private _adjustments = _unit getVariable [VAR_HEART_RATE_ADJ,[]]; // The last number indicates the time the adjustment is already in the system _adjustments pushBack [_change, _timeToMaxEffect, _maxTimeInSystem, 0]; _unit setVariable [VAR_HEART_RATE_ADJ, _adjustments]; diff --git a/addons/medical_treatment/functions/fnc_treatmentMedicationLocal.sqf b/addons/medical_treatment/functions/fnc_treatmentMedicationLocal.sqf index a7b1c4f500..f1f258d756 100644 --- a/addons/medical_treatment/functions/fnc_treatmentMedicationLocal.sqf +++ b/addons/medical_treatment/functions/fnc_treatmentMedicationLocal.sqf @@ -80,21 +80,21 @@ if (alive _target) then { // Adjust the heart rate based upon config entry if (_heartRateChange != 0) then { - private _adjustments = GETVAR(_target,VAR_HEART_RATE_ADJ,[]); + private _adjustments = _target getVariable [VAR_HEART_RATE_ADJ,[]]; _adjustments pushBack [_heartRateChange, _timeTillMaxEffect, _timeInSystem, 0]; _target setVariable [VAR_HEART_RATE_ADJ, _adjustments]; }; // Adjust the pain suppression based upon config entry if (_painReduce > 0) then { - private _adjustments = GETVAR(_target,VAR_PAIN_SUPP_ADJ,[]); + private _adjustments = _target getVariable [VAR_PAIN_SUPP_ADJ,[]]; _adjustments pushBack [_painReduce, _timeTillMaxEffect, _timeInSystem, 0]; _target setVariable [VAR_PAIN_SUPP_ADJ, _adjustments]; }; // Adjust the peripheral resistance based upon config entry if (_viscosityChange != 0) then { - private _adjustments = GETVAR(_target,VAR_PERIPH_RES_ADJ,[]); + private _adjustments = _target getVariable [VAR_PERIPH_RES_ADJ,[]]; _adjustments pushBack [_viscosityChange, _timeTillMaxEffect, _timeInSystem, 0]; _target setVariable [VAR_PERIPH_RES_ADJ, _adjustments]; };