From 71f6c3db702e08b5ca6398dd52f0011c3b06badf Mon Sep 17 00:00:00 2001 From: "DESKTOP-UH65DCE\\MusTanG" Date: Wed, 30 Aug 2017 20:43:19 -0500 Subject: [PATCH] fixes Added the _allPlayers variable to complete the delete and readd to original Perm Group. Optimized forEach statements. Fixed use of _groupId with _permGroup --- .../EPOCH_server_deleteTempGroup.sqf | 2 +- .../EPOCH_server_updatePlayerTempGroup.sqf | 14 ++++++-------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/Sources/epoch_server/compile/epoch_grouptemp/EPOCH_server_deleteTempGroup.sqf b/Sources/epoch_server/compile/epoch_grouptemp/EPOCH_server_deleteTempGroup.sqf index d99cc1ce..39a7a6a3 100644 --- a/Sources/epoch_server/compile/epoch_grouptemp/EPOCH_server_deleteTempGroup.sqf +++ b/Sources/epoch_server/compile/epoch_grouptemp/EPOCH_server_deleteTempGroup.sqf @@ -22,7 +22,7 @@ if !([_player, _token] call EPOCH_server_getPToken) exitWith{}; _return = false; _groupID = getPlayerUID _player; if (_groupID != "") then { - + _allPlayers = allPlayers select {alive _x}; { _group = grpNull; _permGroup = _x getVariable["GROUP",""]; diff --git a/Sources/epoch_server/compile/epoch_grouptemp/EPOCH_server_updatePlayerTempGroup.sqf b/Sources/epoch_server/compile/epoch_grouptemp/EPOCH_server_updatePlayerTempGroup.sqf index a34ae866..debd247b 100644 --- a/Sources/epoch_server/compile/epoch_grouptemp/EPOCH_server_updatePlayerTempGroup.sqf +++ b/Sources/epoch_server/compile/epoch_grouptemp/EPOCH_server_updatePlayerTempGroup.sqf @@ -43,10 +43,8 @@ if !(_contentArray isEqualTo []) then { if ((_x getVariable ["TEMPGROUP",""]) != _groupID) then { _group = grpNull; { - if ((_x getVariable["TEMPGROUP",""]) == _groupID) exitWith { - _group = group _x; - }; - } forEach _allPlayers; + _group = group _x; + } forEach (_allPlayers select {(_x getVariable["TEMPGROUP", ""]) == _groupID}); if (isNull _group) then { _group = createGroup [west, true]; @@ -56,6 +54,7 @@ if !(_contentArray isEqualTo []) then { [_x] joinSilent _group; }; } forEach (_allPlayers select {getPlayerUID _x == _selectedPlayerUID}); + // find player name from DB if (_selectedPlayerName == "Dead Player") then { @@ -86,6 +85,7 @@ if !(_contentArray isEqualTo []) then { //Remove _found = false; _group = grpNull; + _permGroup = ""; { _permGroup = _x getVariable["GROUP",""]; _playerObj = _x; @@ -93,10 +93,8 @@ if !(_contentArray isEqualTo []) then { if !(_permGroup isEqualTo "")then { { - if ((_x getVariable["GROUP",""]) == _groupID) exitWith { - _group = group _x; - }; - } forEach _allPlayers; + _group = group _x; + } forEach (_allPlayers select {(_x getVariable["GROUP", ""]) == _permGroup}); }; _playerObj setVariable ["TEMPGROUP", nil]; if (isNull _group) then {