Core/Group: implement automatic party/raid leader change when the leader has been offline for two minutes
Port From (https://github.com/TrinityCore/TrinityCore/commit/cc141e9bad5dc06a56179f820670bd6944651804)
This commit is contained in:
@@ -188,16 +188,14 @@ namespace Game
|
||||
// If the player is in a group (or invited), remove him. If the group if then only 1 person, disband the group.
|
||||
_player.UninviteFromGroup();
|
||||
|
||||
// remove player from the group if he is:
|
||||
// a) in group; b) not in raid group; c) logging out normally (not being kicked or disconnected)
|
||||
if (_player.GetGroup() && !_player.GetGroup().IsRaidGroup() && m_Socket[(int)ConnectionType.Realm] != null)
|
||||
_player.RemoveFromGroup();
|
||||
|
||||
//! Send update to group and reset stored max enchanting level
|
||||
if (_player.GetGroup())
|
||||
var group = _player.GetGroup();
|
||||
if (group != null)
|
||||
{
|
||||
_player.GetGroup().SendUpdate();
|
||||
_player.GetGroup().ResetMaxEnchantingLevel();
|
||||
group.SendUpdate();
|
||||
group.ResetMaxEnchantingLevel();
|
||||
if (group.GetLeaderGUID() == _player.GetGUID())
|
||||
group.StartLeaderOfflineTimer();
|
||||
}
|
||||
|
||||
//! Broadcast a logout message to the player's friends
|
||||
|
||||
Reference in New Issue
Block a user