r4713 - trunk/data/qcsrc/server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Fri Oct 10 11:30:48 EDT 2008


Author: div0
Date: 2008-10-10 11:30:48 -0400 (Fri, 10 Oct 2008)
New Revision: 4713

Modified:
   trunk/data/qcsrc/server/ctf.qc
Log:
correctly track player ID of last holding player


Modified: trunk/data/qcsrc/server/ctf.qc
===================================================================
--- trunk/data/qcsrc/server/ctf.qc	2008-10-10 15:21:05 UTC (rev 4712)
+++ trunk/data/qcsrc/server/ctf.qc	2008-10-10 15:30:48 UTC (rev 4713)
@@ -1,6 +1,7 @@
 .entity sprite;
 entity ctf_worldflaglist; // CTF flags in the map
 .entity ctf_worldflagnext;
+.float dropperid;
 
 .float next_take_time;			// the next time a player can pick up a flag (time + blah)
 								/// I used this, in part, to fix the looping score bug. - avirox
@@ -328,6 +329,7 @@
 		self.angles = '0 0 0';
 		bprint(other.netname, "^7 got the ", self.netname, "\n");
 		UpdateFrags(other, ctf_score_value("score_pickup_base"));
+		self.dropperid = other.playerid;
 		PlayerScore_Add(other, SP_CTF_PICKUPS, 1);
 		LogCTF("steal", self.team, other);
 		sound (other, CHAN_AUTO, self.noise, VOL_BASE, ATTN_NONE);
@@ -356,7 +358,7 @@
 
 			// punish the player who last had it
 			FOR_EACH_PLAYER(player)
-				if(player.playerid == self.playerid)
+				if(player.playerid == self.dropperid)
 					PlayerScore_Add(player, SP_SCORE, -ctf_score_value("penalty_returned"));
 
 			// punish the team who was last carrying it
@@ -401,6 +403,7 @@
 			f = ctf_score_value("score_pickup_dropped_late") * (1-f)
 			  + ctf_score_value("score_pickup_dropped_early") * f;
 			f = floor(f + 0.5);
+			self.dropperid = other.playerid;
 			//print("score is ", ftos(f), "\n");
 
 			UpdateFrags(other, f);




More information about the nexuiz-commits mailing list