diff options
Diffstat (limited to 'src/server/scripts/Commands')
| -rw-r--r-- | src/server/scripts/Commands/cs_ticket.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/server/scripts/Commands/cs_ticket.cpp b/src/server/scripts/Commands/cs_ticket.cpp index aee01f47581..958eb1709d5 100644 --- a/src/server/scripts/Commands/cs_ticket.cpp +++ b/src/server/scripts/Commands/cs_ticket.cpp @@ -95,18 +95,16 @@ public: return true; } - // Get target information - uint64 targetGuid = sObjectMgr->GetPlayerGUIDByName(target.c_str()); - uint64 targetAccountId = sObjectMgr->GetPlayerAccountIdByGUID(targetGuid); - uint32 targetGmLevel = AccountMgr::GetSecurity(targetAccountId, realmID); - + uint32 accountId = AccountMgr::GetId(target); // Target must exist and have administrative rights - if (!targetGuid || AccountMgr::IsPlayerAccount(targetGmLevel)) + if (!AccountMgr::HasPermission(accountId, RBAC_PERM_COMMANDS_BE_ASSIGNED_TICKET, realmID)) { handler->SendSysMessage(LANG_COMMAND_TICKETASSIGNERROR_A); return true; } + uint64 targetGuid = sObjectMgr->GetPlayerGUIDByName(target); + // If already assigned, leave if (ticket->IsAssignedTo(targetGuid)) { @@ -125,7 +123,7 @@ public: // Assign ticket SQLTransaction trans = SQLTransaction(NULL); - ticket->SetAssignedTo(targetGuid, AccountMgr::IsAdminAccount(targetGmLevel)); + ticket->SetAssignedTo(targetGuid, AccountMgr::IsAdminAccount(AccountMgr::GetSecurity(accountId, realmID))); ticket->SaveToDB(trans); sTicketMgr->UpdateLastChange(); |
