From 802560da8a08298e37bcc0d68b8259bd56032541 Mon Sep 17 00:00:00 2001 From: Grim <69561145+LinkIsGrim@users.noreply.github.com> Date: Wed, 7 Feb 2024 20:25:49 -0300 Subject: [PATCH] CSW - Delay init for CSW with simulation disabled (#9778) Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> --- addons/csw/functions/fnc_staticWeaponInit.sqf | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/csw/functions/fnc_staticWeaponInit.sqf b/addons/csw/functions/fnc_staticWeaponInit.sqf index 6dcbbf52e6..f7208db62c 100644 --- a/addons/csw/functions/fnc_staticWeaponInit.sqf +++ b/addons/csw/functions/fnc_staticWeaponInit.sqf @@ -16,7 +16,10 @@ */ params ["_staticWeapon"]; -if (isNull _staticWeapon) exitWith { WARNING_1("%1 became null",_staticWeapon) }; +if (!alive _staticWeapon) exitWith { WARNING_1("%1 not alive",_staticWeapon); }; +if (!simulationEnabled _staticWeapon) exitWith { + [{simulationEnabled _this}, FUNC(staticWeaponInit), _staticWeapon] call CBA_fnc_waitUntilAndExecute; +}; private _typeOf = typeOf _staticWeapon; private _configOf = configOf _staticWeapon; private _configEnabled = (getNumber (_configOf >> "ace_csw" >> "enabled")) == 1;