]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add antispam for passing flags
authorSamual <samual@xonotic.org>
Sat, 31 Mar 2012 17:33:20 +0000 (13:33 -0400)
committerSamual <samual@xonotic.org>
Sat, 31 Mar 2012 17:33:20 +0000 (13:33 -0400)
defaultXonotic.cfg
qcsrc/server/autocvars.qh
qcsrc/server/mutators/gamemode_ctf.qc

index 25936ffc5b2de2bf51453bbe2f11cabc359dfb3f..52713c2e9d516f26cb80b5272bee322090748d05 100644 (file)
@@ -610,9 +610,9 @@ set g_ctf_flag_return_when_unreachable 1 "automatically return the flag if it fa
 set g_ctf_throw_velocity 500 "how far a player can throw the flag"
 set g_ctf_allow_pass 1 "allow passing of flags to nearby team mates"
 set g_ctf_pass_radius 200 "maximum radius that you can pass to a team mate in"
+set g_ctf_pass_wait 2 "delay in seconds between how often players can pass the flag (antispam, essentially)"
 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_shield_max_ratio 0   "shield at most this percentage of a team from the enemy flag (try: 0.4 for 40%)"
 set g_ctf_shield_min_negscore 20       "shield the player from the flag if he's got this negative amount of points or less"
 set g_ctf_shield_force 100     "push force of the shield"
index f08c88e53ff95ad01898052345b5da9bc955a639..966965b4b1e61a9afc057fefd1ee7e900f004b7f 100644 (file)
@@ -763,6 +763,7 @@ float autocvar_g_chat_teamcolors;
 float autocvar_g_ctf_allow_drop;
 float autocvar_g_ctf_allow_pass;
 float autocvar_g_ctf_pass_radius;
+float autocvar_g_ctf_pass_wait;
 float autocvar_g_ctf_throw_velocity;
 float autocvar_g_ctf_captimerecord_always;
 float autocvar_g_ctf_dynamiclights;
index 7fe260df71ce44ebe7c601b9c26495334d501b4d..ae2ed1cc7ebad79740d14a4f6ff9c6751cf60286 100644 (file)
@@ -130,6 +130,7 @@ void ctf_Handle_Pass(entity player, entity reciever)
        entity tmp_player; // temporary entity which the FOR_EACH_PLAYER loop uses to scan players
        entity flag = player.flagcarried;
        if(!flag) { return; }
+       if(time < flag.wait) { return; } // antispam of passing
        
        // reset player
        player.flagcarried = world;
@@ -163,6 +164,8 @@ void ctf_Handle_Pass(entity player, entity reciever)
        WaypointSprite_UpdateMaxHealth(reciever.wps_flagcarrier, '1 0 0' * healtharmor_maxdamage(start_health, start_armorvalue, autocvar_g_balance_armor_blockpercent) * 2);
        WaypointSprite_UpdateHealth(reciever.wps_flagcarrier, '1 0 0' * healtharmor_maxdamage(reciever.health, reciever.armorvalue, autocvar_g_balance_armor_blockpercent));
        WaypointSprite_UpdateTeamRadar(reciever.wps_flagcarrier, RADARICON_FLAGCARRIER, '1 1 0');
+       
+       flag.wait = time + autocvar_g_ctf_pass_wait;
 }
 
 void ctf_Handle_Drop(entity player, float droptype)