mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-17 02:50:29 +00:00
fix(Core/Guild): Properly updates guild leader using command guild rank. (#9596)
Fixes #9396
This commit is contained in:
@@ -2268,6 +2268,17 @@ bool Guild::ChangeMemberRank(ObjectGuid guid, uint8 newRank)
|
||||
if (Member* member = GetMember(guid))
|
||||
{
|
||||
member->ChangeRank(newRank);
|
||||
|
||||
if (newRank == GR_GUILDMASTER)
|
||||
{
|
||||
m_leaderGuid = guid;
|
||||
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GUILD_LEADER);
|
||||
stmt->setUInt32(0, m_leaderGuid.GetCounter());
|
||||
stmt->setUInt32(1, m_id);
|
||||
CharacterDatabase.Execute(stmt);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user