From: Mario Date: Tue, 24 Mar 2020 12:39:04 +0000 (+1000) Subject: Add an option to apply campcheck rules to players who are typing (off by default) X-Git-Tag: xonotic-v0.8.5~1144^2~10 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=f4ed566f2c26494c04c716bd47a07eae5b46a518;p=xonotic%2Fxonotic-data.pk3dir.git Add an option to apply campcheck rules to players who are typing (off by default) --- diff --git a/mutators.cfg b/mutators.cfg index abf689625..f3ed5e076 100644 --- a/mutators.cfg +++ b/mutators.cfg @@ -290,6 +290,7 @@ set g_campcheck 0 "damages campers every few seconds" set g_campcheck_interval 10 set g_campcheck_damage 100 set g_campcheck_distance 1800 +set g_campcheck_typecheck 0 "damage campers who are typing" // ========== diff --git a/qcsrc/common/mutators/mutator/campcheck/sv_campcheck.qc b/qcsrc/common/mutators/mutator/campcheck/sv_campcheck.qc index 97e63161d..55f74ca11 100644 --- a/qcsrc/common/mutators/mutator/campcheck/sv_campcheck.qc +++ b/qcsrc/common/mutators/mutator/campcheck/sv_campcheck.qc @@ -4,6 +4,7 @@ string autocvar_g_campcheck; float autocvar_g_campcheck_damage; float autocvar_g_campcheck_distance; float autocvar_g_campcheck_interval; +bool autocvar_g_campcheck_typecheck; REGISTER_MUTATOR(campcheck, expr_evaluate(autocvar_g_campcheck)); @@ -43,7 +44,7 @@ MUTATOR_HOOKFUNCTION(campcheck, PlayerPreThink) if(IS_PLAYER(player)) if(!IS_DEAD(player)) if(!STAT(FROZEN, player)) - if(!PHYS_INPUT_BUTTON_CHAT(player)) + if(autocvar_g_campcheck_typecheck || !PHYS_INPUT_BUTTON_CHAT(player)) if(IS_REAL_CLIENT(player)) // bots may camp, but that's no reason to constantly kill them if(!weaponLocked(player)) {