mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 09:17:18 +00:00
fix(Scripts/Command): ticket comment should allow input (#17891)
fix(Scripts/Command): gm comment should allow input * closes https://github.com/azerothcore/azerothcore-wotlk/issues/17877
This commit is contained in:
@@ -158,10 +158,9 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleGMTicketCommentCommand(ChatHandler* handler, uint32 ticketId)
|
||||
static bool HandleGMTicketCommentCommand(ChatHandler* handler, uint32 ticketId, Tail comment)
|
||||
{
|
||||
char* comment = strtok(nullptr, "\n");
|
||||
if (!comment)
|
||||
if (comment.empty())
|
||||
return false;
|
||||
|
||||
GmTicket* ticket = sTicketMgr->GetTicket(ticketId);
|
||||
@@ -180,14 +179,14 @@ public:
|
||||
}
|
||||
|
||||
CharacterDatabaseTransaction trans = CharacterDatabaseTransaction(nullptr);
|
||||
ticket->SetComment(comment);
|
||||
ticket->SetComment(comment.data());
|
||||
ticket->SaveToDB(trans);
|
||||
sTicketMgr->UpdateLastChange();
|
||||
|
||||
std::string const assignedName = ticket->GetAssignedToName();
|
||||
std::string msg = ticket->FormatMessageString(*handler, assignedName.empty() ? nullptr : assignedName.c_str(), nullptr, nullptr, nullptr);
|
||||
|
||||
msg += handler->PGetParseString(LANG_COMMAND_TICKETLISTADDCOMMENT, player ? player->GetName().c_str() : "Console", comment);
|
||||
msg += handler->PGetParseString(LANG_COMMAND_TICKETLISTADDCOMMENT, player ? player->GetName().c_str() : "Console", comment.data());
|
||||
handler->SendGlobalGMSysMessage(msg.c_str());
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user