Skip to content

Commit 592320e

Browse files
authored
Fixed Zeus module bugs: Spawning enemy & other
Fixed curator module able to spawn enemy units. Fixed Refreshing Zeus not fully removing old curator modules
1 parent 5e5fb74 commit 592320e

File tree

1 file changed

+20
-12
lines changed

1 file changed

+20
-12
lines changed

addons/AIO_AIMENU/zeus.sqf

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
params ["_mode"];
22
private ["_sync", "_classes", "_text", "_side", "_curators", "_group"];
33

4-
if (AIO_Zeus_Enabled && _mode == 1) then {
5-
//_group = createGroup (sideLogic);
4+
AIO_createZeusFnc =
5+
{
6+
//_group = createGroup (sideLogic);
67
//AIO_curator_module = _group createUnit ["ModuleCurator_F", [0, 0, 0], [], 0, "NONE"];
78
AIO_curator_module = "ModuleCurator_F" createVehicleLocal [0, 0, 0];
89
AIO_curator_module setVariable ["owner", (name player)];
@@ -44,19 +45,18 @@ if (AIO_Zeus_Enabled && _mode == 1) then {
4445
};
4546
if (AIO_Zeus_delete_Enabled) then {AIO_curator_module setCuratorCoef ["delete",0]} else {AIO_curator_module setCuratorCoef ["delete",-1e9]};
4647
if (AIO_Zeus_destroy_Enabled) then {AIO_curator_module setCuratorCoef ["destroy", 0]} else {AIO_curator_module setCuratorCoef ["destroy",-1e9]};
47-
48+
4849
AIO_curator_module setCuratorCoef ["group",0];
4950
AIO_curator_module setCuratorCoef ["synchronize",0];
5051
};
51-
if (_mode != 1) then {
52-
_sync = synchronizedObjects player;
53-
_curators = _sync select {(typeOf _x) == "ModuleCurator_F"};
54-
if (isNil "AIO_curator_module") exitWith {};
55-
if (isNull AIO_curator_module) exitWith {};
56-
{
57-
if (_x != AIO_curator_module) then {deleteVehicle _x};
58-
} forEach _curators;
59-
unassignCurator AIO_curator_module;
52+
53+
AIO_refreshZeusFnc =
54+
{
55+
if (isNil "AIO_curator_module") exitWith {call AIO_createZeusFnc};
56+
if (isNull AIO_curator_module) exitWith {call AIO_createZeusFnc};
57+
_curator = getAssignedCuratorLogic player;
58+
unassignCurator _curator;
59+
_curator setVariable ["owner", ""];
6060
AIO_curator_module setVariable ["owner", (name player)];
6161
player assignCurator AIO_curator_module;
6262

@@ -82,4 +82,12 @@ if (_mode != 1) then {
8282
AIO_curator_module addCuratorEditableObjects [_objs, true];
8383
player synchronizeObjectsAdd [AIO_curator_module];
8484
};
85+
};
86+
87+
if (AIO_Zeus_Enabled && _mode == 1) then {
88+
call AIO_createZeusFnc;
89+
};
90+
91+
if (_mode != 1) then {
92+
call AIO_refreshZeusFnc;
8593
};

0 commit comments

Comments
 (0)