r5032 - trunk/data/qcsrc/server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Mon Nov 10 07:36:45 EST 2008


Author: div0
Date: 2008-11-10 07:36:45 -0500 (Mon, 10 Nov 2008)
New Revision: 5032

Modified:
   trunk/data/qcsrc/server/ctf.qc
Log:
ctf: block capture records when having >1 player on the server (bots are still allowed).


Modified: trunk/data/qcsrc/server/ctf.qc
===================================================================
--- trunk/data/qcsrc/server/ctf.qc	2008-11-10 11:32:55 UTC (rev 5031)
+++ trunk/data/qcsrc/server/ctf.qc	2008-11-10 12:36:45 UTC (rev 5032)
@@ -392,35 +392,38 @@
 		{
 			return;
 		}
-		t = time - other.flagcarried.flagpickuptime;
-		s = ftos_decimals(t, 2);
-		s0 = ftos_decimals(flagcaptimerecord, 2);
-		h0 = db_get(ServerProgsDB, strcat(GetMapname(), "/captimerecord/netname"));
-		h1 = other.netname;
-		if(h0 == h1)
-			h0 = "his";
-		else
-			h0 = strcat(h0, "^7's"); // h0: display text for previous netname
-		if (flagcaptimerecord == 0)
+		if(player_count - currentbots <= 1) // at most one human
 		{
-			bprint(other.netname, "^7 captured the ", other.flagcarried.netname, " in ", s, " seconds\n");
-			flagcaptimerecord = t;
-			db_put(ServerProgsDB, strcat(GetMapname(), "/captimerecord/time"), ftos(t));
-			db_put(ServerProgsDB, strcat(GetMapname(), "/captimerecord/netname"), h1);
-			GameLogEcho(strcat(":recordset:", ftos(other.playerid), ":", ftos(t)));
+			t = time - other.flagcarried.flagpickuptime;
+			s = ftos_decimals(t, 2);
+			s0 = ftos_decimals(flagcaptimerecord, 2);
+			h0 = db_get(ServerProgsDB, strcat(GetMapname(), "/captimerecord/netname"));
+			h1 = other.netname;
+			if(h0 == h1)
+				h0 = "his";
+			else
+				h0 = strcat(h0, "^7's"); // h0: display text for previous netname
+			if (flagcaptimerecord == 0)
+			{
+				bprint(other.netname, "^7 captured the ", other.flagcarried.netname, " in ", s, " seconds\n");
+				flagcaptimerecord = t;
+				db_put(ServerProgsDB, strcat(GetMapname(), "/captimerecord/time"), ftos(t));
+				db_put(ServerProgsDB, strcat(GetMapname(), "/captimerecord/netname"), h1);
+				GameLogEcho(strcat(":recordset:", ftos(other.playerid), ":", ftos(t)));
+			}
+			else if (t < flagcaptimerecord)
+			{
+				bprint(other.netname, "^7 captured the ", other.flagcarried.netname, " in ", s, ", breaking ", strcat(h0, " previous record of ", s0, " seconds\n"));
+				flagcaptimerecord = t;
+				db_put(ServerProgsDB, strcat(GetMapname(), "/captimerecord/time"), ftos(t));
+				db_put(ServerProgsDB, strcat(GetMapname(), "/captimerecord/netname"), h1);
+				GameLogEcho(strcat(":recordset:", ftos(other.playerid), ":", ftos(t)));
+			}
+			else
+			{
+				bprint(other.netname, "^7 captured the ", other.flagcarried.netname, " in ", s, ", failing to break ", strcat(h0, " record of ", s0, " seconds\n"));
+			}
 		}
-		else if (t < flagcaptimerecord)
-		{
-			bprint(other.netname, "^7 captured the ", other.flagcarried.netname, " in ", s, ", breaking ", strcat(h0, " previous record of ", s0, " seconds\n"));
-			flagcaptimerecord = t;
-			db_put(ServerProgsDB, strcat(GetMapname(), "/captimerecord/time"), ftos(t));
-			db_put(ServerProgsDB, strcat(GetMapname(), "/captimerecord/netname"), h1);
-			GameLogEcho(strcat(":recordset:", ftos(other.playerid), ":", ftos(t)));
-		}
-		else
-		{
-			bprint(other.netname, "^7 captured the ", other.flagcarried.netname, " in ", s, ", failing to break ", strcat(h0, " record of ", s0, " seconds\n"));
-		}
 
 		PlayerTeamScore_Add(other, SP_CTF_CAPS, ST_CTF_CAPS, 1);
 		LogCTF("capture", other.flagcarried.team, other);




More information about the nexuiz-commits mailing list