r2037 - branches/nexuiz-2.0/data/qcsrc/server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Tue Dec 12 01:24:49 EST 2006


Author: div0
Date: 2006-12-12 01:24:49 -0500 (Tue, 12 Dec 2006)
New Revision: 2037

Modified:
   branches/nexuiz-2.0/data/qcsrc/server/g_world.qc
Log:
developer 1 -> try to find that LMS bug... switch developer to 1 when it happens again


Modified: branches/nexuiz-2.0/data/qcsrc/server/g_world.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/g_world.qc	2006-12-11 22:58:53 UTC (rev 2036)
+++ branches/nexuiz-2.0/data/qcsrc/server/g_world.qc	2006-12-12 06:24:49 UTC (rev 2037)
@@ -975,9 +975,42 @@
 {
 	entity head;
 
-	if(lms_dead_count < 0)
-		lms_dead_count = 0;
+	if(cvar("developer"))
+	{
+		float real_dead_count;
+		float real_player_count;
+		for(head = world; (head = find(head, classname, "player")); )
+		{
+			if(head.frags < 1)
+				real_dead_count += 1;
+			real_player_count += 1;
+		}
+		for(head = world; (head = find(head, classname, "observer")); )
+		{
+			if(head.frags < 1)
+				real_dead_count += 1;
+			real_player_count += 1;
+		}
+		for(head = world; (head = find(head, classname, "spectator")); )
+		{
+			if(head.frags < 1)
+				real_dead_count += 1;
+			real_player_count += 1;
+		}
 
+		if(player_count != real_player_count)
+		{
+			dprint("ERROR: ", ftos(player_count), " is not ");
+			dprint(ftos(real_player_count), " -> player count mismatch\n");
+		}
+
+		if(lms_dead_count != real_dead_count)
+		{
+			dprint("ERROR: ", ftos(lms_dead_count), " is not ");
+			dprint(ftos(real_dead_count), " -> dead count mismatch\n");
+		}
+	}
+
 	if(player_count > 1 && lms_dead_count >= player_count - 1)
 		return WINNING_YES; // He's the last man standing!
 




More information about the nexuiz-commits mailing list