From 625605c14aecb026e5a59b53c1f8a90b3e8e8995 Mon Sep 17 00:00:00 2001 From: div0 Date: Fri, 10 Oct 2008 15:30:48 +0000 Subject: [PATCH] correctly track player ID of last holding player git-svn-id: svn://svn.icculus.org/nexuiz/trunk@4713 f962a42d-fe04-0410-a3ab-8c8b0445ebaa --- data/qcsrc/server/ctf.qc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/data/qcsrc/server/ctf.qc b/data/qcsrc/server/ctf.qc index 130478b5e..67d931462 100644 --- a/data/qcsrc/server/ctf.qc +++ b/data/qcsrc/server/ctf.qc @@ -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 @@ void FlagTouch() 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 @@ void FlagTouch() // 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 @@ void FlagTouch() 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); -- 2.39.2