From 8b4c0c0e366c4c91f9b105f6f6fc5efd33d7a04d Mon Sep 17 00:00:00 2001 From: Glowbal Date: Sun, 22 Mar 2015 15:16:42 +0100 Subject: [PATCH] fixed postInit depending on setting --- addons/medical/XEH_postInit.sqf | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/addons/medical/XEH_postInit.sqf b/addons/medical/XEH_postInit.sqf index ee73d28318..006a8b5137 100644 --- a/addons/medical/XEH_postInit.sqf +++ b/addons/medical/XEH_postInit.sqf @@ -218,19 +218,21 @@ if (isNil QGVAR(level)) then { }, 0, []] call CBA_fnc_addPerFrameHandler; // broadcast injuries to JIP clients in a MP session -if (isMultiplayer and GVAR(level) >= 2) then { +if (isMultiplayer) then { [QGVAR(onPlayerConnected), "onPlayerConnected", { - if (isNil QGVAR(InjuredCollection)) then { - GVAR(InjuredCollection) = []; - }; + if (GVAR(level) >= 2) then { + if (isNil QGVAR(InjuredCollection)) then { + GVAR(InjuredCollection) = []; + }; - { - _unit = _x; - _openWounds = _unit getvariable [QGVAR(openWounds), []]; { - ["medical_propagateWound", [_id], [_unit, _x]] call EFUNC(common,targetEvent); - }foreach _openWounds; - }foreach GVAR(InjuredCollection); + _unit = _x; + _openWounds = _unit getvariable [QGVAR(openWounds), []]; + { + ["medical_propagateWound", [_id], [_unit, _x]] call EFUNC(common,targetEvent); + }foreach _openWounds; + }foreach GVAR(InjuredCollection); + }; }, []] call BIS_fnc_addStackedEventHandler; };