]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mutators/mutator/campcheck/sv_campcheck.qc
Add an option to apply campcheck rules to players who are typing (off by default)
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mutators / mutator / campcheck / sv_campcheck.qc
index e56d044669b353aa346bde74cb4c829565c40e1d..55f74ca11417751849e969ed48e6583b00294557 100644 (file)
@@ -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,9 +44,9 @@ 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(!forbidWeaponUse(player))
+       if(!weaponLocked(player))
        {
                // calculate player movement (in 2 dimensions only, so jumping on one spot doesn't count as movement)
                vector dist = vec2(player.campcheck_prevorigin - player.origin);