From: Samual Date: Sun, 1 Apr 2012 04:46:17 +0000 (-0400) Subject: Fix two bugs (multiple captures at once bug, and issue with flag touching bug) X-Git-Tag: xonotic-v0.7.0~240^2~126 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=dd60f3ac2a7199b254091388d89766e50751b290;p=xonotic%2Fxonotic-data.pk3dir.git Fix two bugs (multiple captures at once bug, and issue with flag touching bug) --- 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;