From e7cb2f8721dffdcb1b15b310b104f487c98bdf3a Mon Sep 17 00:00:00 2001 From: sudlud Date: Tue, 11 Aug 2026 09:27:41 +0200 Subject: [PATCH] fix(Scripts/Commands): .account set gmlevel wipes access on the wrong realm (#27088) Co-authored-by: Claude Opus 5 --- src/server/scripts/Commands/cs_account.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/server/scripts/Commands/cs_account.cpp b/src/server/scripts/Commands/cs_account.cpp index 3a75acf663..790e7d9bf2 100644 --- a/src/server/scripts/Commands/cs_account.cpp +++ b/src/server/scripts/Commands/cs_account.cpp @@ -826,14 +826,14 @@ public: } } - // Check if provided realm.Id.Realm has a negative value other than -1 + // Check if provided gmRealmID has a negative value other than -1 if (gmRealmID < -1) { handler->SendErrorMessage(LANG_INVALID_REALMID); return false; } - // If gmRealmID is -1, delete all values for the account id, else, insert values for the specific realm.Id.Realm + // If gmRealmID is -1, delete access on every realm, else on the requested one and any all-realms row LoginDatabasePreparedStatement* stmt; if (gmRealmID == -1) @@ -845,7 +845,7 @@ public: { stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_ACCOUNT_ACCESS_BY_REALM); stmt->SetData(0, targetAccountId); - stmt->SetData(1, realm.Id.Realm); + stmt->SetData(1, gmRealmID); } LoginDatabase.Execute(stmt);