From dd60f3ac2a7199b254091388d89766e50751b290 Mon Sep 17 00:00:00 2001 From: Samual Date: Sun, 1 Apr 2012 00:46:17 -0400 Subject: [PATCH] Fix two bugs (multiple captures at once bug, and issue with flag touching bug) --- qcsrc/server/mutators/gamemode_ctf.qc | 10 +++++++--- qcsrc/server/mutators/gamemode_ctf.qh | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/qcsrc/server/mutators/gamemode_ctf.qc b/qcsrc/server/mutators/gamemode_ctf.qc index f13004713..50f11caec 100644 --- a/qcsrc/server/mutators/gamemode_ctf.qc +++ b/qcsrc/server/mutators/gamemode_ctf.qc @@ -294,6 +294,8 @@ void ctf_Handle_Throw(entity player, entity reciever, float droptype) } } + print("flag.velocity = ", vtos(flag.velocity), ".\n"); + switch(droptype) { case DROPTYPE_PASS: @@ -382,6 +384,8 @@ void ctf_Handle_Dropped_Capture(entity flag, entity enemy_flag) //shockwave_spawn("models/ctf/shockwavetransring.md3", flag.origin - '0 0 15', -0.8, 0, 1); } + player.next_take_time = time + autocvar_g_ctf_flag_collect_delay; + // reset the flag ctf_RespawnFlag(enemy_flag); } @@ -409,6 +413,7 @@ void ctf_Handle_Capture(entity flag, entity player) // reset the flag if(flag.speedrunning) { ctf_FakeTimeLimit(player, -1); } + player.next_take_time = time + autocvar_g_ctf_flag_collect_delay; ctf_RespawnFlag(player.flagcarried); } @@ -675,6 +680,7 @@ void ctf_FlagTouch() { pointparticles(particleeffectnum("kaball_sparks"), self.origin, '0 0 0', 1); sound(self, CH_TRIGGER, self.snd_flag_touch, VOL_BASE, ATTN_NORM); + self.wait = time + FLAG_TOUCHRATE; } return; } @@ -685,7 +691,7 @@ void ctf_FlagTouch() { if((other.team == self.team) && (other.flagcarried) && (other.flagcarried.team != self.team)) ctf_Handle_Capture(self, other); // other just captured the enemies flag to his base - else if((other.team != self.team) && (!other.flagcarried) && (!other.ctf_captureshielded)) + else if((other.team != self.team) && (!other.flagcarried) && (!other.ctf_captureshielded) && (time > other.next_take_time)) ctf_Handle_Pickup_Base(self, other); // other just stole the enemies flag break; } @@ -723,8 +729,6 @@ void ctf_FlagTouch() break; } } - - self.wait = time + FLAG_TOUCHRATE; } void ctf_RespawnFlag(entity flag) diff --git a/qcsrc/server/mutators/gamemode_ctf.qh b/qcsrc/server/mutators/gamemode_ctf.qh index 38f48b4e2..e191df71a 100644 --- a/qcsrc/server/mutators/gamemode_ctf.qh +++ b/qcsrc/server/mutators/gamemode_ctf.qh @@ -71,6 +71,7 @@ float ctf_captimerecord; // record time for capturing the flag .entity ctf_carrier; .entity ctf_dropper; // don't allow spam of dropping the flag .float max_flag_health; +.float next_take_time; // passing properties .entity pass_sender; -- 2.39.2