From: Samual Date: Sat, 31 Mar 2012 17:33:20 +0000 (-0400) Subject: Add antispam for passing flags X-Git-Tag: xonotic-v0.7.0~240^2~140 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=d8e679ea66ddc7fcf4da9ce54f55950c9e63f4b8;p=xonotic%2Fxonotic-data.pk3dir.git Add antispam for passing flags --- diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index 25936ffc5..52713c2e9 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -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" diff --git a/qcsrc/server/autocvars.qh b/qcsrc/server/autocvars.qh index f08c88e53..966965b4b 100644 --- a/qcsrc/server/autocvars.qh +++ b/qcsrc/server/autocvars.qh @@ -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; diff --git a/qcsrc/server/mutators/gamemode_ctf.qc b/qcsrc/server/mutators/gamemode_ctf.qc index 7fe260df7..ae2ed1cc7 100644 --- a/qcsrc/server/mutators/gamemode_ctf.qc +++ b/qcsrc/server/mutators/gamemode_ctf.qc @@ -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)