mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Fix bunch of script errors related to getVars on start up of game
This commit is contained in:
parent
5e1c3c6da1
commit
9c00c6ffb5
@ -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))
|
||||
|
@ -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];
|
||||
|
@ -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];
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user