From 8b2165cf187d7de5af20a09fffdca5cae0fb32fa Mon Sep 17 00:00:00 2001 From: Samual Lenks Date: Fri, 21 Sep 2012 17:06:32 -0400 Subject: [PATCH] Fix minor issue with vehicles, plus implement dropped capture delay --- gamemodes.cfg | 3 ++- qcsrc/server/autocvars.qh | 1 + qcsrc/server/mutators/gamemode_ctf.qc | 7 ++++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/gamemodes.cfg b/gamemodes.cfg index b20c9136b..9d8048788 100644 --- a/gamemodes.cfg +++ b/gamemodes.cfg @@ -185,10 +185,11 @@ set g_ctf_flagcarrier_damagefactor 1 set g_ctf_flagcarrier_forcefactor 1 set g_ctf_flagcarrier_waypointforenemy_stalemate 60 "show the enemy flagcarrier location after both teams have held the flags for this amount of time" set g_ctf_flagcarrier_waypointforenemy_spotting 1 "show the enemy flagcarrier location if a team mate presses +use to spot them" +set g_ctf_dropped_capture_delay 1 "dropped capture delay" set g_ctf_dropped_capture_radius 100 "allow dropped flags to be automatically captured by base flags if the dropped flag is within this radius of it" set g_ctf_flag_damageforcescale 2 set g_ctf_portalteleport 0 "allow flag carriers to go through portals made in portal gun without dropping the flag" -set g_ctf_reverse 0 "if enabled, flags positions are switched: you have to capture the enemy's flag from your own base by bringing it to your own flag in the enemy base" +set g_ctf_reverse 0 "if enabled, flags positions are switched: you have to capture the enemy's flag from your own base by bringing it to your own flag in the enemy base" set g_ctf_flag_collect_delay 1 set g_ctf_flag_health 0 set g_ctf_flag_dropped_waypoint 2 "show dropped flag waypointsprite when a flag is lost. 1 = team only, 2 = for all players" diff --git a/qcsrc/server/autocvars.qh b/qcsrc/server/autocvars.qh index af2459f83..0517dcf10 100644 --- a/qcsrc/server/autocvars.qh +++ b/qcsrc/server/autocvars.qh @@ -823,6 +823,7 @@ float autocvar_g_ctf_shield_force; float autocvar_g_ctf_shield_max_ratio; float autocvar_g_ctf_shield_min_negscore; float autocvar_g_ctf_reverse; +float autocvar_g_ctf_dropped_capture_delay; float autocvar_g_ctf_dropped_capture_radius; float autocvar_g_cts_finish_kill_delay; float autocvar_g_cts_selfdamage; diff --git a/qcsrc/server/mutators/gamemode_ctf.qc b/qcsrc/server/mutators/gamemode_ctf.qc index 18485d716..b12e28578 100644 --- a/qcsrc/server/mutators/gamemode_ctf.qc +++ b/qcsrc/server/mutators/gamemode_ctf.qc @@ -691,8 +691,9 @@ void ctf_FlagThink() { for(tmp_entity = ctf_worldflaglist; tmp_entity; tmp_entity = tmp_entity.ctf_worldflagnext) if(tmp_entity.ctf_status == FLAG_DROPPED) - if(vlen(self.origin - tmp_entity.origin) < autocvar_g_ctf_dropped_capture_radius) - ctf_Handle_Capture(self, tmp_entity, CAPTURE_DROPPED); + if(vlen(self.origin - tmp_entity.origin) < autocvar_g_ctf_dropped_capture_radius) + if(time > tmp_entity.ctf_droptime + autocvar_g_ctf_dropped_capture_delay) + ctf_Handle_Capture(self, tmp_entity, CAPTURE_DROPPED); } return; } @@ -1890,7 +1891,7 @@ MUTATOR_HOOKFUNCTION(ctf_VehicleEnter) { if(vh_player.flagcarried) { - if(!autocvar_g_ctf_allow_vehicle_carry) + if(!autocvar_g_ctf_allow_vehicle_carry && !autocvar_g_ctf_allow_vehicle_touch) { ctf_Handle_Throw(vh_player, world, DROP_NORMAL); } -- 2.39.2