From ae3de331c465b5a3590c5b226ec80c82db6f6dff Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Tue, 24 Feb 2015 11:51:37 -0600 Subject: [PATCH] Module At Mission Start (Issue #148) --- addons/captives/functions/fnc_moduleSurrender.sqf | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/addons/captives/functions/fnc_moduleSurrender.sqf b/addons/captives/functions/fnc_moduleSurrender.sqf index 07e7c1b9ad..1c10779220 100644 --- a/addons/captives/functions/fnc_moduleSurrender.sqf +++ b/addons/captives/functions/fnc_moduleSurrender.sqf @@ -43,10 +43,15 @@ if (local _logic) then { } else { ["STR_ACE_Captives_Zeus_NothingSelected"] call EFUNC(commmon,displayTextStructured); }; - } else {//an editor module - { - ["SetSurrendered", [_x], [_x, true]] call EFUNC(common,targetEvent); - } forEach _units; + } else { + //an editor module + //Modules run before postInit can instal the event handler, so we need to wait a little bit + [{ + PARAMS_1(_units); + { + ["SetSurrendered", [_x], [_x, true]] call EFUNC(common,targetEvent); + } forEach _units; + }, [_units], 0.05, 0.05]call EFUNC(common,waitAndExecute); }; deleteVehicle _logic;