From 07774647e9666fb6af606c762f5d4aeb0761ec2a Mon Sep 17 00:00:00 2001 From: commy2 Date: Sat, 26 Sep 2015 19:30:13 +0200 Subject: [PATCH] delay setUnconscious until the settings are inited, fix #148 --- addons/medical/functions/fnc_setUnconscious.sqf | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/addons/medical/functions/fnc_setUnconscious.sqf b/addons/medical/functions/fnc_setUnconscious.sqf index 3de62db974..cb9fff0693 100644 --- a/addons/medical/functions/fnc_setUnconscious.sqf +++ b/addons/medical/functions/fnc_setUnconscious.sqf @@ -21,6 +21,11 @@ #define DEFAULT_DELAY (round(random(10)+5)) +// only run this after the settings are initialized +if !(EGVAR(common,settingsInitFinished)) exitWith { + EGVAR(common,runAtSettingsInitialized) pushBack [FUNC(setUnconscious), _this]; +}; + private ["_animState", "_originalPos", "_startingTime", "_isDead"]; params ["_unit", ["_set", true], ["_minWaitingTime", DEFAULT_DELAY], ["_force", false]];