[mw-devel] MW3 r1249 - trunk/src

arthur at sucs.org arthur at sucs.org
Tue Apr 12 20:07:33 BST 2011


Author: arthur
Date: 2011-04-12 20:07:32 +0100 (Tue, 12 Apr 2011)
New Revision: 1249

Modified:
   trunk/src/talker.c
Log:
trap the empty string to clear the topic, shift to colour code 15


Modified: trunk/src/talker.c
===================================================================
--- trunk/src/talker.c	2011-04-12 16:13:46 UTC (rev 1248)
+++ trunk/src/talker.c	2011-04-12 19:07:32 UTC (rev 1249)
@@ -1385,13 +1385,15 @@
 		char text[MAXTEXTLENGTH];
 		const char *topic;
 
+		if (argc == 2 && argv[1][0] == 0) args=NULL;
+
 		db_room_set(user->room, "topic", args);
 		topic = db_room_get(user->room, "topic");
 		if (topic == NULL || *topic == 0) {
-			snprintf(text,MAXTEXTLENGTH-1,"\03314%s has cleared the channel topic.",user->name);
+			snprintf(text,MAXTEXTLENGTH-1,"\03315%s has cleared the channel topic.",user->name);
 			mwlog("TOPIC <empty>");
 		} else {
-			snprintf(text,MAXTEXTLENGTH-1,"\03314%s has set the topic to \"%s\".",user->name, topic);
+			snprintf(text,MAXTEXTLENGTH-1,"\03315%s has set the topic to \"%s\".",user->name, topic);
 			mwlog("TOPIC %s", topic);
 		}
 		talk_send_raw(text,user->room);




More information about the mw-devel mailing list