mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2025-11-29 17:38:24 +08:00
Script/Commands: enhance .ticket complete command
This commit is contained in:
@@ -223,7 +223,9 @@ public:
|
|||||||
if (!*args)
|
if (!*args)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
uint32 ticketId = atoi(args);
|
char* ticketIdStr = strtok((char*)args, " ");
|
||||||
|
uint32 ticketId = atoi(ticketIdStr);
|
||||||
|
|
||||||
GmTicket* ticket = sTicketMgr->GetTicket(ticketId);
|
GmTicket* ticket = sTicketMgr->GetTicket(ticketId);
|
||||||
if (!ticket || ticket->IsClosed() || ticket->IsCompleted())
|
if (!ticket || ticket->IsClosed() || ticket->IsCompleted())
|
||||||
{
|
{
|
||||||
@@ -231,6 +233,20 @@ public:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char* response = strtok(NULL, "\n");
|
||||||
|
if (response)
|
||||||
|
{
|
||||||
|
// Cannot add response to ticket, assigned to someone else
|
||||||
|
//! Console excluded
|
||||||
|
Player* player = handler->GetSession() ? handler->GetSession()->GetPlayer() : nullptr;
|
||||||
|
if (player && ticket->IsAssignedNotTo(player->GetGUID()))
|
||||||
|
{
|
||||||
|
handler->PSendSysMessage(LANG_COMMAND_TICKETALREADYASSIGNED, ticket->GetId());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
ticket->AppendResponse(response);
|
||||||
|
}
|
||||||
|
|
||||||
if (Player* player = ticket->GetPlayer())
|
if (Player* player = ticket->GetPlayer())
|
||||||
ticket->SendResponse(player->GetSession());
|
ticket->SendResponse(player->GetSession());
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user