CSW - Delay init for CSW with simulation disabled (#9778)

Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>
This commit is contained in:
Grim 2024-02-07 20:25:49 -03:00 committed by GitHub
parent 1649422cbd
commit 802560da8a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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;