From c38fe384e3c53094b98bdf53a51655279a203b9c Mon Sep 17 00:00:00 2001 From: Glowbal Date: Tue, 28 Apr 2015 19:30:35 +0200 Subject: [PATCH] added default values for getvar's --- addons/medical/functions/fnc_handleUnitVitals.sqf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/medical/functions/fnc_handleUnitVitals.sqf b/addons/medical/functions/fnc_handleUnitVitals.sqf index 411f64b49e..b806d1358f 100644 --- a/addons/medical/functions/fnc_handleUnitVitals.sqf +++ b/addons/medical/functions/fnc_handleUnitVitals.sqf @@ -66,13 +66,13 @@ if (_painStatus > 0) then { if (GVAR(level) == 1) then { // reduce pain - if (_unit getVariable [QGVAR(pain), 0] > 0) then { - _unit setVariable [QGVAR(pain), ((_unit getVariable QGVAR(pain)) - 0.001 * _interval) max 0, _syncValues]; + if (_painStatus > 0) then { + _unit setVariable [QGVAR(pain), (_painStatus - 0.001 * _interval) max 0, _syncValues]; }; // reduce painkillers if (_unit getVariable [QGVAR(morphine), 0] > 0) then { - _unit setVariable [QGVAR(morphine), ((_unit getVariable QGVAR(morphine)) - 0.0015 * _interval) max 0, _syncValues]; + _unit setVariable [QGVAR(morphine), ((_unit getVariable [QGVAR(morphine), 0]) - 0.0015 * _interval) max 0, _syncValues]; }; // bleeding