[mw-devel] MW3 r1014 - trunk/src

firefury at sucs.org firefury at sucs.org
Thu Mar 20 17:30:42 GMT 2008


Author: firefury
Date: 2008-03-20 17:30:42 +0000 (Thu, 20 Mar 2008)
New Revision: 1014

Modified:
   trunk/src/talker.c
Log:
Fix soundproof rooms


Modified: trunk/src/talker.c
===================================================================
--- trunk/src/talker.c	2008-03-20 16:49:17 UTC (rev 1013)
+++ trunk/src/talker.c	2008-03-20 17:30:42 UTC (rev 1014)
@@ -68,7 +68,7 @@
 extern int g_boTermCap;
 
 static int send_filter_oneroom(const struct person * usr, const void * info) {
-	// Everyone in the current room except people with global turned on
+	// Everyone in a room except people with global turned on
 	int	channel = *(int*) info;
 
 	if (! cm_flags(usr->chatmode, CM_ONCHAT, CM_MODE_ALL)) return 0;
@@ -78,7 +78,7 @@
 }
 
 static int send_filter_nonglobal(const struct person * usr, const void * info) {
-	// Everyone outside the current room with global turned off
+	// Everyone outside a room with global turned off
 	int	channel = *(int*) info;
 
 	if (! cm_flags(usr->chatmode, CM_ONCHAT, CM_MODE_ALL)) return 0;
@@ -88,7 +88,9 @@
 }
 
 static int send_filter_global(const struct person * usr, const void * info) {
-	// Everyone outside the current room with global turned on
+	// Everyone with global turned on
+	// Except if the room is soundproof - in that case only people in
+	// the room with global turned on.
 	int		channel = *(int*) info;
 	int		sproof=0;
 	struct room	tmp_room;
@@ -96,13 +98,13 @@
 	if (! cm_flags(usr->chatmode, CM_ONCHAT, CM_MODE_ALL)) return 0;
 	if (! cm_flags(usr->chatmode, CM_GLOBAL, CM_MODE_ALL)) return 0;
 
-	if (user->room == channel) return 1;
+	if (usr->room == channel) return 1; // Users on the channel always get it
 
 	RoomInit(&tmp_room);
 	if (LoadRoom(&tmp_room, channel) && (tmp_room.sproof>0)) sproof=1;
 	RoomDestroy(&tmp_room);
 	
-	return ((usr->room == channel) || (! sproof));
+	return (! sproof);
 }
 
 static void talk_send_to_room(const char * text, int channel) {





More information about the mw-devel mailing list