From d968a0457bbaaa277356c05e90f83b88f2d30da9 Mon Sep 17 00:00:00 2001
From: megamage <none@none>
Date: Wed, 31 Dec 2008 15:26:51 -0600
Subject: *Fix gm_tickets sql. By Machiavelli.

--HG--
branch : trunk
---
 sql/updates/725_characters.sql | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'sql/updates/725_characters.sql')

diff --git a/sql/updates/725_characters.sql b/sql/updates/725_characters.sql
index c875bf9399c..6be4ef0e4cf 100644
--- a/sql/updates/725_characters.sql
+++ b/sql/updates/725_characters.sql
@@ -3,4 +3,4 @@ ALTER TABLE gm_tickets CHANGE `guid` `playerGuid` int(11) unsigned NOT NULL defa
 ALTER TABLE gm_tickets CHANGE `ticket_id` `guid` int(11) unsigned NOT NULL default '0'; 
 ALTER TABLE gm_tickets CHANGE `ticket_text` `message` text(0) NOT NULL;
 ALTER TABLE gm_tickets CHANGE `ticket_lastchange` `timestamp` int(10) NOT NULL default '0';
-ALTER TABLE gm_tickets ADD( `closed` bit(1) NOT NULL, `assignedto` int(10) NOT NULL default '0', `comment` text(0) NOT NULL default '');
\ No newline at end of file
+ALTER TABLE gm_tickets ADD( `closed` bit(1) NOT NULL, `assignedto` int(10) NOT NULL default '0');
\ No newline at end of file
-- 
cgit v1.2.3


From 657b4257b2bf476d5655c692fa47a294da1edf5e Mon Sep 17 00:00:00 2001
From: Blaymoira <none@none>
Date: Thu, 1 Jan 2009 20:25:14 +0100
Subject: * Fix obsolete string parsing * Change trinity_string entry * Fix
 improper syntax error messages * Fix crash issue when commenting a ticket *
 By Machiavelli

--HG--
branch : trunk
---
 sql/updates/725_characters.sql |  3 +--
 sql/updates/747_world.sql      |  1 +
 src/game/Level1.cpp            | 12 +++++-------
 3 files changed, 7 insertions(+), 9 deletions(-)
 create mode 100644 sql/updates/747_world.sql

(limited to 'sql/updates/725_characters.sql')

diff --git a/sql/updates/725_characters.sql b/sql/updates/725_characters.sql
index 6be4ef0e4cf..17a87769b12 100644
--- a/sql/updates/725_characters.sql
+++ b/sql/updates/725_characters.sql
@@ -2,5 +2,4 @@ ALTER TABLE `character_ticket` RENAME TO `gm_tickets`;
 ALTER TABLE gm_tickets CHANGE `guid` `playerGuid` int(11) unsigned NOT NULL default '0'; 
 ALTER TABLE gm_tickets CHANGE `ticket_id` `guid` int(11) unsigned NOT NULL default '0'; 
 ALTER TABLE gm_tickets CHANGE `ticket_text` `message` text(0) NOT NULL;
-ALTER TABLE gm_tickets CHANGE `ticket_lastchange` `timestamp` int(10) NOT NULL default '0';
-ALTER TABLE gm_tickets ADD( `closed` bit(1) NOT NULL, `assignedto` int(10) NOT NULL default '0');
\ No newline at end of file
+ALTER TABLE gm_tickets CHANGE `ticket_lastchange` `timestamp` int(10) NOT NULL default '0';
\ No newline at end of file
diff --git a/sql/updates/747_world.sql b/sql/updates/747_world.sql
new file mode 100644
index 00000000000..b526781b141
--- /dev/null
+++ b/sql/updates/747_world.sql
@@ -0,0 +1 @@
+UPDATE `trinity_string` SET `content_default`='Ticket %d is already assigned.' WHERE (`entry`='2008');
\ No newline at end of file
diff --git a/src/game/Level1.cpp b/src/game/Level1.cpp
index 00f0ec47ffd..1566d16c66c 100644
--- a/src/game/Level1.cpp
+++ b/src/game/Level1.cpp
@@ -419,7 +419,7 @@ bool ChatHandler::HandleGMTicketAssignToCommand(const char* args)
 	std::string targm = targetgm;
 
 	if(!normalizePlayerName(targm))
-		return false;
+		return true;
 
 	Player *cplr = m_session->GetPlayer();
 	std::string gmname;
@@ -503,7 +503,7 @@ bool ChatHandler::HandleGMTicketUnAssignCommand(const char* args)
 
 bool ChatHandler::HandleGMTicketCommentCommand(const char* args)
 {
-	if(!args)
+	if(!*args)
 		return false;
 
 	char* tguid = strtok((char*)args, " ");
@@ -513,7 +513,6 @@ bool ChatHandler::HandleGMTicketCommentCommand(const char* args)
 	if(!comment)
 		return false;
 
-	std::string gmname; 
 	Player *cplr = m_session->GetPlayer();
 	GM_Ticket *ticket = ticketmgr.GetGMTicket(ticketGuid);
 
@@ -522,10 +521,9 @@ bool ChatHandler::HandleGMTicketCommentCommand(const char* args)
 		PSendSysMessage(LANG_COMMAND_TICKETNOTEXIST);
 		return true;
 	}
-	if(ticket->assignedToGM == 0 && ticket->assignedToGM != cplr->GetGUID())
+	if(ticket->assignedToGM != 0 && ticket->assignedToGM != cplr->GetGUID())
 	{
-		gmname = objmgr.GetPlayer(ticket->assignedToGM)->GetName();
-		PSendSysMessage(LANG_COMMAND_TICKETALREADYASSIGNED, ticket->guid, gmname.c_str());
+		PSendSysMessage(LANG_COMMAND_TICKETALREADYASSIGNED, ticket->guid);
 		return true;
 	}
 
@@ -549,7 +547,7 @@ bool ChatHandler::HandleGMTicketDeleteByIdCommand(const char* args)
 
 	if(!ticket)
 	{
-		PSendSysMessage(LANG_COMMAND_TICKETNOTEXIST, ticketGuid);
+		SendSysMessage(LANG_COMMAND_TICKETNOTEXIST);
 		return true;
 	}
 	if(!ticket->closed == 1)
-- 
cgit v1.2.3

