Skip to content

Commit

Permalink
FIX: CBA_fnc_deleteEntity looping over network and kill dedicated ser…
Browse files Browse the repository at this point in the history
…ver (#940)

* FIX: particular case when groupowner return 0

- when a unit is created inside a group, the group locality isn't immediately the same as the unit. It is 0 which mean the `remoteExecCall`  to every client the execution of `CBA_fnc_deleteEntity`. So because the unit is only local  to server or one client, all others clients will `remeteExecCall` again the `CBA_fnc_deleteEntity`. So a remote execution is starting.
To prevent that the `CBA_fnc_deleteEntity` execution is waiting until the groupOwner is correct (not 0)

* No timeout is necessary since groupowner is always switching to a server/client

* quit waitUntil should group be deleted by other means
  • Loading branch information
Vdauphin authored and commy2 committed Jun 30, 2018
1 parent 0a9bb8a commit befb2f6
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions addons/common/fnc_deleteEntity.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,14 @@ switch (typeName _entity) do {
deleteGroup _entity;
} else {
if (isServer) then {
_entity remoteExecCall ["CBA_fnc_deleteEntity", groupOwner _entity];
private _groupOwner = groupOwner _entity;
if (_groupOwner isEqualTo 0) then {
[{groupOwner _this != 0 || isNull _this}, {
_this call CBA_fnc_deleteEntity;
}, _entity] call CBA_fnc_waitUntilAndExecute;
} else {
_entity remoteExecCall ["CBA_fnc_deleteEntity", _groupOwner];
};
} else {
_entity remoteExecCall ["CBA_fnc_deleteEntity", 2];
};
Expand All @@ -57,7 +64,7 @@ switch (typeName _entity) do {
deleteLocation _entity;
};
case "STRING" : {
deleteMarker _entity
deleteMarker _entity;
};
default {};
};

0 comments on commit befb2f6

Please sign in to comment.