]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add a hidden option to allow checkpoints to not count as a cheat
authorMario <mario@smbclan.net>
Mon, 13 Feb 2017 07:54:14 +0000 (17:54 +1000)
committerMario <mario@smbclan.net>
Mon, 13 Feb 2017 07:54:14 +0000 (17:54 +1000)
qcsrc/server/cheats.qc

index 631f382278becf7486a0b5dd9d47d905d0e7f10d..421de5373d833b2e1d77cac89ff7c0655ece9d48 100644 (file)
@@ -131,6 +131,7 @@ spawnfunc(info_autoscreenshot)
        // this one just has to exist
 }
 
+bool autocvar_g_allow_checkpoints;
 float CheatImpulse(entity this, int imp)
 {
        BEGIN_CHEAT_FUNCTION();
@@ -185,7 +186,8 @@ float CheatImpulse(entity this, int imp)
                        CheatCommand(this, tokenize_console("give all"));
                        break; // already counted as cheat
                case CHIMPULSE_SPEEDRUN.impulse:
-                       IS_CHEAT(this, imp, 0, 0);
+                       if(!autocvar_g_allow_checkpoints)
+                               IS_CHEAT(this, imp, 0, 0);
                        if(this.personal)
                        {
                                this.speedrunning = true;