Update fn_addEmptyGroupCleanupPFH.sqf

fix logic order and update logging output
This commit is contained in:
hizumi
2024-04-25 21:34:34 -05:00
parent cbd8b5963e
commit 87b6f359c1

View File

@@ -10,33 +10,41 @@
GVAR(emptyGroupCleanupPFH) = [ GVAR(emptyGroupCleanupPFH) = [
{ {
{ {
if (local _x) then {
if ((count units _x) == 0) then { if ((count units _x) == 0) then {
if (local _x) then {
[ [
LEVEL_INFO, LEVEL_INFO,
QUOTE(COMPONENT), QUOTE(COMPONENT),
format["Deleting local empty group %1", groupId _x], "DELETING EMPTY GROUP",
[] [
["groupId", groupId _x],
["netId", netId _x]
]
] call EFUNC(common,log); ] call EFUNC(common,log);
deleteGroup _x; deleteGroup _x;
};
} else { } else {
if (isServer) then { if (isServer) then {
[ [
LEVEL_INFO, LEVEL_INFO,
QUOTE(COMPONENT), QUOTE(COMPONENT),
format["Cannot delete group %1 as owner is %2", groupId _x, owner _x], "NON LOCAL EMPTY GROUP",
[] [
["groupId", groupId _x],
["groupOwner", groupOwner _x]
]
] call EFUNC(common,log); ] call EFUNC(common,log);
} else { } else {
[ [
LEVEL_INFO, LEVEL_INFO,
QUOTE(COMPONENT), QUOTE(COMPONENT),
format["Cannot delete group %1 as owner is %2", groupId _x, groupOwner _x], "EMPTY REMOTE GROUP",
[] [
["groupId", groupId _x]
]
] call EFUNC(common,log); ] call EFUNC(common,log);
}; };
}; };
};
} forEach allGroups; } forEach allGroups;
}, },
300, 300,
@@ -61,6 +69,3 @@ GVAR(emptyGroupCleanupPFH) = [
{ not (missionNamespace getVariable [QGVAR(emptyGroupCleanup_enable), false]) }, { not (missionNamespace getVariable [QGVAR(emptyGroupCleanup_enable), false]) },
[] []
] call CBA_fnc_createPerFrameHandlerObject; ] call CBA_fnc_createPerFrameHandlerObject;