]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Autocvarize SVQC and CSQC. 20% less CPU usage of dedicated servers with bots. Large...
authorRudolf Polzer <divverent@alientrap.org>
Sat, 4 Dec 2010 15:21:48 +0000 (16:21 +0100)
committerRudolf Polzer <divverent@alientrap.org>
Sat, 4 Dec 2010 15:22:14 +0000 (16:22 +0100)
108 files changed:
qcsrc/autocvarize-update.sh [new file with mode: 0755]
qcsrc/autocvarize.pl [new file with mode: 0644]
qcsrc/client/Main.qc
qcsrc/client/View.qc
qcsrc/client/autocvars.qh
qcsrc/client/bgmscript.qc
qcsrc/client/casings.qc
qcsrc/client/effects.qc
qcsrc/client/gibs.qc
qcsrc/client/hook.qc
qcsrc/client/hud.qc
qcsrc/client/mapvoting.qc
qcsrc/client/miscfunctions.qc
qcsrc/client/particles.qc
qcsrc/client/scoreboard.qc
qcsrc/client/target_music.qc
qcsrc/client/teamradar.qc
qcsrc/client/tuba.qc
qcsrc/client/wall.qc
qcsrc/client/waypointsprites.qc
qcsrc/server/anticheat.qc
qcsrc/server/arena.qc
qcsrc/server/autocvars.qh
qcsrc/server/bot/aim.qc
qcsrc/server/bot/bot.qc
qcsrc/server/bot/havocbot/havocbot.qc
qcsrc/server/bot/havocbot/role_ctf.qc
qcsrc/server/bot/havocbot/role_keyhunt.qc
qcsrc/server/bot/havocbot/role_onslaught.qc
qcsrc/server/bot/havocbot/roles.qc
qcsrc/server/bot/navigation.qc
qcsrc/server/bot/scripting.qc
qcsrc/server/bot/waypoints.qc
qcsrc/server/campaign.qc
qcsrc/server/cheats.qc
qcsrc/server/cl_client.qc
qcsrc/server/cl_impulse.qc
qcsrc/server/cl_physics.qc
qcsrc/server/cl_player.qc
qcsrc/server/cl_weapons.qc
qcsrc/server/cl_weaponsystem.qc
qcsrc/server/clientcommands.qc
qcsrc/server/ctf.qc
qcsrc/server/defs.qh
qcsrc/server/domination.qc
qcsrc/server/g_damage.qc
qcsrc/server/g_hook.qc
qcsrc/server/g_subs.qc
qcsrc/server/g_triggers.qc
qcsrc/server/g_world.qc
qcsrc/server/gamecommand.qc
qcsrc/server/ipban.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/mode_onslaught.qc
qcsrc/server/monsters/m_monsters.qc
qcsrc/server/monsters/monster_zombie.qc
qcsrc/server/mutators/gamemode_freezetag.qc
qcsrc/server/mutators/gamemode_keepaway.qc
qcsrc/server/mutators/gamemode_keyhunt.qc
qcsrc/server/mutators/mutator_dodging.qc
qcsrc/server/mutators/mutator_nix.qc
qcsrc/server/nexball.qc
qcsrc/server/playerstats.qc
qcsrc/server/portals.qc
qcsrc/server/race.qc
qcsrc/server/runematch.qc
qcsrc/server/scores.qc
qcsrc/server/scores_rules.qc
qcsrc/server/sv_main.qc
qcsrc/server/t_items.qc
qcsrc/server/t_jumppads.qc
qcsrc/server/t_plats.qc
qcsrc/server/t_quake3.qc
qcsrc/server/t_teleporters.qc
qcsrc/server/teamplay.qc
qcsrc/server/tturrets/system/system_damage.qc
qcsrc/server/tturrets/system/system_main.qc
qcsrc/server/tturrets/units/unit_ewheel.qc
qcsrc/server/tturrets/units/unit_hellion.qc
qcsrc/server/tturrets/units/unit_hk.qc
qcsrc/server/tturrets/units/unit_machinegun.qc
qcsrc/server/tturrets/units/unit_phaser.qc
qcsrc/server/tturrets/units/unit_targettrigger.qc
qcsrc/server/tturrets/units/unit_walker.qc
qcsrc/server/vehicles/racer.qc
qcsrc/server/vehicles/raptor.qc
qcsrc/server/vehicles/spiderbot.qc
qcsrc/server/vote.qc
qcsrc/server/w_campingrifle.qc
qcsrc/server/w_common.qc
qcsrc/server/w_crylink.qc
qcsrc/server/w_electro.qc
qcsrc/server/w_fireball.qc
qcsrc/server/w_grenadelauncher.qc
qcsrc/server/w_hagar.qc
qcsrc/server/w_hlac.qc
qcsrc/server/w_hook.qc
qcsrc/server/w_laser.qc
qcsrc/server/w_minelayer.qc
qcsrc/server/w_minstanex.qc
qcsrc/server/w_nex.qc
qcsrc/server/w_porto.qc
qcsrc/server/w_rocketlauncher.qc
qcsrc/server/w_seeker.qc
qcsrc/server/w_shotgun.qc
qcsrc/server/w_tuba.qc
qcsrc/server/w_uzi.qc
qcsrc/server/waypointsprites.qc

diff --git a/qcsrc/autocvarize-update.sh b/qcsrc/autocvarize-update.sh
new file mode 100755 (executable)
index 0000000..31ecc08
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/sh
+set -ex
+git checkout divVerent/autocvarizer_test
+trap 'git reset --hard; git checkout divVerent/autocvarizer' EXIT
+trap 'exit 1' INT
+git merge --no-commit -s ours divVerent/autocvarizer
+git read-tree -m -u divVerent/autocvarizer # "theirs"
+find server \( -type f -a \( -name \*.c -o -name \*.qc -o -name \*.h -o -name \*.qh \) \) -print0 | AUTOCVARING_SVQC=1 xargs -0 perl autocvarize.pl > server/autocvars.qh.new
+diff -Nu server/autocvars.qh server/autocvars.qh.new || true
+mv server/autocvars.qh.new server/autocvars.qh
+find client \( -type f -a \( -name \*.c -o -name \*.qc -o -name \*.h -o -name \*.qh \) \) -print0 | xargs -0 perl autocvarize.pl > client/autocvars.qh.new
+diff -Nu client/autocvars.qh client/autocvars.qh.new || true
+mv client/autocvars.qh.new client/autocvars.qh
+if make -C .. FTEQCC=../../../../fteqcc/fteqcc.bin FTEQCCFLAGS=; then
+       echo "Commit? ^C to not"
+       read -r L
+       git add server/autocvars.qh
+       git add client/autocvars.qh
+       git commit -a
+else
+       echo "FAILED. Exit this shell when done examining."
+       sh -i
+fi
diff --git a/qcsrc/autocvarize.pl b/qcsrc/autocvarize.pl
new file mode 100644 (file)
index 0000000..7ac048a
--- /dev/null
@@ -0,0 +1,281 @@
+#!/usr/bin/perl
+# this tool generates JUST the autocvar declarations for cvars
+use strict;
+use warnings;
+
+my @files = @ARGV;
+
+my %cvars = ();
+my %old = ();
+my %menu = ();
+my %defaults = ();
+
+sub found($$$$)
+{
+       my ($name, $type, $default, $force) = @_;
+       if(length $name >= 55)
+       {
+               warn "cvar $name is a Dr. honorificabilitudinitatibis causa BRLOGENSHFEGLE";
+               $type = 'cvar_toolong';
+               return;
+       }
+#      $old{$name} = 1
+#              if $force;
+#      $menu{$name} = 1
+#              if $force > 1;
+       if(exists $cvars{$name} and not defined $cvars{name})
+       {
+               # have already warned
+       }
+       elsif(exists $cvars{$name} and $type ne $cvars{$name})
+       {
+               warn "cvar $name used with different types";
+               if($force)
+               {
+                       $defaults{$name} = $default;
+                       $cvars{$name} = $type;
+               }
+               else
+               {
+                       undef $cvars{$name}
+                               unless $old{$name};
+               }
+               return;
+       }
+       elsif(exists $cvars{$name} and exists $defaults{$name} and $default ne $defaults{$name})
+       {
+               warn "cvar $name used with different defaults";
+               if($force)
+               {
+                       $defaults{$name} = $default;
+                       $cvars{$name} = $type;
+               }
+               else
+               {
+                       undef $cvars{$name}
+                               unless $old{$name};
+               }
+       }
+       else
+       {
+               $defaults{$name} = $default;
+               $cvars{$name} = $type;
+       }
+}
+
+for my $f(@files)
+{
+       print STDERR "In file $f\n";
+       open my $fh, "<", $f;
+       while(<$fh>)
+       {
+               chomp;
+               if(/^\/\/#NO AUTOCVARS START/ .. /^\/\/#NO AUTOCVARS END/)
+               {
+                       next;
+               }
+               s/\/\/.*//;
+               if(/^(?:var )?float autocvar_(\w+);$/)
+               {
+                       found $1, 'cvar', 0, 1;
+                       next;
+               }
+               if(/^var float autocvar_(\w+) = (.*);$/)
+               {
+                       found $1, 'cvar', $2, 1;
+                       next;
+               }
+               if(/^(?:var )?vector autocvar_(\w+);$/)
+               {
+                       found $1, 'cvar_vector', "0 0 0", 1;
+                       next;
+               }
+               if(/^var vector autocvar_(\w+) = '(.*)';$/)
+               {
+                       found $1, 'cvar_vector', $2, 1;
+                       next;
+               }
+               if(/^(?:var )?string autocvar_(\w+);$/)
+               {
+                       found $1, 'cvar_string', "", 1;
+                       next;
+               }
+               if(/^var string autocvar_(\w+) = "(.*)";$/)
+               {
+                       found $1, 'cvar_string', $2, 1;
+                       next;
+               }
+               if(/^#define autocvar_(\w+) cvar("\1")$/)
+               {
+                       found $1, 'cvar', 0, 2;
+                       next;
+               }
+               if(/^#define autocvar_(\w+) cvar_or("\1", (.*))$/)
+               {
+                       found $1, 'cvar', $1, 2;
+                       next;
+               }
+               if(/^#define autocvar_(\w+) cvar_string("\1")$/)
+               {
+                       found $1, 'cvar_string', "", 2;
+                       next;
+               }
+               while(/\bcvar\s*\(\s*"(\w+)"\s*\)/g)
+               {
+                       found $1, 'cvar', 0, 0;
+               }
+               while(/\bcvar_string\s*\(\s*"(\w+)"\s*\)/g)
+               {
+                       found $1, 'cvar_string', "", 0;
+               }
+               while(/\bcvar_vector\s*\(\s*"(\w+)"\s*\)/g)
+               {
+                       found $1, 'cvar_vector', "0 0 0", 0;
+               }
+               while(/\bcvar_or\s*\(\s*"(\w+)"\s*,\s*([^\s)]+)\s*\)/g)
+               {
+                       found $1, 'cvar', $2, 0;
+               }
+       }
+}
+
+if($ENV{AUTOCVARING_SVQC})
+{
+       for my $f(<menu/xonotic/*.c>)
+       {
+               print STDERR "In file $f\n";
+               open my $fh, "<", $f;
+               while(<$fh>)
+               {
+                       for(/"([^"]*)"/g)
+                       {
+                               $menu{$1} = 1;
+                       }
+               }
+       }
+
+       for my $f(<../maps/campaign*.txt>)
+       {
+               print STDERR "In file $f\n";
+               open my $fh, "<", $f;
+               while(<$fh>)
+               {
+                       for(/\b(.+?)\b/g)
+                       {
+                               $menu{$1} = 1;
+                       }
+               }
+       }
+}
+
+for my $name(sort keys %cvars)
+{
+       my $type = $cvars{$name};
+       my $menu = $menu{$name};
+       my $default = $defaults{$name};
+       die "wtf" if $name =~ /\0/;
+       if(not defined $type)
+       {
+               print "// cannot declare $name, it is used with different types\n";
+       }
+       elsif($type eq 'cvar_toolong')
+       {
+               print "// cannot declare $name, name is too long\n";
+       }
+       elsif($type eq 'cvar' and not $menu and $default eq "0")
+       {
+               print "float autocvar_$name;\n";
+       }
+       elsif($type eq 'cvar' and not $menu and $default ne "0")
+       {
+               print "var float autocvar_$name = $default;\n";
+       }
+       elsif($type eq 'cvar_vector' and not $menu and $default eq "0 0 0")
+       {
+               print "vector autocvar_$name;\n";
+       }
+       elsif($type eq 'cvar_vector' and not $menu and $default ne "0 0 0")
+       {
+               print "var vector autocvar_$name = '$default';\n";
+       }
+       elsif($type eq 'cvar_string' and not $menu and $default eq "")
+       {
+               print "string autocvar_$name;\n";
+       }
+       elsif($type eq 'cvar_string' and not $menu and $default ne "")
+       {
+               print "var string autocvar_$name = \"$default\";\n";
+       }
+       elsif($type eq 'cvar' and $menu and $default eq "0")
+       {
+               print "#define autocvar_$name cvar(\"$name\")\n";
+       }
+       elsif($type eq 'cvar' and $menu and $default ne "0")
+       {
+               print "#define autocvar_$name cvar_or(\"$name\", \"$default\")\n";
+       }
+       elsif($type eq 'cvar_string' and $menu) # sorry, no cvar_or for these
+       {
+               print "#define autocvar_$name cvar_string(\"$name\")\n";
+       }
+       elsif($type eq 'cvar_vector' and $menu) # sorry, no cvar_or for these
+       {
+               print "#define autocvar_$name cvar_vector(\"$name\")\n";
+       }
+}
+
+for my $f(@files)
+{
+       print STDERR "In file $f\n";
+       open my $fh, "<", $f;
+       my $out = "";
+       while(<$fh>)
+       {
+               chomp;
+               if(/^\/\/#NO AUTOCVARS START/ .. /^\/\/#NO AUTOCVARS END/)
+               {
+                       $out .= "$_\n";
+                       next;
+               }
+               if(/^(?:var )?float autocvar_(.*);$/)
+               {
+                       $out .= "$_\n";
+                       next;
+               }
+               if(/^(?:var )?string autocvar_(.*);$/)
+               {
+                       $out .= "$_\n";
+                       next;
+               }
+               if(/^#define autocvar_(.*) cvar/)
+               {
+                       $out .= "$_\n";
+                       next;
+               }
+               s{\b(cvar|cvar_string|cvar_vector|cvar_or)\s*\(\s*"([^"]+)"\s*(?:,\s*[^\s)]+\s*)?\)}{
+                       my ($type, $name) = ($1, $2);
+                       $type = 'cvar' if $type eq 'cvar_or';
+                       my $realtype = $cvars{$name};
+                       my $r = $&;
+                       if(defined $realtype)
+                       {
+                               #$r = "$realtype(\"$name\")";
+                               $r = "autocvar_$name";
+                               if($type eq 'cvar' && $realtype eq 'cvar_string')
+                               {
+                                       $r = "stof($r)";
+                               }
+                               if($type eq 'cvar_string' && $realtype eq 'cvar')
+                               {
+                                       $r = "ftos($r)";
+                               }
+                       }
+                       $r;
+               }ge;
+               $out .= "$_\n";
+       }
+       close $fh;
+       open $fh, ">", $f;
+       print $fh $out;
+       close $fh;
+}
index 24b230c8468b9c85c19de2415048848f1b132247..435dedabc770dbed309f663ad5945d99322b9b5e 100644 (file)
@@ -140,11 +140,11 @@ void CSQC_Init(void)
        GibSplash_Precache();
        Casings_Precache();
        DamageInfo_Precache();
-       if(cvar_string("cl_announcer") != cl_announcer_prev) {
+       if(autocvar_cl_announcer != cl_announcer_prev) {
                Announcer_Precache();
                if(cl_announcer_prev)
                        strunzone(cl_announcer_prev);
-               cl_announcer_prev = strzone(cvar_string("cl_announcer"));
+               cl_announcer_prev = strzone(autocvar_cl_announcer);
        }
        Tuba_Precache();
 
@@ -186,7 +186,7 @@ void CSQC_Shutdown(void)
        remove(players);
        db_close(binddb);
        db_close(tempdb);
-       if(cvar("cl_db_saveasdump"))
+       if(autocvar_cl_db_saveasdump)
                db_dump(ClientProgsDB, "client.db");
        else
                db_save(ClientProgsDB, "client.db");
@@ -328,7 +328,7 @@ void TrueAim_Init();
 void PostInit(void)
 {
        print(strcat("PostInit\n    maxclients = ", ftos(maxclients), "\n"));
-       localcmd(strcat("\nscoreboard_columns_set ", cvar_string("scoreboard_columns"), ";\n"));
+       localcmd(strcat("\nscoreboard_columns_set ", autocvar_scoreboard_columns, ";\n"));
 
        entity playerchecker;
        playerchecker = spawn();
@@ -358,7 +358,7 @@ float CSQC_ConsoleCommand(string strMessage)
        strCmd = argv(0);
 
        if(strCmd == "hud_configure") { // config hud
-               cvar_set("_hud_configure", ftos(!cvar("_hud_configure")));
+               cvar_set("_hud_configure", ftos(!autocvar__hud_configure));
                return true;
        } else if(strCmd == "hud_save") { // save hud config
                if(argv(1) == "" || argv(2)) {
index e640e906d9977d099fdefe7e145268cb5da35c65..908e6dbf17fbc63b9cff14daa7e4d7f49d0866da 100644 (file)
@@ -102,7 +102,7 @@ void CheckForGamestartChange() {
        if (previous_game_starttime != startTime) {
                if ((time + 5.0) < startTime) {
                        //if connecting to server while restart was active don't always play prepareforbattle
-                       sound(world, CHAN_AUTO, strcat("announcer/", cvar_string("cl_announcer"), "/prepareforbattle.wav"), VOL_BASEVOICE, ATTN_NONE);
+                       sound(world, CHAN_AUTO, strcat("announcer/", autocvar_cl_announcer, "/prepareforbattle.wav"), VOL_BASEVOICE, ATTN_NONE);
                }
                if (time < startTime) {
                        restartAnnouncer = spawn();
@@ -127,11 +127,11 @@ vector GetCurrentFov(float fov)
 {
        float zoomsensitivity, zoomspeed, zoomfactor, zoomdir, velocityzoom;
 
-       zoomsensitivity = cvar("cl_zoomsensitivity");
-       zoomfactor = cvar("cl_zoomfactor");
+       zoomsensitivity = autocvar_cl_zoomsensitivity;
+       zoomfactor = autocvar_cl_zoomfactor;
        if(zoomfactor < 1 || zoomfactor > 16)
                zoomfactor = 2.5;
-       zoomspeed = cvar("cl_zoomspeed");
+       zoomspeed = autocvar_cl_zoomspeed;
        if(zoomspeed >= 0)
                if(zoomspeed < 0.5 || zoomspeed > 16)
                        zoomspeed = 3.5;
@@ -185,11 +185,11 @@ vector GetCurrentFov(float fov)
        else
                setsensitivityscale(1);
 
-       velocityzoom = bound(0, drawframetime / max(0.000000001, cvar_or("cl_velocityzoomtime", 0.3)), 1);
+       velocityzoom = bound(0, drawframetime / max(0.000000001, autocvar_cl_velocityzoomtime), 1);
        avgspeed = avgspeed * (1 - velocityzoom) + (vlen(pmove_vel) / 1000) * velocityzoom;
-       velocityzoom = exp(float2range11(avgspeed * -cvar_or("cl_velocityzoom", 0) / 1) * 1);
+       velocityzoom = exp(float2range11(avgspeed * -autocvar_cl_velocityzoom / 1) * 1);
 
-       //print(ftos(avgspeed), " avgspeed, ", ftos(cvar_or("cl_velocityzoom", 0)), " cvar, ", ftos(velocityzoom), " return\n"); // for debugging
+       //print(ftos(avgspeed), " avgspeed, ", ftos(autocvar_cl_velocityzoom), " cvar, ", ftos(velocityzoom), " return\n"); // for debugging
 
        float frustumx, frustumy, fovx, fovy;
        frustumy = tan(fov * M_PI / 360.0) * 0.75 * current_viewzoom * velocityzoom;
@@ -391,7 +391,7 @@ void CSQC_UpdateView(float w, float h)
        input_angles = warpzone_fixview_cl_viewangles;
        view_angles = warpzone_fixview_angles;
 
-       if(cvar("cl_lockview") || (autocvar__hud_configure && spectatee_status <= 0))
+       if(autocvar_cl_lockview || (autocvar__hud_configure && spectatee_status <= 0))
        {
                pmove_org = freeze_pmove_org;
                input_angles = view_angles = freeze_input_angles;
@@ -457,7 +457,7 @@ void CSQC_UpdateView(float w, float h)
        maptimeAnnouncer();
        carrierAnnouncer();
 
-       fov = cvar("fov");
+       fov = autocvar_fov;
        if(button_zoom || fov <= 59.5)
        {
                if(!zoomscript_caught)
@@ -477,7 +477,7 @@ void CSQC_UpdateView(float w, float h)
                }
        }
 
-       ColorTranslateMode = cvar("cl_stripcolorcodes");
+       ColorTranslateMode = autocvar_cl_stripcolorcodes;
        activeweapon = getstati(STAT_SWITCHWEAPON);
        f = (serverflags & SERVERFLAG_TEAMPLAY);
        if(f != teamplay)
@@ -509,16 +509,16 @@ void CSQC_UpdateView(float w, float h)
        R_SetView(VF_DRAWWORLD, 1);
 
        // Set the console size vars
-       vid_conwidth = cvar("vid_conwidth");
-       vid_conheight = cvar("vid_conheight");
-       vid_pixelheight = cvar("vid_pixelheight");
+       vid_conwidth = autocvar_vid_conwidth;
+       vid_conheight = autocvar_vid_conheight;
+       vid_pixelheight = autocvar_vid_pixelheight;
 
        R_SetView(VF_FOV, GetCurrentFov(fov));
 
        // Camera for demo playback
        if(camera_active)
        {
-               if(cvar("camera_enable"))
+               if(autocvar_camera_enable)
                        CSQC_Demo_Camera();
                else
                {
@@ -528,13 +528,13 @@ void CSQC_UpdateView(float w, float h)
                }
        }
 #ifdef CAMERATEST
-       else if(cvar("camera_enable"))
+       else if(autocvar_camera_enable)
 #else
-       else if(cvar("camera_enable") && isdemo())
+       else if(autocvar_camera_enable && isdemo())
 #endif
        {
                // Enable required Darkplaces cvars
-               chase_active_backup = cvar("chase_active");
+               chase_active_backup = autocvar_chase_active;
                cvar_set("chase_active", "2");
                cvar_set("cl_demo_mousegrab", "1");
                camera_active = TRUE;
@@ -548,8 +548,8 @@ void CSQC_UpdateView(float w, float h)
        R_SetView(VF_DRAWENGINEHUD, 0);
 
        // fetch this one only once per frame
-       hud_showbinds = cvar("hud_showbinds");
-       hud_showbinds_limit = cvar("hud_showbinds_limit");
+       hud_showbinds = autocvar_hud_showbinds;
+       hud_showbinds_limit = autocvar_hud_showbinds_limit;
 
        // Update the mouse position
        /*
@@ -572,7 +572,7 @@ void CSQC_UpdateView(float w, float h)
        // next R_RenderScene call
        drawstring('0 0 0', "", '1 1 0', '1 1 1', 0, 0);
 
-       if(cvar("r_fakelight") >= 2 || cvar("r_fullbright") >= 1)
+       if(autocvar_r_fakelight >= 2 || autocvar_r_fullbright >= 1)
        if not(serverflags & SERVERFLAG_ALLOW_FULLBRIGHT)
        {
                // apply night vision effect
@@ -590,7 +590,7 @@ void CSQC_UpdateView(float w, float h)
                }
 
                // color tint in yellow
-               drawfill('0 0 0', cvar("vid_conwidth") * '1 0 0' + cvar("vid_conheight") * '0 1 0', '0.5 1 0.3', 1, DRAWFLAG_MODULATE);
+               drawfill('0 0 0', autocvar_vid_conwidth * '1 0 0' + autocvar_vid_conheight * '0 1 0', '0.5 1 0.3', 1, DRAWFLAG_MODULATE);
 
                // draw BG
                a = Noise_Pink(nightvision_noise, frametime * 1.5) * 0.05 + 0.15;
@@ -602,9 +602,9 @@ void CSQC_UpdateView(float w, float h)
                tc_11 = tc_01 + tc_10 - tc_00;
                R_BeginPolygon("gfx/nightvision-bg.tga", DRAWFLAG_ADDITIVE);
                R_PolygonVertex('0 0 0', tc_00, rgb, a);
-               R_PolygonVertex(cvar("vid_conwidth") * '1 0 0', tc_10, rgb, a);
-               R_PolygonVertex(cvar("vid_conwidth") * '1 0 0' + cvar("vid_conheight") * '0 1 0', tc_11, rgb, a);
-               R_PolygonVertex(cvar("vid_conheight") * '0 1 0', tc_01, rgb, a);
+               R_PolygonVertex(autocvar_vid_conwidth * '1 0 0', tc_10, rgb, a);
+               R_PolygonVertex(autocvar_vid_conwidth * '1 0 0' + autocvar_vid_conheight * '0 1 0', tc_11, rgb, a);
+               R_PolygonVertex(autocvar_vid_conheight * '0 1 0', tc_01, rgb, a);
                R_EndPolygon();
 
                // draw FG
@@ -616,9 +616,9 @@ void CSQC_UpdateView(float w, float h)
                tc_11 = tc_01 + tc_10 - tc_00;
                R_BeginPolygon("gfx/nightvision-fg.tga", DRAWFLAG_ADDITIVE);
                R_PolygonVertex('0 0 0', tc_00, rgb, a);
-               R_PolygonVertex(cvar("vid_conwidth") * '1 0 0', tc_10, rgb, a);
-               R_PolygonVertex(cvar("vid_conwidth") * '1 0 0' + cvar("vid_conheight") * '0 1 0', tc_11, rgb, a);
-               R_PolygonVertex(cvar("vid_conheight") * '0 1 0', tc_01, rgb, a);
+               R_PolygonVertex(autocvar_vid_conwidth * '1 0 0', tc_10, rgb, a);
+               R_PolygonVertex(autocvar_vid_conwidth * '1 0 0' + autocvar_vid_conheight * '0 1 0', tc_11, rgb, a);
+               R_PolygonVertex(autocvar_vid_conheight * '0 1 0', tc_01, rgb, a);
                R_EndPolygon();
        }
 
@@ -635,7 +635,7 @@ void CSQC_UpdateView(float w, float h)
        else if(activeweapon == WEP_NEX && button_attack2 || activeweapon == WEP_CAMPINGRIFLE && button_attack2)
                reticle_type = 2; // nex zoom
 
-       if(cvar("cl_reticle_stretch"))
+       if(autocvar_cl_reticle_stretch)
        {
                reticle_size_x = vid_conwidth;
                reticle_size_y = vid_conheight;
@@ -653,39 +653,39 @@ void CSQC_UpdateView(float w, float h)
        f = current_zoomfraction;
        if(zoomscript_caught)
                f = 1;
-       if(cvar("cl_reticle_item_normal"))
+       if(autocvar_cl_reticle_item_normal)
        {
                precache_pic("gfx/reticle_normal");
                if(reticle_type == 1 && f)
-                       drawpic(reticle_pos, "gfx/reticle_normal", reticle_size, '1 1 1', f * cvar("cl_reticle_item_normal"), DRAWFLAG_NORMAL);
+                       drawpic(reticle_pos, "gfx/reticle_normal", reticle_size, '1 1 1', f * autocvar_cl_reticle_item_normal, DRAWFLAG_NORMAL);
        }
-       if(cvar("cl_reticle_item_nex"))
+       if(autocvar_cl_reticle_item_nex)
        {
                precache_pic("gfx/reticle_nex");
                if(reticle_type == 2 && f)
-                       drawpic(reticle_pos, "gfx/reticle_nex", reticle_size, '1 1 1', f * cvar("cl_reticle_item_nex"), DRAWFLAG_NORMAL);
+                       drawpic(reticle_pos, "gfx/reticle_nex", reticle_size, '1 1 1', f * autocvar_cl_reticle_item_nex, DRAWFLAG_NORMAL);
        }
 
        // improved polyblend
        vector rgb;
-       if(cvar("hud_damage"))
+       if(autocvar_hud_damage)
        {
                float myhealth_flash_temp;
                myhealth = getstati(STAT_HEALTH);
 
                // fade out
-               myhealth_flash = max(0, myhealth_flash - cvar("hud_damage_fade_rate") * frametime);
+               myhealth_flash = max(0, myhealth_flash - autocvar_hud_damage_fade_rate * frametime);
                // add new damage
-               myhealth_flash = bound(0, myhealth_flash + max(0, myhealth_prev - myhealth) * cvar("hud_damage_factor"), cvar("hud_damage_maxalpha"));
+               myhealth_flash = bound(0, myhealth_flash + max(0, myhealth_prev - myhealth) * autocvar_hud_damage_factor, autocvar_hud_damage_maxalpha);
 
                float pain_threshold, pain_threshold_lower, pain_threshold_lower_health;
-               pain_threshold = cvar("hud_damage_pain_threshold");
-               pain_threshold_lower = cvar("hud_damage_pain_threshold_lower");
-               pain_threshold_lower_health = cvar("hud_damage_pain_threshold_lower_health");
+               pain_threshold = autocvar_hud_damage_pain_threshold;
+               pain_threshold_lower = autocvar_hud_damage_pain_threshold_lower;
+               pain_threshold_lower_health = autocvar_hud_damage_pain_threshold_lower_health;
 
                if(pain_threshold_lower && myhealth < pain_threshold_lower_health)
                {
-                       pain_threshold = pain_threshold - max(cvar("hud_damage_pain_threshold_pulsating_min"), fabs(sin(M_PI * time / cvar("hud_damage_pain_threshold_pulsating_period")))) * pain_threshold_lower * (1 - max(0, myhealth)/pain_threshold_lower_health);
+                       pain_threshold = pain_threshold - max(autocvar_hud_damage_pain_threshold_pulsating_min, fabs(sin(M_PI * time / autocvar_hud_damage_pain_threshold_pulsating_period))) * pain_threshold_lower * (1 - max(0, myhealth)/pain_threshold_lower_health);
                }
 
                myhealth_flash_temp = bound(0, myhealth_flash - pain_threshold, 1);
@@ -699,7 +699,7 @@ void CSQC_UpdateView(float w, float h)
                        }
                        else
                        {
-                               myhealth_flash += cvar("hud_damage_fade_rate") * frametime; // dead
+                               myhealth_flash += autocvar_hud_damage_fade_rate * frametime; // dead
                        }
                }
 
@@ -711,7 +711,7 @@ void CSQC_UpdateView(float w, float h)
 
                myhealth_prev = myhealth;
 
-               if(autocvar_cl_gentle_damage || cvar("cl_gentle"))
+               if(autocvar_cl_gentle_damage || autocvar_cl_gentle)
                {
                        if(autocvar_cl_gentle_damage == 2)
                        {
@@ -721,12 +721,12 @@ void CSQC_UpdateView(float w, float h)
                                }
                        }
                        else
-                               myhealth_gentlergb = stov(cvar_string("hud_damage_gentle_color"));
+                               myhealth_gentlergb = stov(autocvar_hud_damage_gentle_color);
 
-                       drawfill('0 0 0', eX * vid_conwidth + eY * vid_conheight, myhealth_gentlergb, cvar("hud_damage_gentle_alpha_multiplier") * bound(0, myhealth_flash_temp, 1) * cvar("hud_damage"), DRAWFLAG_NORMAL);
+                       drawfill('0 0 0', eX * vid_conwidth + eY * vid_conheight, myhealth_gentlergb, autocvar_hud_damage_gentle_alpha_multiplier * bound(0, myhealth_flash_temp, 1) * autocvar_hud_damage, DRAWFLAG_NORMAL);
                }
                else
-                       drawpic(reticle_pos, "gfx/blood", reticle_size, stov(cvar_string("hud_damage_color")), bound(0, myhealth_flash_temp, 1) * cvar("hud_damage"), DRAWFLAG_NORMAL);
+                       drawpic(reticle_pos, "gfx/blood", reticle_size, stov(autocvar_hud_damage_color), bound(0, myhealth_flash_temp, 1) * autocvar_hud_damage, DRAWFLAG_NORMAL);
        }
 
        // Draw the mouse cursor
@@ -767,29 +767,29 @@ void CSQC_UpdateView(float w, float h)
                if(gametype == GAME_FREEZETAG)
                {
                        if(getstati(STAT_FROZEN))
-                               drawfill('0 0 0', eX * vid_conwidth + eY * vid_conheight, '0.25 0.90 1', cvar_or("hud_colorflash_alpha", 0.5), DRAWFLAG_ADDITIVE);
+                               drawfill('0 0 0', eX * vid_conwidth + eY * vid_conheight, '0.25 0.90 1', autocvar_hud_colorflash_alpha, DRAWFLAG_ADDITIVE);
                        if(getstatf(STAT_REVIVE_PROGRESS))
                        {
-                               DrawCircleClippedPic(eX * 0.5 * vid_conwidth + eY * 0.6 * vid_conheight, 0.1 * vid_conheight, "gfx/crosshair_ring.tga", getstatf(STAT_REVIVE_PROGRESS), '0.25 0.90 1', cvar("hud_colorflash_alpha"), DRAWFLAG_ADDITIVE);
+                               DrawCircleClippedPic(eX * 0.5 * vid_conwidth + eY * 0.6 * vid_conheight, 0.1 * vid_conheight, "gfx/crosshair_ring.tga", getstatf(STAT_REVIVE_PROGRESS), '0.25 0.90 1', autocvar_hud_colorflash_alpha, DRAWFLAG_ADDITIVE);
                                drawstring_aspect(eY * 0.64 * vid_conheight, "Revival progress", eX * vid_conwidth + eY * 0.025 * vid_conheight, '1 1 1', 1, DRAWFLAG_NORMAL);
                        }
                }
 
-               if(cvar("r_letterbox") == 0)
-                       if(cvar("viewsize") < 120)
+               if(autocvar_r_letterbox == 0)
+                       if(autocvar_viewsize < 120)
                                CSQC_common_hud();
 
                // crosshair goes VERY LAST
                if(!scoreboard_active && !camera_active && intermission != 2) {
                        string wcross_style;
                        float wcross_alpha, wcross_resolution;
-                       wcross_style = cvar_string("crosshair");
+                       wcross_style = autocvar_crosshair;
                        if (wcross_style == "0")
                                return;
-                       wcross_resolution = cvar("crosshair_size");
+                       wcross_resolution = autocvar_crosshair_size;
                        if (wcross_resolution == 0)
                                return;
-                       wcross_alpha = cvar("crosshair_alpha");
+                       wcross_alpha = autocvar_crosshair_alpha;
                        if (wcross_alpha == 0)
                                return;
 
@@ -799,7 +799,7 @@ void CSQC_UpdateView(float w, float h)
                        // wcross_origin = '0.5 0 0' * vid_conwidth + '0 0.5 0' * vid_conheight;
                        wcross_origin = project_3d_to_2d(view_origin + MAX_SHOT_DISTANCE * view_forward);
                        wcross_origin_z = 0;
-                       if(cvar("crosshair_hittest"))
+                       if(autocvar_crosshair_hittest)
                        {
                                vector wcross_oldorigin;
                                wcross_oldorigin = wcross_origin;
@@ -812,7 +812,7 @@ void CSQC_UpdateView(float w, float h)
                                        if(vlen(v) > 0.01)
                                                shottype = SHOTTYPE_HITOBSTRUCTION;
                                }
-                               if(!cvar("crosshair_hittest_showimpact"))
+                               if(!autocvar_crosshair_hittest_showimpact)
                                        wcross_origin = wcross_oldorigin;
                        }
                        else
@@ -822,12 +822,12 @@ void CSQC_UpdateView(float w, float h)
                        string wcross_wep, wcross_name;
                        float wcross_scale, wcross_blur;
 
-                       if (cvar("crosshair_per_weapon") || cvar("crosshair_color_per_weapon")) {
+                       if (autocvar_crosshair_per_weapon || autocvar_crosshair_color_per_weapon) {
                                e = get_weaponinfo(activeweapon);
                                if (e && e.netname != "")
                                {
                                        wcross_wep = e.netname;
-                                       if(cvar("crosshair_per_weapon"))
+                                       if(autocvar_crosshair_per_weapon)
                                        {
                                                wcross_resolution *= cvar(strcat("crosshair_", wcross_wep, "_size"));
                                                if (wcross_resolution == 0)
@@ -842,14 +842,14 @@ void CSQC_UpdateView(float w, float h)
                                        }
                                }
                        }
-                       if(wcross_wep != "" && cvar("crosshair_color_per_weapon"))
+                       if(wcross_wep != "" && autocvar_crosshair_color_per_weapon)
                                wcross_color = stov(cvar_string(strcat("crosshair_", wcross_wep, "_color")));
                        else
-                               wcross_color = stov(cvar_string("crosshair_color"));
+                               wcross_color = stov(autocvar_crosshair_color);
 
                        wcross_name = strcat("gfx/crosshair", wcross_style);
 
-                       if(cvar("crosshair_effect_scalefade"))
+                       if(autocvar_crosshair_effect_scalefade)
                        {
                                wcross_scale = wcross_resolution;
                                wcross_resolution = 1;
@@ -859,7 +859,7 @@ void CSQC_UpdateView(float w, float h)
                                wcross_scale = 1;
                        }
 
-                       if(cvar("crosshair_pickup"))
+                       if(autocvar_crosshair_pickup)
                        {
                                if(pickup_crosshair_time < getstatf(STAT_LAST_PICKUP))
                                {
@@ -868,19 +868,19 @@ void CSQC_UpdateView(float w, float h)
                                }
 
                                if(pickup_crosshair_size > 0)
-                                       pickup_crosshair_size -= cvar("crosshair_pickup_speed") * frametime;
+                                       pickup_crosshair_size -= autocvar_crosshair_pickup_speed * frametime;
                                else
                                        pickup_crosshair_size = 0;
 
-                               wcross_scale += sin(pickup_crosshair_size) * cvar("crosshair_pickup");
+                               wcross_scale += sin(pickup_crosshair_size) * autocvar_crosshair_pickup;
                        }
 
                        if(shottype == SHOTTYPE_HITENEMY)
-                               wcross_scale *= cvar("crosshair_hittest"); // is not queried if hittest is 0
+                               wcross_scale *= autocvar_crosshair_hittest; // is not queried if hittest is 0
                        if(shottype == SHOTTYPE_HITTEAM)
-                               wcross_scale /= cvar("crosshair_hittest"); // is not queried if hittest is 0
+                               wcross_scale /= autocvar_crosshair_hittest; // is not queried if hittest is 0
 
-                       f = cvar("crosshair_effect_speed");
+                       f = autocvar_crosshair_effect_speed;
                        if(f < 0)
                                f *= -2 * g_weaponswitchdelay;
                        if(wcross_scale != wcross_scale_goal_prev || wcross_alpha != wcross_alpha_goal_prev || wcross_color != wcross_color_goal_prev)
@@ -904,7 +904,7 @@ void CSQC_UpdateView(float w, float h)
                        wcross_alpha_goal_prev = wcross_alpha;
                        wcross_color_goal_prev = wcross_color;
 
-                       if(shottype == SHOTTYPE_HITTEAM || (shottype == SHOTTYPE_HITOBSTRUCTION && cvar("crosshair_hittest_blur") && !cvar("chase_active")))
+                       if(shottype == SHOTTYPE_HITTEAM || (shottype == SHOTTYPE_HITOBSTRUCTION && autocvar_crosshair_hittest_blur && !autocvar_chase_active))
                        {
                                wcross_blur = 1;
                                wcross_alpha *= 0.75;
@@ -926,10 +926,10 @@ void CSQC_UpdateView(float w, float h)
                        wcross_alpha_prev = wcross_alpha;
                        wcross_color_prev = wcross_color;
 
-                       wcross_scale *= 1 - cvar("_menu_alpha");
-                       wcross_alpha *= 1 - cvar("_menu_alpha");
+                       wcross_scale *= 1 - autocvar__menu_alpha;
+                       wcross_alpha *= 1 - autocvar__menu_alpha;
 
-                       ring_scale = cvar("crosshair_ring_size");
+                       ring_scale = autocvar_crosshair_ring_size;
 
                        wcross_size = drawgetimagesize(wcross_name) * wcross_scale;
 
@@ -946,7 +946,7 @@ void CSQC_UpdateView(float w, float h)
                                bullets = getstati(STAT_BULLETS_LOADED);
                                f = bound(0, bullets / cr_maxbullets, 1);
 
-                               a = cvar("crosshair_ring_campingrifle_alpha");
+                               a = autocvar_crosshair_ring_campingrifle_alpha;
                                DrawCircleClippedPic(wcross_origin, wcross_size_x * ring_scale, "gfx/crosshair_ring.tga", f, wcross_color, wcross_alpha * a, DRAWFLAG_ADDITIVE);
                        }
                        else if (activeweapon == WEP_NEX && nex_charge) // ring around crosshair representing velocity-dependent damage for the nex
@@ -955,22 +955,22 @@ void CSQC_UpdateView(float w, float h)
                                {
                                        use_nex_chargepool = 1;
 
-                                       a = cvar("crosshair_ring_nex_inner_alpha");
-                                       rgb = eX * cvar("crosshair_ring_nex_inner_color_red") + eY * cvar("crosshair_ring_nex_inner_color_green") + eZ * cvar("crosshair_ring_nex_inner_color_blue");
+                                       a = autocvar_crosshair_ring_nex_inner_alpha;
+                                       rgb = eX * autocvar_crosshair_ring_nex_inner_color_red + eY * autocvar_crosshair_ring_nex_inner_color_green + eZ * autocvar_crosshair_ring_nex_inner_color_blue;
                                        DrawCircleClippedPic(wcross_origin, wcross_size_x * ring_scale, "gfx/crosshair_ring_inner.tga", nex_chargepool, rgb, wcross_alpha * a, DRAWFLAG_ADDITIVE);
                                }
                                else
                                {
                                        // indicate how much we're charging right now with an inner circle
-                                       a = cvar("crosshair_ring_nex_inner_alpha");
-                                       nex_charge_movingavg = (1 - cvar("crosshair_ring_nex_currentcharge_movingavg_rate")) * nex_charge_movingavg + cvar("crosshair_ring_nex_currentcharge_movingavg_rate") * nex_charge;
+                                       a = autocvar_crosshair_ring_nex_inner_alpha;
+                                       nex_charge_movingavg = (1 - autocvar_crosshair_ring_nex_currentcharge_movingavg_rate) * nex_charge_movingavg + autocvar_crosshair_ring_nex_currentcharge_movingavg_rate * nex_charge;
 
-                                       rgb = eX * cvar("crosshair_ring_nex_inner_color_red") + eY * cvar("crosshair_ring_nex_inner_color_green") + eZ * cvar("crosshair_ring_nex_inner_color_blue");
-                                       DrawCircleClippedPic(wcross_origin, wcross_size_x * ring_scale, "gfx/crosshair_ring_inner.tga", bound(0, cvar("crosshair_ring_nex_currentcharge_scale") * (nex_charge - nex_charge_movingavg), 1), rgb, wcross_alpha * a, DRAWFLAG_ADDITIVE);
+                                       rgb = eX * autocvar_crosshair_ring_nex_inner_color_red + eY * autocvar_crosshair_ring_nex_inner_color_green + eZ * autocvar_crosshair_ring_nex_inner_color_blue;
+                                       DrawCircleClippedPic(wcross_origin, wcross_size_x * ring_scale, "gfx/crosshair_ring_inner.tga", bound(0, autocvar_crosshair_ring_nex_currentcharge_scale * (nex_charge - nex_charge_movingavg), 1), rgb, wcross_alpha * a, DRAWFLAG_ADDITIVE);
                                }
 
                                // draw the charge
-                               a = cvar("crosshair_ring_nex_outer_alpha");
+                               a = autocvar_crosshair_ring_nex_outer_alpha;
                                DrawCircleClippedPic(wcross_origin, wcross_size_x * ring_scale, "gfx/crosshair_ring.tga", nex_charge, wcross_color, wcross_alpha * a, DRAWFLAG_ADDITIVE);
                        }
 
@@ -1011,13 +1011,13 @@ void CSQC_UpdateView(float w, float h)
                        wcross_size = drawgetimagesize(wcross_name) * wcross_scale;
                        CROSSHAIR_DRAW(wcross_resolution, wcross_name, wcross_alpha * f);
 
-                       if(cvar("crosshair_dot"))
+                       if(autocvar_crosshair_dot)
             {
                 vector wcross_color_old;
                 wcross_color_old = wcross_color;
-                if(cvar_string("crosshair_dot_color") != "0")
-                    wcross_color = stov(cvar_string("crosshair_dot_color"));
-                               CROSSHAIR_DRAW(wcross_resolution * cvar("crosshair_dot_size"), "gfx/crosshairdot.tga", f * cvar("crosshair_dot_alpha"));
+                if(autocvar_crosshair_dot_color != "0")
+                    wcross_color = stov(autocvar_crosshair_dot_color);
+                               CROSSHAIR_DRAW(wcross_resolution * autocvar_crosshair_dot_size, "gfx/crosshairdot.tga", f * autocvar_crosshair_dot_alpha);
                 wcross_color = wcross_color_old;
             }
 
@@ -1055,8 +1055,8 @@ void CSQC_UpdateView(float w, float h)
        if(cs_project_is_b0rked == 0)
        {
                string w0, h0;
-               w0 = cvar_string("vid_conwidth");
-               h0 = cvar_string("vid_conheight");
+               w0 = ftos(autocvar_vid_conwidth);
+               h0 = ftos(autocvar_vid_conheight);
                //R_SetView(VF_VIEWPORT, '0 0 0', '640 480 0');
                //R_SetView(VF_FOV, '90 90 0');
                R_SetView(VF_ORIGIN, '0 0 0');
@@ -1108,9 +1108,9 @@ void CSQC_SPIDER_HUD()
 
     // Draw the crosshairs
     picsize = drawgetimagesize(SPIDER_CROSS);
-    picsize_x *= cvar_or("cl_vehicle_spiderbot_cross_size", 1);
-    picsize_y *= cvar_or("cl_vehicle_spiderbot_cross_size", 1);
-    drawpic('0.5 0 0' * (vid_conwidth - picsize_x) + '0 0.5 0' * (vid_conheight - picsize_y), SPIDER_CROSS, picsize, '1 1 1', cvar_or("cl_vehicle_spiderbot_cross_alpha",0.6), DRAWFLAG_NORMAL);
+    picsize_x *= autocvar_cl_vehicle_spiderbot_cross_size;
+    picsize_y *= autocvar_cl_vehicle_spiderbot_cross_size;
+    drawpic('0.5 0 0' * (vid_conwidth - picsize_x) + '0 0.5 0' * (vid_conheight - picsize_y), SPIDER_CROSS, picsize, '1 1 1', autocvar_cl_vehicle_spiderbot_cross_alpha, DRAWFLAG_NORMAL);
 
     hudloc_y =  4;
     hudloc_x = 4;
@@ -1220,9 +1220,9 @@ void CSQC_RAPTOR_HUD()
 
     // Draw the crosshairs
     picsize = drawgetimagesize(SPIDER_CROSS);
-    picsize_x *= cvar_or("cl_vehicle_spiderbot_cross_size", 1);
-    picsize_y *= cvar_or("cl_vehicle_spiderbot_cross_size", 1);
-    drawpic('0.5 0 0' * (vid_conwidth - picsize_x) + '0 0.5 0' * (vid_conheight - picsize_y), SPIDER_CROSS, picsize, '1 1 1', cvar_or("cl_vehicle_spiderbot_cross_alpha",0.6), DRAWFLAG_NORMAL);
+    picsize_x *= autocvar_cl_vehicle_spiderbot_cross_size;
+    picsize_y *= autocvar_cl_vehicle_spiderbot_cross_size;
+    drawpic('0.5 0 0' * (vid_conwidth - picsize_x) + '0 0.5 0' * (vid_conheight - picsize_y), SPIDER_CROSS, picsize, '1 1 1', autocvar_cl_vehicle_spiderbot_cross_alpha, DRAWFLAG_NORMAL);
 
     hudloc_y =  4;
     hudloc_x = 4;
@@ -1285,9 +1285,9 @@ void CSQC_WAKIZASHI_HUD()
        vector picsize, hudloc;
 
     picsize = drawgetimagesize(SPIDER_CROSS);
-    picsize_x *= cvar_or("cl_vehicle_spiderbot_cross_size", 1);
-    picsize_y *= cvar_or("cl_vehicle_spiderbot_cross_size", 1);
-    drawpic('0.5 0 0' * (vid_conwidth - picsize_x) + '0 0.5 0' * (vid_conheight - picsize_y), SPIDER_CROSS, picsize, '1 1 1', cvar_or("cl_vehicle_spiderbot_cross_alpha",0.6), DRAWFLAG_NORMAL);
+    picsize_x *= autocvar_cl_vehicle_spiderbot_cross_size;
+    picsize_y *= autocvar_cl_vehicle_spiderbot_cross_size;
+    drawpic('0.5 0 0' * (vid_conwidth - picsize_x) + '0 0.5 0' * (vid_conheight - picsize_y), SPIDER_CROSS, picsize, '1 1 1', autocvar_cl_vehicle_spiderbot_cross_alpha, DRAWFLAG_NORMAL);
 
 /*
 const float STAT_VEHICLESTAT_HEALTH  = 60;
@@ -1393,11 +1393,11 @@ void CSQC_common_hud(void)
                        float i;
                        if(!(gametype == GAME_RACE || gametype == GAME_CTS))
                        {
-                               if(cvar_string("accuracy_color_levels") != acc_color_levels)
+                               if(autocvar_accuracy_color_levels != acc_color_levels)
                                {
                                        if(acc_color_levels)
                                                strunzone(acc_color_levels);
-                                       acc_color_levels = strzone(cvar_string("accuracy_color_levels"));
+                                       acc_color_levels = strzone(autocvar_accuracy_color_levels);
                                        acc_levels = tokenize(acc_color_levels);
                                        if (acc_levels > MAX_ACCURACY_LEVELS)
                                                acc_levels = MAX_ACCURACY_LEVELS;
@@ -1423,12 +1423,12 @@ void CSQC_common_hud(void)
                                HUD_Reset();
 
                                centerprint_start_x = 0;
-                               centerprint_start_y = cvar("scr_centerpos") * vid_conheight;
+                               centerprint_start_y = autocvar_scr_centerpos * vid_conheight;
                        }
                        else // hud
                        {
                                centerprint_start_x = 0;
-                               centerprint_start_y = cvar("scr_centerpos") * vid_conheight;
+                               centerprint_start_y = autocvar_scr_centerpos * vid_conheight;
                        }
 
                        HUD_DrawCenterPrint();
@@ -1452,7 +1452,7 @@ void CSQC_Demo_Camera()
        float speed, attenuation, dimensions;
        vector tmp, delta;
 
-       if( cvar("camera_reset") || !camera_mode )
+       if( autocvar_camera_reset || !camera_mode )
        {
                camera_offset = '0 0 0';
                current_angles = '0 0 0';
@@ -1468,9 +1468,9 @@ void CSQC_Demo_Camera()
 
        // Camera angles
        if( camera_roll )
-               mouse_angles_z += camera_roll * cvar("camera_speed_roll");
+               mouse_angles_z += camera_roll * autocvar_camera_speed_roll;
 
-       if(cvar("camera_look_player"))
+       if(autocvar_camera_look_player)
        {
                local vector dir;
                local float n;
@@ -1484,7 +1484,7 @@ void CSQC_Demo_Camera()
        else
        {
                tmp = getmousepos() * 0.1;
-               if(vlen(tmp)>cvar("camera_mouse_treshold"))
+               if(vlen(tmp)>autocvar_camera_mouse_treshold)
                {
                        mouse_angles_x += tmp_y * cos(mouse_angles_z * DEG2RAD) + (tmp_x * sin(mouse_angles_z * DEG2RAD));
                        mouse_angles_y -= tmp_x * cos(mouse_angles_z * DEG2RAD) + (tmp_y * -sin(mouse_angles_z * DEG2RAD));
@@ -1503,10 +1503,10 @@ void CSQC_Demo_Camera()
        if(mouse_angles_y > 60 && current_angles_y < -60)
                delta = '0 -360 0';
 
-       if(cvar("camera_look_player"))
-               attenuation = cvar("camera_look_attenuation");
+       if(autocvar_camera_look_player)
+               attenuation = autocvar_camera_look_attenuation;
        else
-               attenuation = cvar("camera_speed_attenuation");
+               attenuation = autocvar_camera_speed_attenuation;
 
        attenuation = 1 / max(1, attenuation);
        current_angles += (mouse_angles - current_angles + delta) * attenuation;
@@ -1524,7 +1524,7 @@ void CSQC_Demo_Camera()
        {
                tmp_x = camera_direction_x * cos(current_angles_y * DEG2RAD);
                tmp_y = camera_direction_x * sin(current_angles_y * DEG2RAD);
-               if( cvar("camera_forward_follows") && !cvar("camera_look_player") )
+               if( autocvar_camera_forward_follows && !autocvar_camera_look_player )
                        tmp_z = camera_direction_x * -sin(current_angles_x * DEG2RAD);
                ++dimensions;
        }
@@ -1543,10 +1543,10 @@ void CSQC_Demo_Camera()
                ++dimensions;
        }
 
-       if(cvar("camera_free"))
-               speed = cvar("camera_speed_free");
+       if(autocvar_camera_free)
+               speed = autocvar_camera_speed_free;
        else
-               speed = cvar("camera_speed_chase");
+               speed = autocvar_camera_speed_chase;
 
        if(dimensions)
        {
@@ -1557,7 +1557,7 @@ void CSQC_Demo_Camera()
        current_camera_offset += (camera_offset - current_camera_offset) * attenuation;
 
        // Camera modes
-       if( cvar("camera_free") )
+       if( autocvar_camera_free )
        {
                if ( camera_mode == CAMERA_CHASE )
                {
@@ -1579,7 +1579,7 @@ void CSQC_Demo_Camera()
 
                camera_mode = CAMERA_CHASE;
 
-               if(cvar("camera_chase_smoothly"))
+               if(autocvar_camera_chase_smoothly)
                        current_origin += (view_origin - current_origin) * attenuation;
                else
                        current_origin = view_origin;
index 873df14a358e435d0b68d3e8e0634028575b6f94..f3d18aa9ffc41df7e5d7a2c873c0b9b5b937ca7c 100644 (file)
-var float autocvar_cl_projectiles_sloppy = 0;
-
-var float autocvar_cl_gibs_ticrate = 0.1;
-var float autocvar_cl_gibs_sloppy = 1;
-
-var float autocvar_cl_casings_ticrate = 0.1;
+float autocvar__con_chat_maximized;
+float autocvar__hud_configure;
+string autocvar__hud_panelorder;
+float autocvar__menu_alpha;
+string autocvar_accuracy_color_levels;
+float autocvar_bgmvolume;
+float autocvar_camera_chase_smoothly;
+float autocvar_camera_enable;
+float autocvar_camera_forward_follows;
+float autocvar_camera_free;
+float autocvar_camera_look_attenuation;
+float autocvar_camera_look_player;
+float autocvar_camera_mouse_treshold;
+float autocvar_camera_reset;
+float autocvar_camera_speed_attenuation;
+float autocvar_camera_speed_chase;
+float autocvar_camera_speed_free;
+float autocvar_camera_speed_roll;
+float autocvar_chase_active;
+float autocvar_cl_allow_uid2name;
+string autocvar_cl_announcer;
+float autocvar_cl_autodemo_delete;
+float autocvar_cl_autodemo_delete_keeprecords;
+float autocvar_cl_casings;
+float autocvar_cl_casings_bronze_time;
+var float autocvar_cl_casings_maxcount = 100;
+float autocvar_cl_casings_shell_time;
 var float autocvar_cl_casings_sloppy = 1;
-
-var float autocvar_cl_gentle_damage;
-
-var float autocvar_scoreboard_color_bg_team;
-
-var float autocvar__menu_alpha;
-
-var float autocvar__hud_configure;
-var float autocvar_hud_configure_teamcolorforced;
-var float autocvar_hud_configure_bg_minalpha;
-var float autocvar_hud_configure_grid;
-var float autocvar_hud_configure_grid_xsize;
-var float autocvar_hud_configure_grid_ysize;
-var float autocvar_hud_configure_grid_alpha;
-
-var float autocvar__con_chat_maximized;
-var string autocvar__hud_panelorder;
-
-var string autocvar_hud_dock;
-
-var float autocvar_hud_progressbar_alpha;
-
-var string autocvar_hud_panel_bg;
-var vector autocvar_hud_panel_bg_color;
-var float autocvar_hud_panel_bg_color_team;
-var float autocvar_hud_panel_bg_alpha;
-var float autocvar_hud_panel_bg_border;
-var float autocvar_hud_panel_bg_padding;
-var float autocvar_hud_panel_fg_alpha;
-
-var float autocvar_hud_panel_weapons;
-
-var float autocvar_hud_panel_ammo;
-var float autocvar_hud_panel_ammo_onlycurrent;
-var float autocvar_hud_panel_ammo_iconalign;
-
-var float autocvar_hud_panel_powerups;
-
-var float autocvar_hud_panel_healtharmor;
-
-var float autocvar_hud_panel_notify;
-
-var float autocvar_hud_panel_timer;
-var float autocvar_hud_panel_timer_increment;
-
-var float autocvar_hud_panel_radar;
-
-var float autocvar_hud_panel_score;
-
-var float autocvar_hud_panel_racetimer;
-
-var float autocvar_hud_panel_vote;
-
-var float autocvar_hud_panel_modicons;
-
-var float autocvar_hud_panel_pressedkeys;
-
-var float autocvar_hud_panel_chat;
-
-var float autocvar_hud_panel_engineinfo;
-
-var float autocvar_hud_panel_infomessages;
-var float autocvar_hud_panel_infomessages_flip;
-
-var float autocvar_scoreboard_border_thickness;
-
-var float autocvar_cl_allow_uid2name;
+var float autocvar_cl_casings_ticrate = 0.1;
+float autocvar_cl_db_saveasdump;
+float autocvar_cl_deathscoreboard;
+float autocvar_cl_effects_lightningarc_branchfactor_add;
+float autocvar_cl_effects_lightningarc_branchfactor_start;
+float autocvar_cl_effects_lightningarc_drift_end;
+float autocvar_cl_effects_lightningarc_drift_start;
+float autocvar_cl_effects_lightningarc_segmentlength;
+float autocvar_cl_effects_lightningarc_simple;
+float autocvar_cl_gentle;
+float autocvar_cl_gentle_damage;
+float autocvar_cl_gentle_gibs;
+float autocvar_cl_gentle_messages;
+var float autocvar_cl_gibs_damageforcescale = 3.5;
+var float autocvar_cl_gibs_lifetime = 14;
+var float autocvar_cl_gibs_maxcount = 100;
+var float autocvar_cl_gibs_sloppy = 1;
+var float autocvar_cl_gibs_ticrate = 0.1;
+var float autocvar_cl_gibs_velocity_random = 1;
+var float autocvar_cl_gibs_velocity_scale = 1;
+float autocvar_cl_gibs_velocity_up;
+float autocvar_cl_gunalign;
+float autocvar_cl_hidewaypoints;
+float autocvar_cl_lockview;
+float autocvar_cl_nogibs;
+float autocvar_cl_notify_carried_items;
+float autocvar_cl_particlegibs;
+float autocvar_cl_particles_oldnexbeam;
+float autocvar_cl_particles_quality;
+float autocvar_cl_projectiles_sloppy;
+float autocvar_cl_readpicture_force;
+float autocvar_cl_reticle_item_nex;
+float autocvar_cl_reticle_item_normal;
+float autocvar_cl_reticle_stretch;
+float autocvar_cl_showacceleration;
+float autocvar_cl_showacceleration_alpha;
+string autocvar_cl_showacceleration_color;
+float autocvar_cl_showacceleration_color_custom;
+float autocvar_cl_showacceleration_position;
+float autocvar_cl_showacceleration_scale;
+float autocvar_cl_showacceleration_size;
+float autocvar_cl_showacceleration_z;
+float autocvar_cl_showspeed;
+float autocvar_cl_showspeed_position;
+float autocvar_cl_showspeed_size;
+float autocvar_cl_showspeed_unit;
+float autocvar_cl_showspeed_z;
+float autocvar_cl_sound_maptime_warning;
+float autocvar_cl_stripcolorcodes;
+var float autocvar_cl_vehicle_spiderbot_cross_alpha = 0.6;
+var float autocvar_cl_vehicle_spiderbot_cross_size = 1;
+float autocvar_cl_velocityzoom;
+var float autocvar_cl_velocityzoomtime = 0.3;
+string autocvar_cl_weaponpriority;
+float autocvar_cl_zoomfactor;
+float autocvar_cl_zoomsensitivity;
+float autocvar_cl_zoomspeed;
+float autocvar_con_chat;
+float autocvar_con_chatpos;
+float autocvar_con_chatsize;
+float autocvar_con_chattime;
+float autocvar_con_notify;
+float autocvar_con_notifysize;
+string autocvar_crosshair;
+float autocvar_crosshair_alpha;
+string autocvar_crosshair_color;
+float autocvar_crosshair_color_per_weapon;
+float autocvar_crosshair_dot;
+float autocvar_crosshair_dot_alpha;
+string autocvar_crosshair_dot_color;
+float autocvar_crosshair_dot_size;
+float autocvar_crosshair_effect_scalefade;
+float autocvar_crosshair_effect_speed;
+float autocvar_crosshair_hittest;
+float autocvar_crosshair_hittest_blur;
+float autocvar_crosshair_hittest_showimpact;
+float autocvar_crosshair_per_weapon;
+float autocvar_crosshair_pickup;
+float autocvar_crosshair_pickup_speed;
+float autocvar_crosshair_ring_campingrifle_alpha;
+float autocvar_crosshair_ring_nex_currentcharge_movingavg_rate;
+float autocvar_crosshair_ring_nex_currentcharge_scale;
+float autocvar_crosshair_ring_nex_inner_alpha;
+float autocvar_crosshair_ring_nex_inner_color_blue;
+float autocvar_crosshair_ring_nex_inner_color_green;
+float autocvar_crosshair_ring_nex_inner_color_red;
+float autocvar_crosshair_ring_nex_outer_alpha;
+float autocvar_crosshair_ring_size;
+float autocvar_crosshair_size;
+float autocvar_ekg;
+float autocvar_fov;
+float autocvar_g_balance_tuba_attenuation;
+float autocvar_g_balance_tuba_fadetime;
+float autocvar_g_balance_tuba_volume;
+float autocvar_g_warmup_limit;
+var float autocvar_g_waypointsprite_alpha = 1;
+var float autocvar_g_waypointsprite_crosshairfadealpha = 1;
+float autocvar_g_waypointsprite_crosshairfadedistance;
+var float autocvar_g_waypointsprite_crosshairfadescale = 1;
+float autocvar_g_waypointsprite_distancealphaexponent;
+var float autocvar_g_waypointsprite_distancefadealpha = 1;
+var float autocvar_g_waypointsprite_distancefadedistancemultiplier = 1;
+var float autocvar_g_waypointsprite_distancefadescale = 1;
+var float autocvar_g_waypointsprite_edgefadealpha = 1;
+float autocvar_g_waypointsprite_edgefadedistance;
+var float autocvar_g_waypointsprite_edgefadescale = 1;
+float autocvar_g_waypointsprite_minalpha;
+float autocvar_g_waypointsprite_minscale;
+float autocvar_g_waypointsprite_normdistance;
+var float autocvar_g_waypointsprite_scale = 1;
+float autocvar_g_waypointsprite_timealphaexponent;
+var float autocvar_hud_colorflash_alpha = 0.5;
+float autocvar_hud_configure_bg_minalpha;
+float autocvar_hud_configure_checkcollisions;
+float autocvar_hud_configure_grid;
+float autocvar_hud_configure_grid_alpha;
+float autocvar_hud_configure_grid_xsize;
+float autocvar_hud_configure_grid_ysize;
+float autocvar_hud_configure_teamcolorforced;
+float autocvar_hud_damage;
+string autocvar_hud_damage_color;
+float autocvar_hud_damage_factor;
+float autocvar_hud_damage_fade_rate;
+float autocvar_hud_damage_gentle_alpha_multiplier;
+string autocvar_hud_damage_gentle_color;
+float autocvar_hud_damage_maxalpha;
+float autocvar_hud_damage_pain_threshold;
+float autocvar_hud_damage_pain_threshold_lower;
+float autocvar_hud_damage_pain_threshold_lower_health;
+float autocvar_hud_damage_pain_threshold_pulsating_min;
+float autocvar_hud_damage_pain_threshold_pulsating_period;
+string autocvar_hud_dock;
+float autocvar_hud_dock_alpha;
+string autocvar_hud_dock_color;
+float autocvar_hud_dock_color_team;
+float autocvar_hud_panel_ammo;
+float autocvar_hud_panel_ammo_iconalign;
+float autocvar_hud_panel_ammo_maxammo;
+float autocvar_hud_panel_ammo_onlycurrent;
+float autocvar_hud_panel_ammo_progressbar;
+string autocvar_hud_panel_ammo_progressbar_name;
+float autocvar_hud_panel_ammo_progressbar_xoffset;
+float autocvar_hud_panel_ammo_text;
+string autocvar_hud_panel_bg;
+float autocvar_hud_panel_bg_alpha;
+float autocvar_hud_panel_bg_border;
+vector autocvar_hud_panel_bg_color;
+float autocvar_hud_panel_bg_color_team;
+float autocvar_hud_panel_bg_padding;
+float autocvar_hud_panel_chat;
+float autocvar_hud_panel_engineinfo;
+float autocvar_hud_panel_engineinfo_framecounter_decimals;
+float autocvar_hud_panel_engineinfo_framecounter_time;
+float autocvar_hud_panel_fg_alpha;
+float autocvar_hud_panel_healtharmor;
+float autocvar_hud_panel_healtharmor_baralign;
+float autocvar_hud_panel_healtharmor_flip;
+float autocvar_hud_panel_healtharmor_iconalign;
+float autocvar_hud_panel_healtharmor_maxarmor;
+float autocvar_hud_panel_healtharmor_maxhealth;
+float autocvar_hud_panel_healtharmor_progressbar;
+string autocvar_hud_panel_healtharmor_progressbar_armor;
+string autocvar_hud_panel_healtharmor_progressbar_health;
+float autocvar_hud_panel_healtharmor_text;
+float autocvar_hud_panel_infomessages;
+float autocvar_hud_panel_infomessages_flip;
+float autocvar_hud_panel_modicons;
+float autocvar_hud_panel_notify;
+float autocvar_hud_panel_notify_fadetime;
+float autocvar_hud_panel_notify_flip;
+float autocvar_hud_panel_notify_print;
+float autocvar_hud_panel_notify_time;
+float autocvar_hud_panel_powerups;
+float autocvar_hud_panel_powerups_baralign;
+float autocvar_hud_panel_powerups_flip;
+float autocvar_hud_panel_powerups_iconalign;
+float autocvar_hud_panel_powerups_progressbar;
+string autocvar_hud_panel_powerups_progressbar_shield;
+string autocvar_hud_panel_powerups_progressbar_strength;
+float autocvar_hud_panel_powerups_text;
+float autocvar_hud_panel_pressedkeys;
+float autocvar_hud_panel_pressedkeys_aspect;
+float autocvar_hud_panel_racetimer;
+float autocvar_hud_panel_radar;
+float autocvar_hud_panel_radar_foreground_alpha;
+float autocvar_hud_panel_radar_rotation;
+float autocvar_hud_panel_radar_scale;
+float autocvar_hud_panel_radar_zoommode;
+float autocvar_hud_panel_score;
+float autocvar_hud_panel_timer;
+float autocvar_hud_panel_timer_increment;
+float autocvar_hud_panel_vote;
+float autocvar_hud_panel_vote_alreadyvoted_alpha;
+string autocvar_hud_panel_vote_bg_alpha;
+float autocvar_hud_panel_weapons;
+float autocvar_hud_panel_weapons_accuracy;
+float autocvar_hud_panel_weapons_ammo;
+float autocvar_hud_panel_weapons_ammo_alpha;
+string autocvar_hud_panel_weapons_ammo_color;
+float autocvar_hud_panel_weapons_ammo_full_cells;
+float autocvar_hud_panel_weapons_ammo_full_fuel;
+float autocvar_hud_panel_weapons_ammo_full_nails;
+float autocvar_hud_panel_weapons_ammo_full_rockets;
+float autocvar_hud_panel_weapons_ammo_full_shells;
+float autocvar_hud_panel_weapons_aspect;
+float autocvar_hud_panel_weapons_complainbubble;
+string autocvar_hud_panel_weapons_complainbubble_color_donthave;
+string autocvar_hud_panel_weapons_complainbubble_color_outofammo;
+string autocvar_hud_panel_weapons_complainbubble_color_unavailable;
+float autocvar_hud_panel_weapons_complainbubble_fadetime;
+float autocvar_hud_panel_weapons_complainbubble_padding;
+float autocvar_hud_panel_weapons_complainbubble_time;
+var float autocvar_hud_panel_weapons_fade = 1;
+float autocvar_hud_panel_weapons_label;
+float autocvar_hud_panel_weapons_timeout;
+float autocvar_hud_panel_weapons_timeout_effect;
+float autocvar_hud_progressbar_alpha;
+float autocvar_hud_showbinds;
+float autocvar_hud_showbinds_limit;
+string autocvar_hud_skin;
+float autocvar_loddebug;
+float autocvar_menu_mouse_speed;
+string autocvar_menu_skin;
+float autocvar_r_fakelight;
+float autocvar_r_fullbright;
+float autocvar_r_letterbox;
+float autocvar_scoreboard_accuracy;
+float autocvar_scoreboard_accuracy_doublerows;
+float autocvar_scoreboard_alpha_bg;
+var float autocvar_scoreboard_alpha_fg = 1.0;
+var float autocvar_scoreboard_alpha_name = 0.9;
+var float autocvar_scoreboard_alpha_name_self = 1;
+float autocvar_scoreboard_bg_scale;
+float autocvar_scoreboard_border_thickness;
+float autocvar_scoreboard_color_bg_b;
+float autocvar_scoreboard_color_bg_g;
+float autocvar_scoreboard_color_bg_r;
+float autocvar_scoreboard_color_bg_team;
+string autocvar_scoreboard_columns;
+var float autocvar_scoreboard_fadeinspeed = 10;
+var float autocvar_scoreboard_fadeoutspeed = 5;
+float autocvar_scoreboard_highlight;
+var float autocvar_scoreboard_highlight_alpha = 0.10;
+var float autocvar_scoreboard_highlight_alpha_self = 0.25;
+float autocvar_scoreboard_offset_left;
+float autocvar_scoreboard_offset_right;
+float autocvar_scr_centerpos;
+float autocvar_scr_centersize;
+float autocvar_scr_centertime;
+float autocvar_v_flipped;
+float autocvar_vid_conheight;
+float autocvar_vid_conwidth;
+float autocvar_vid_pixelheight;
+float autocvar_viewsize;
index c23b425ae9d2e4edd0ace7c0cd77ec703b06b7ed..43255da5849ebf61752f43fb10b1ae5fd5f36a78 100644 (file)
@@ -172,7 +172,7 @@ float BGMScript(entity e)
        if(e.bgmscript == "")
                return 1;
        
-       if(cvar("bgmvolume") <= 0)
+       if(autocvar_bgmvolume <= 0)
                return -1;
 
        e.just_toggled = FALSE;
index 348e4a1a6ebefd8b2820168fe2b65a2616a20d81..860e8296f700cb94562b9efb3775895ed1b8fefd 100644 (file)
@@ -88,7 +88,7 @@ void Ent_Casing(float isNew)
        casing.angles_z = ReadByte() * 360 / 256;
        casing.drawmask = MASK_NORMAL;
 
-       if(cvar("cl_casings") && isNew) {
+       if(autocvar_cl_casings && isNew) {
                casing.draw = Casing_Draw;
                casing.move_origin = casing.origin;
                casing.move_velocity = casing.velocity + 2 * prandomvec();
@@ -104,11 +104,11 @@ void Ent_Casing(float isNew)
                {
                        case 1:
                                setmodel(casing, "models/casing_shell.mdl");
-                               casing.cnt = time + cvar("cl_casings_shell_time");
+                               casing.cnt = time + autocvar_cl_casings_shell_time;
                                break;
                        default:
                                setmodel(casing, "models/casing_bronze.mdl");
-                               casing.cnt = time + cvar("cl_casings_bronze_time");
+                               casing.cnt = time + autocvar_cl_casings_bronze_time;
                                break;
                }
 
@@ -117,7 +117,7 @@ void Ent_Casing(float isNew)
     else
         Casing_Delete();
 
-       RubbleLimit("casing", cvar_or("cl_casings_maxcount",100), Casing_Delete);
+       RubbleLimit("casing", autocvar_cl_casings_maxcount, Casing_Delete);
 }
 
 void Casings_Precache()
index 2e946fc830d1228515c89ef4110d6417a134396a..5793ed88b2eccc01fbdab754992aed83fb9ca135 100644 (file)
@@ -80,7 +80,7 @@ void Net_ReadLightningarc()
     from_x = ReadCoord(); from_y = ReadCoord(); from_z = ReadCoord();
     to_x   = ReadCoord(); to_y   = ReadCoord(); to_z   = ReadCoord();
 
-    if(cvar("cl_effects_lightningarc_simple"))
+    if(autocvar_cl_effects_lightningarc_simple)
     {
         te_lightning1(world,from,to);
     }
@@ -88,11 +88,11 @@ void Net_ReadLightningarc()
     {
         float seglength, drifts, drifte, branchfactor, branchfactor_add;
 
-        seglength    = cvar("cl_effects_lightningarc_segmentlength");
-        drifts       = cvar("cl_effects_lightningarc_drift_start");
-        drifte       = cvar("cl_effects_lightningarc_drift_end");
-        branchfactor = cvar("cl_effects_lightningarc_branchfactor_start");
-        branchfactor = cvar("cl_effects_lightningarc_branchfactor_add");
+        seglength    = autocvar_cl_effects_lightningarc_segmentlength;
+        drifts       = autocvar_cl_effects_lightningarc_drift_start;
+        drifte       = autocvar_cl_effects_lightningarc_drift_end;
+        branchfactor = autocvar_cl_effects_lightningarc_branchfactor_start;
+        branchfactor = autocvar_cl_effects_lightningarc_branchfactor_add;
 
         cl_effetcs_lightningarc(from,to,seglength,drifts,drifte,branchfactor,branchfactor_add);
     }
index 6f6e143934e39897f721d562d9a7a2dc4e77fe3e..1f8af46ca16c4178284485bfa93626b416506968 100644 (file)
@@ -51,7 +51,7 @@ void Gib_setmodel(entity gib, string mdlname, float specnum)
 void new_te_bloodshower (float ef, vector org, float explosionspeed, float howmany)
 {
        float i, pmod;
-       pmod = cvar("cl_particles_quality");
+       pmod = autocvar_cl_particles_quality;
        for (i = 0; i < 250 * pmod; ++i)
                pointparticles(ef, org, randomvec() * explosionspeed, howmany / 250);
 }
@@ -125,15 +125,15 @@ void TossGib (string mdlname, vector org, vector vconst, vector vrand, float spe
                gib.move_touch = SUB_RemoveOnNoImpact;
 
        gib.move_origin = gib.origin = org;
-       gib.move_velocity = vconst * cvar_or("cl_gibs_velocity_scale", 1) + vrand * cvar_or("cl_gibs_velocity_random", 1) + '0 0 1' * cvar("cl_gibs_velocity_up");
+       gib.move_velocity = vconst * autocvar_cl_gibs_velocity_scale + vrand * autocvar_cl_gibs_velocity_random + '0 0 1' * autocvar_cl_gibs_velocity_up;
        gib.move_avelocity = prandomvec() * vlen(gib.move_velocity);
        gib.move_time = time;
-       gib.damageforcescale = cvar_or("cl_gibs_damageforcescale", 3.5);
+       gib.damageforcescale = autocvar_cl_gibs_damageforcescale;
 
-       gib.nextthink = time + cvar_or("cl_gibs_lifetime", 14) * (1 + prandom() * 0.15);
+       gib.nextthink = time + autocvar_cl_gibs_lifetime * (1 + prandom() * 0.15);
        gib.drawmask = MASK_NORMAL;
 
-       RubbleLimit("gib", cvar_or("cl_gibs_maxcount",100), Gib_Delete);
+       RubbleLimit("gib", autocvar_cl_gibs_maxcount, Gib_Delete);
 }
 
 void Ent_GibSplash(float isNew)
@@ -153,8 +153,8 @@ void Ent_GibSplash(float isNew)
        org_z = ReadShort() * 4 + 2;
        vel = decompressShortVector(ReadShort());
 
-       float cl_gentle_gibs = cvar("cl_gentle_gibs");
-       if(cl_gentle_gibs || cvar("cl_gentle"))
+       float cl_gentle_gibs = autocvar_cl_gentle_gibs;
+       if(cl_gentle_gibs || autocvar_cl_gentle)
                type |= 0x80; // set gentle bit
 
        if(type & 0x80)
@@ -166,16 +166,16 @@ void Ent_GibSplash(float isNew)
                else
                        gentle_prefix = "morphed_";
        }
-       else if(cvar("cl_particlegibs"))
+       else if(autocvar_cl_particlegibs)
        {
                type |= 0x80;
                gentle_prefix = "particlegibs_";
        }
 
-       if not(cl_gentle_gibs || cvar("cl_gentle"))
-               amount *= 1 - cvar("cl_nogibs");
+       if not(cl_gentle_gibs || autocvar_cl_gentle)
+               amount *= 1 - autocvar_cl_nogibs;
 
-       if(cvar("ekg"))
+       if(autocvar_ekg)
                amount *= 5;
 
        if(amount <= 0 || !isNew)
index a995970b45fbbc4499afc306c512e6970d619913..09327e30aa89098acbaac9208f6ee7a82ffee225 100644 (file)
@@ -72,7 +72,7 @@ void Draw_GrapplingHook()
 
        InterpolateOrigin_Do();
 
-       s = cvar("cl_gunalign");
+       s = autocvar_cl_gunalign;
        if(s != 1 && s != 2 && s != 4)
                s = 3; // default value
        --s;
index 398df4f0164ddfb504c5cdcf90b86074dda590db..5536cec21eb71663b621e0cce499372c3e9624a9 100644 (file)
@@ -151,7 +151,7 @@ void centerprint(string strMessage)
 
        centerprint_expire = min(centerprint_expire, time); // if any of the returns happens, this message will fade out
 
-       if(cvar("scr_centertime") <= 0)
+       if(autocvar_scr_centertime <= 0)
                return;
 
        if(strMessage == "")
@@ -210,8 +210,8 @@ void centerprint(string strMessage)
        h = centerprint_fontsize_y*hcount;
 
        havail = vid_conheight;
-       if(cvar("con_chatpos") < 0)
-               havail -= (-cvar("con_chatpos") + cvar("con_chat")) * cvar("con_chatsize"); // avoid overlapping chat
+       if(autocvar_con_chatpos < 0)
+               havail -= (-autocvar_con_chatpos + autocvar_con_chat) * autocvar_con_chatsize; // avoid overlapping chat
        if(havail > vid_conheight - 70)
                havail = vid_conheight - 70; // avoid overlapping HUD
 
@@ -269,7 +269,7 @@ void centerprint(string strMessage)
 
        centerprint_num = i;
 
-       centerprint_expire = time + cvar("scr_centertime");
+       centerprint_expire = time + autocvar_scr_centertime;
 }
 
 void HUD_DrawCenterPrint (void)
@@ -289,7 +289,7 @@ void HUD_DrawCenterPrint (void)
 
        sz = 0.8 + (a / 5);
 
-       if(centerprint_num * cvar("scr_centersize") > 24 && scoreboard_active) // 24 = height of Scoreboard text
+       if(centerprint_num * autocvar_scr_centersize > 24 && scoreboard_active) // 24 = height of Scoreboard text
                centerprint_start_y = scoreboard_bottom + centerprint_fontsize_y;
 
        pos = centerprint_start;
@@ -427,7 +427,7 @@ HUD panels
 void HUD_Panel_ExportCfg(string cfgname)
 {
        float fh;
-       string filename = strcat("hud_", cvar_string("hud_skin"), "_", cfgname, ".cfg");
+       string filename = strcat("hud_", autocvar_hud_skin, "_", cfgname, ".cfg");
        fh = fopen(filename, FILE_WRITE);
        if(fh >= 0)
        {
@@ -843,8 +843,8 @@ void HUD_Panel_SetPosSize(vector mySize)
 
        if(highlightedPanel == HUD_PANEL_CHAT) // some panels have their own restrictions, like the chat panel (which actually only moves the engine chat print around). Looks bad if it's too small.
        {
-               mySize_x = max(17 * cvar("con_chatsize"), mySize_x);
-               mySize_y = max(2 * cvar("con_chatsize") + 2 * panel_bg_padding, mySize_y);
+               mySize_x = max(17 * autocvar_con_chatsize, mySize_x);
+               mySize_y = max(2 * autocvar_con_chatsize + 2 * panel_bg_padding, mySize_y);
        }
 
        // collision testing|
@@ -932,7 +932,7 @@ void HUD_Panel_Arrow_Action(float nPrimary)
        if (highlightedPanel_prev == -1 || mouseClicked)
                return;
 
-       hud_configure_checkcollisions = (!(hudShiftState & S_CTRL) && cvar("hud_configure_checkcollisions"));
+       hud_configure_checkcollisions = (!(hudShiftState & S_CTRL) && autocvar_hud_configure_checkcollisions);
 
        float step;
        if(autocvar_hud_configure_grid)
@@ -1349,7 +1349,7 @@ void HUD_Panel_Mouse()
        /*
        print("menu_enabled: ", ftos(menu_enabled), "\n");
        print("Highlighted: ", ftos(highlightedPanel), "\n");
-       print("Menu alpha: ", cvar_string("_menu_alpha"), "\n");
+       print("Menu alpha: ", ftos(autocvar__menu_alpha), "\n");
        */
 
        // instantly hide the editor cursor if we open the HUDExit dialog
@@ -1365,7 +1365,7 @@ void HUD_Panel_Mouse()
        if(highlightedPanel != -1)
                highlightedPanel_prev = highlightedPanel;
 
-       mousepos = mousepos + getmousepos() * cvar("menu_mouse_speed");
+       mousepos = mousepos + getmousepos() * autocvar_menu_mouse_speed;
 
        mousepos_x = bound(0, mousepos_x, vid_conwidth);
        mousepos_y = bound(0, mousepos_y, vid_conheight);
@@ -1384,7 +1384,7 @@ void HUD_Panel_Mouse()
 
                if (prev_pos != panel_pos || prev_size != panel_size)
                {
-                       hud_configure_checkcollisions = (!(hudShiftState & S_CTRL) && cvar("hud_configure_checkcollisions"));
+                       hud_configure_checkcollisions = (!(hudShiftState & S_CTRL) && autocvar_hud_configure_checkcollisions);
                        // backup!
                        panel_pos_backup = prev_pos;
                        panel_size_backup = prev_size;
@@ -1442,13 +1442,13 @@ void HUD_Panel_Mouse()
        cursorsize = '32 32 0';
 
        if(highlightcheck == 0)
-               drawpic(mousepos, strcat("gfx/menu/", cvar_string("menu_skin"), "/cursor.tga"), '32 32 0', '1 1 1', hud_fade_alpha, DRAWFLAG_NORMAL);
+               drawpic(mousepos, strcat("gfx/menu/", autocvar_menu_skin, "/cursor.tga"), '32 32 0', '1 1 1', hud_fade_alpha, DRAWFLAG_NORMAL);
        else if(highlightcheck == 1)
-               drawpic(mousepos - cursorsize * 0.5, strcat("gfx/menu/", cvar_string("menu_skin"), "/cursor_move.tga"), '32 32 0', '1 1 1', hud_fade_alpha, DRAWFLAG_NORMAL);
+               drawpic(mousepos - cursorsize * 0.5, strcat("gfx/menu/", autocvar_menu_skin, "/cursor_move.tga"), '32 32 0', '1 1 1', hud_fade_alpha, DRAWFLAG_NORMAL);
        else if(highlightcheck == 2)
-               drawpic(mousepos - cursorsize * 0.5, strcat("gfx/menu/", cvar_string("menu_skin"), "/cursor_resize.tga"), '32 32 0', '1 1 1', hud_fade_alpha, DRAWFLAG_NORMAL);
+               drawpic(mousepos - cursorsize * 0.5, strcat("gfx/menu/", autocvar_menu_skin, "/cursor_resize.tga"), '32 32 0', '1 1 1', hud_fade_alpha, DRAWFLAG_NORMAL);
        else
-               drawpic(mousepos - cursorsize * 0.5, strcat("gfx/menu/", cvar_string("menu_skin"), "/cursor_resize2.tga"), '32 32 0', '1 1 1', hud_fade_alpha, DRAWFLAG_NORMAL);
+               drawpic(mousepos - cursorsize * 0.5, strcat("gfx/menu/", autocvar_menu_skin, "/cursor_resize2.tga"), '32 32 0', '1 1 1', hud_fade_alpha, DRAWFLAG_NORMAL);
 
        prevMouseClicked = mouseClicked;
 }
@@ -1523,9 +1523,9 @@ void HUD_Weapons(void)
        if(!autocvar_hud_panel_weapons && !autocvar__hud_configure)
                return;
 
-       float timeout = cvar("hud_panel_weapons_timeout");
+       float timeout = autocvar_hud_panel_weapons_timeout;
        float timeout_effect_length, timein_effect_length;
-       if (cvar("hud_panel_weapons_timeout_effect") == 0)
+       if (autocvar_hud_panel_weapons_timeout_effect == 0)
        {
                timeout_effect_length = 0;
                timein_effect_length = 0;
@@ -1548,12 +1548,12 @@ void HUD_Weapons(void)
        if (timeout && time >= weapontime + timeout && !autocvar__hud_configure)
        {
                f = (time - (weapontime + timeout)) / timeout_effect_length;
-               if (cvar("hud_panel_weapons_timeout_effect"))
+               if (autocvar_hud_panel_weapons_timeout_effect)
                {
                        panel_bg_alpha *= (1 - f);
                        panel_fg_alpha *= (1 - f);
                }
-               if (cvar("hud_panel_weapons_timeout_effect") == 1)
+               if (autocvar_hud_panel_weapons_timeout_effect == 1)
                {
                        f *= f; // for a cooler movement
                        center_x = panel_pos_x + panel_size_x/2;
@@ -1579,12 +1579,12 @@ void HUD_Weapons(void)
        else if (timeout && time < weaponprevtime + timein_effect_length && !autocvar__hud_configure)
        {
                f = (time - weaponprevtime) / timein_effect_length;
-               if (cvar("hud_panel_weapons_timeout_effect"))
+               if (autocvar_hud_panel_weapons_timeout_effect)
                {
                        panel_bg_alpha *= (f);
                        panel_fg_alpha *= (f);
                }
-               if (cvar("hud_panel_weapons_timeout_effect") == 1)
+               if (autocvar_hud_panel_weapons_timeout_effect == 1)
                {
                        f *= f; // for a cooler movement
                        f = 1 - f;
@@ -1618,14 +1618,14 @@ void HUD_Weapons(void)
        }
 
        // TODO make this configurable
-       if(weaponorder_bypriority != cvar_string("cl_weaponpriority"))
+       if(weaponorder_bypriority != autocvar_cl_weaponpriority)
        {
                if(weaponorder_bypriority)
                        strunzone(weaponorder_bypriority);
                if(weaponorder_byimpulse)
                        strunzone(weaponorder_byimpulse);
 
-               weaponorder_bypriority = strzone(cvar_string("cl_weaponpriority"));
+               weaponorder_bypriority = strzone(autocvar_cl_weaponpriority);
                weaponorder_byimpulse = strzone(W_FixWeaponOrder_BuildImpulseList(W_FixWeaponOrder_ForceComplete(W_NumberWeaponOrder(weaponorder_bypriority))));
                weaponorder_cmp_str = strcat(" ", weaponorder_byimpulse, " ");
 
@@ -1651,7 +1651,7 @@ void HUD_Weapons(void)
                panel_size -= '2 2 0' * panel_bg_padding;
        }
 
-       if(cvar_or("hud_panel_weapons_fade", 1))
+       if(autocvar_hud_panel_weapons_fade)
        {
                wpnalpha = 3.2 - 2 * (time - weapontime);
                wpnalpha = bound(0.7, wpnalpha, 1) * panel_fg_alpha;
@@ -1662,7 +1662,7 @@ void HUD_Weapons(void)
        HUD_Weapons_Clear();
 
        float rows, columns;
-       float aspect = cvar("hud_panel_weapons_aspect");
+       float aspect = autocvar_hud_panel_weapons_aspect;
        rows = panel_size_y/panel_size_x;
        rows = bound(1, floor((sqrt(4 * aspect * rows * WEP_COUNT + rows * rows) + rows + 0.5) / 2), WEP_COUNT);
 
@@ -1671,9 +1671,9 @@ void HUD_Weapons(void)
 
        float a, type, fullammo;
        float when;
-       when = cvar("hud_panel_weapons_complainbubble_time");
+       when = autocvar_hud_panel_weapons_complainbubble_time;
        float fadetime;
-       fadetime = cvar("hud_panel_weapons_complainbubble_fadetime");
+       fadetime = autocvar_hud_panel_weapons_complainbubble_fadetime;
 
        vector color;
        vector wpnpos;
@@ -1684,16 +1684,16 @@ void HUD_Weapons(void)
        float ammo_alpha;
        wpnsize = eX * panel_size_x*(1/columns) + eY * panel_size_y*(1/rows);
        float barsize_x, barsize_y, baroffset_x, baroffset_y;
-       float show_ammo = cvar("hud_panel_weapons_ammo");
+       float show_ammo = autocvar_hud_panel_weapons_ammo;
        if (show_ammo)
        {
-               fullammo_shells = cvar("hud_panel_weapons_ammo_full_shells");
-               fullammo_nails = cvar("hud_panel_weapons_ammo_full_nails");
-               fullammo_rockets = cvar("hud_panel_weapons_ammo_full_rockets");
-               fullammo_cells = cvar("hud_panel_weapons_ammo_full_cells");
-               fullammo_fuel = cvar("hud_panel_weapons_ammo_full_fuel");
-               ammo_color = stov(cvar_string("hud_panel_weapons_ammo_color"));
-               ammo_alpha = panel_fg_alpha * cvar("hud_panel_weapons_ammo_alpha");
+               fullammo_shells = autocvar_hud_panel_weapons_ammo_full_shells;
+               fullammo_nails = autocvar_hud_panel_weapons_ammo_full_nails;
+               fullammo_rockets = autocvar_hud_panel_weapons_ammo_full_rockets;
+               fullammo_cells = autocvar_hud_panel_weapons_ammo_full_cells;
+               fullammo_fuel = autocvar_hud_panel_weapons_ammo_full_fuel;
+               ammo_color = stov(autocvar_hud_panel_weapons_ammo_color);
+               ammo_alpha = panel_fg_alpha * autocvar_hud_panel_weapons_ammo_alpha;
 
 
                if(wpnsize_x/wpnsize_y > aspect)
@@ -1712,7 +1712,7 @@ void HUD_Weapons(void)
 
        float show_accuracy;
        float weapon_stats;
-       if(cvar("hud_panel_weapons_accuracy") && acc_levels)
+       if(autocvar_hud_panel_weapons_accuracy && acc_levels)
        {
                show_accuracy = true;
                if (acc_col_x[0] == -1)
@@ -1721,7 +1721,7 @@ void HUD_Weapons(void)
        }
 
        float weapons_st = getstati(STAT_WEAPONS);
-       float label = cvar("hud_panel_weapons_label");
+       float label = autocvar_hud_panel_weapons_label;
 
        for(i = 0; i < weapon_cnt; ++i)
        {
@@ -1803,7 +1803,7 @@ void HUD_Weapons(void)
                }
 
                // draw the complain message
-               if(time - complain_weapon_time < when + fadetime && self.weapon == complain_weapon && cvar("hud_panel_weapons_complainbubble"))
+               if(time - complain_weapon_time < when + fadetime && self.weapon == complain_weapon && autocvar_hud_panel_weapons_complainbubble)
                {
                        if(fadetime)
                        {
@@ -1823,17 +1823,17 @@ void HUD_Weapons(void)
                        string s;
                        if(complain_weapon_type == 0) {
                                s = "Out of ammo";
-                               color = stov(cvar_string("hud_panel_weapons_complainbubble_color_outofammo"));
+                               color = stov(autocvar_hud_panel_weapons_complainbubble_color_outofammo);
                        }
                        else if(complain_weapon_type == 1) {
                                s = "Don't have";
-                               color = stov(cvar_string("hud_panel_weapons_complainbubble_color_donthave"));
+                               color = stov(autocvar_hud_panel_weapons_complainbubble_color_donthave);
                        }
                        else {
                                s = "Unavailable";
-                               color = stov(cvar_string("hud_panel_weapons_complainbubble_color_unavailable"));
+                               color = stov(autocvar_hud_panel_weapons_complainbubble_color_unavailable);
                        }
-                       float padding = cvar("hud_panel_weapons_complainbubble_padding");
+                       float padding = autocvar_hud_panel_weapons_complainbubble_padding;
                        drawpic_aspect_skin(wpnpos + '1 1 0' * padding, "weapon_complainbubble", wpnsize - '2 2 0' * padding, color, a * panel_fg_alpha, DRAWFLAG_NORMAL);
                        drawstring_aspect(wpnpos + '1 1 0' * padding, s, wpnsize - '2 2 0' * padding, '1 1 1', panel_fg_alpha * a, DRAWFLAG_NORMAL);
                }
@@ -1915,10 +1915,10 @@ void DrawAmmoItem(vector myPos, vector mySize, float itemcode, float currently_s
        if (currently_selected)
                drawpic_aspect_skin(myPos, "ammo_current_bg", mySize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
 
-    if(a > 0 && cvar("hud_panel_ammo_progressbar"))
-        HUD_Panel_DrawProgressBar(myPos + eX * cvar("hud_panel_ammo_progressbar_xoffset") * mySize_x, mySize - eX * cvar("hud_panel_ammo_progressbar_xoffset") * mySize_x, cvar_string("hud_panel_ammo_progressbar_name"), 0, 0, min(1, a/cvar("hud_panel_ammo_maxammo")), color, autocvar_hud_progressbar_alpha * panel_fg_alpha * alpha, DRAWFLAG_NORMAL);
+    if(a > 0 && autocvar_hud_panel_ammo_progressbar)
+        HUD_Panel_DrawProgressBar(myPos + eX * autocvar_hud_panel_ammo_progressbar_xoffset * mySize_x, mySize - eX * autocvar_hud_panel_ammo_progressbar_xoffset * mySize_x, autocvar_hud_panel_ammo_progressbar_name, 0, 0, min(1, a/autocvar_hud_panel_ammo_maxammo), color, autocvar_hud_progressbar_alpha * panel_fg_alpha * alpha, DRAWFLAG_NORMAL);
 
-    if(cvar("hud_panel_ammo_text"))
+    if(autocvar_hud_panel_ammo_text)
     {
         if(a > 0)
             drawstring_aspect(numpos, ftos(a), eX * (2/3) * mySize_x + eY * mySize_y, color, panel_fg_alpha * alpha, DRAWFLAG_NORMAL);
@@ -2127,34 +2127,34 @@ void HUD_Powerups(void) {
     string leftprogressname, rightprogressname;
        float leftcnt, rightcnt;
        float leftexact, rightexact;
-       float flip = cvar("hud_panel_powerups_flip");
+       float flip = autocvar_hud_panel_powerups_flip;
        if (flip) {
                leftname = "strength";
-        leftprogressname = cvar_string("hud_panel_powerups_progressbar_strength");
+        leftprogressname = autocvar_hud_panel_powerups_progressbar_strength;
                leftcnt = ceil(strength_time);
                leftexact = strength_time;
 
                rightname = "shield";
-        rightprogressname = cvar_string("hud_panel_powerups_progressbar_shield");
+        rightprogressname = autocvar_hud_panel_powerups_progressbar_shield;
                rightcnt = ceil(shield_time);
                rightexact = shield_time;
        } else {
                leftname = "shield";
-        leftprogressname = cvar_string("hud_panel_powerups_progressbar_shield");
+        leftprogressname = autocvar_hud_panel_powerups_progressbar_shield;
                leftcnt = ceil(shield_time);
                leftexact = shield_time;
 
                rightname = "strength";
-        rightprogressname = cvar_string("hud_panel_powerups_progressbar_strength");
+        rightprogressname = autocvar_hud_panel_powerups_progressbar_strength;
                rightcnt = ceil(strength_time);
                rightexact = strength_time;
        }
 
        drawfont = hud_bigfont;
-       float baralign = cvar("hud_panel_powerups_baralign");
+       float baralign = autocvar_hud_panel_powerups_baralign;
     float barflip;
-       float iconalign = cvar("hud_panel_powerups_iconalign");
-       float progressbar = cvar("hud_panel_powerups_progressbar");
+       float iconalign = autocvar_hud_panel_powerups_iconalign;
+       float progressbar = autocvar_hud_panel_powerups_progressbar;
        if (mySize_x/mySize_y > 4)
        {
         barsize = eX * 0.5 * mySize_x + eY * mySize_y;
@@ -2173,7 +2173,7 @@ void HUD_Powerups(void) {
                                HUD_Panel_GetProgressBarColorForString(leftname);
                                HUD_Panel_DrawProgressBar(barpos, barsize, leftprogressname, 0, barflip, min(1, leftcnt/30), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * bound(0, max(strength_time, shield_time), 1), DRAWFLAG_NORMAL);
                        }
-            if(cvar("hud_panel_powerups_text"))
+            if(autocvar_hud_panel_powerups_text)
             {
                 if(leftcnt > 1)
                     DrawNumIcon(iconalign, pos, eX * 0.5 * mySize_x + eY * mySize_y, leftcnt, leftname, 1, '1 1 1', 1);
@@ -2197,7 +2197,7 @@ void HUD_Powerups(void) {
                                HUD_Panel_GetProgressBarColorForString(rightname);
                                HUD_Panel_DrawProgressBar(barpos, barsize, rightprogressname, 0, barflip, min(1, rightcnt/30), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * bound(0, max(strength_time, shield_time), 1), DRAWFLAG_NORMAL);
                        }
-            if(cvar("hud_panel_powerups_text"))
+            if(autocvar_hud_panel_powerups_text)
             {
                 if(rightcnt > 1)
                     DrawNumIcon(iconalign, pos + eX * 0.5 * mySize_x, eX * 0.5 * mySize_x + eY * mySize_y, rightcnt, rightname, 0, '1 1 1', 1);
@@ -2223,7 +2223,7 @@ void HUD_Powerups(void) {
                                HUD_Panel_GetProgressBarColorForString(leftname);
                                HUD_Panel_DrawProgressBar(barpos, barsize, leftprogressname, 0, barflip, min(1, leftcnt/30), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * bound(0, max(strength_time, shield_time), 1), DRAWFLAG_NORMAL);
                        }
-            if(cvar("hud_panel_powerups_text"))
+            if(autocvar_hud_panel_powerups_text)
             {
                 if(leftcnt > 1)
                     DrawNumIcon(iconalign, pos, eX * mySize_x + eY * 0.5 * mySize_y, leftcnt, leftname, 1, '1 1 1', 1);
@@ -2246,7 +2246,7 @@ void HUD_Powerups(void) {
                                HUD_Panel_GetProgressBarColorForString(rightname);
                                HUD_Panel_DrawProgressBar(barpos, barsize, rightprogressname, 0, barflip, min(1, rightcnt/30), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * bound(0, max(strength_time, shield_time), 1), DRAWFLAG_NORMAL);
                        }
-            if(cvar("hud_panel_powerups_text"))
+            if(autocvar_hud_panel_powerups_text)
             {
                 if(rightcnt > 1)
                     DrawNumIcon(iconalign, pos + eY * 0.5 * mySize_y, eX * mySize_x + eY * 0.5 * mySize_y, rightcnt, rightname, 0, '1 1 1', 1);
@@ -2280,7 +2280,7 @@ void HUD_Powerups(void) {
                                HUD_Panel_GetProgressBarColorForString(leftname);
                                HUD_Panel_DrawProgressBar(barpos, barsize, leftprogressname, 1, barflip, min(1, leftcnt/30), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * bound(0, max(strength_time, shield_time), 1), DRAWFLAG_NORMAL);
                        }
-            if(cvar("hud_panel_powerups_text"))
+            if(autocvar_hud_panel_powerups_text)
             {
                 if(leftcnt <= 5)
                     drawpic_aspect_skin_expanding(picpos, leftname, '0.4 0.4 0' * mySize_x, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL, bound(0, (leftcnt - leftexact) / 0.5, 1));
@@ -2312,7 +2312,7 @@ void HUD_Powerups(void) {
                                HUD_Panel_GetProgressBarColorForString(rightname);
                                HUD_Panel_DrawProgressBar(barpos, barsize, rightprogressname, 1, barflip, min(1, rightcnt/30), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * bound(0, max(strength_time, shield_time), 1), DRAWFLAG_NORMAL);
                        }
-            if(cvar("hud_panel_powerups_text"))
+            if(autocvar_hud_panel_powerups_text)
             {
                 if(rightcnt <= 5)
                     drawpic_aspect_skin_expanding(picpos, rightname, '0.4 0.4 0' * mySize_x, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL, bound(0, (rightcnt - rightexact) / 0.5, 1));
@@ -2365,12 +2365,12 @@ void HUD_HealthArmor(void)
        vector numpos;
 
        drawfont = hud_bigfont;
-       float baralign = cvar("hud_panel_healtharmor_baralign");
-       float iconalign = cvar("hud_panel_healtharmor_iconalign");
-       float progressbar = cvar("hud_panel_healtharmor_progressbar");
+       float baralign = autocvar_hud_panel_healtharmor_baralign;
+       float iconalign = autocvar_hud_panel_healtharmor_iconalign;
+       float progressbar = autocvar_hud_panel_healtharmor_progressbar;
 
-    float maxhealth = cvar("hud_panel_healtharmor_maxhealth");
-    float maxarmor = cvar("hud_panel_healtharmor_maxarmor");
+    float maxhealth = autocvar_hud_panel_healtharmor_maxhealth;
+    float maxarmor = autocvar_hud_panel_healtharmor_maxarmor;
        if(autocvar_hud_panel_healtharmor == 2) // combined health and armor display
        {
                vector v;
@@ -2391,10 +2391,10 @@ void HUD_HealthArmor(void)
                        if(progressbar)
                        {
                                HUD_Panel_GetProgressBarColor(health);
-                               HUD_Panel_DrawProgressBar(barpos, barsize, cvar_string("hud_panel_healtharmor_progressbar_health"), 0, mod(baralign, 2), x/maxtotal, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+                               HUD_Panel_DrawProgressBar(barpos, barsize, autocvar_hud_panel_healtharmor_progressbar_health, 0, mod(baralign, 2), x/maxtotal, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
                        }
                        if(armor)
-            if(cvar("hud_panel_healtharmor_text"))
+            if(autocvar_hud_panel_healtharmor_text)
                                drawpic_aspect_skin(pos + eX * mySize_x - eX * 0.5 * mySize_y, "armor", '0.5 0.5 0' * mySize_y, '1 1 1', panel_fg_alpha * armor / health, DRAWFLAG_NORMAL);
                }
                else
@@ -2403,13 +2403,13 @@ void HUD_HealthArmor(void)
                        if(progressbar)
                        {
                                HUD_Panel_GetProgressBarColor(armor);
-                               HUD_Panel_DrawProgressBar(barpos, barsize, cvar_string("hud_panel_healtharmor_progressbar_armor"), 0, mod(baralign, 2), x/maxtotal, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+                               HUD_Panel_DrawProgressBar(barpos, barsize, autocvar_hud_panel_healtharmor_progressbar_armor, 0, mod(baralign, 2), x/maxtotal, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
                        }
                        if(health)
-            if(cvar("hud_panel_healtharmor_text"))
+            if(autocvar_hud_panel_healtharmor_text)
                                drawpic_aspect_skin(pos + eX * mySize_x - eX * 0.5 * mySize_y, "health", '0.5 0.5 0' * mySize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
                }
-        if(cvar("hud_panel_healtharmor_text"))
+        if(autocvar_hud_panel_healtharmor_text)
             DrawNumIcon(iconalign, pos, mySize, x, biggercount, 1, HUD_Get_Num_Color(x, maxtotal), 1);
 
                // fuel
@@ -2429,11 +2429,11 @@ void HUD_HealthArmor(void)
                float leftmax, rightmax;
                float leftactive, rightactive;
                float leftalpha, rightalpha;
-               float flip = cvar("hud_panel_healtharmor_flip");
+               float flip = autocvar_hud_panel_healtharmor_flip;
         float barflip;
                if (flip) { // old style layout with armor left/top of health
                        leftname = "armor";
-            leftprogressname = cvar_string("hud_panel_healtharmor_progressbar_armor");
+            leftprogressname = autocvar_hud_panel_healtharmor_progressbar_armor;
                        leftcnt = armor;
                        if(leftcnt)
                                leftactive = 1;
@@ -2441,21 +2441,21 @@ void HUD_HealthArmor(void)
             leftmax = maxarmor;
 
                        rightname = "health";
-            rightprogressname = cvar_string("hud_panel_healtharmor_progressbar_health");
+            rightprogressname = autocvar_hud_panel_healtharmor_progressbar_health;
                        rightcnt = health;
                        rightactive = 1;
                        rightalpha = 1;
             rightmax = maxhealth;
                } else {
                        leftname = "health";
-            leftprogressname = cvar_string("hud_panel_healtharmor_progressbar_health");
+            leftprogressname = autocvar_hud_panel_healtharmor_progressbar_health;
                        leftcnt = health;
                        leftactive = 1;
                        leftalpha = 1;
             leftmax = maxhealth;
 
                        rightname = "armor";
-            rightprogressname = cvar_string("hud_panel_healtharmor_progressbar_armor");
+            rightprogressname = autocvar_hud_panel_healtharmor_progressbar_armor;
                        rightcnt = armor;
                        if(rightcnt)
                                rightactive = 1;
@@ -2480,7 +2480,7 @@ void HUD_HealthArmor(void)
                                        HUD_Panel_GetProgressBarColorForString(leftname);
                     HUD_Panel_DrawProgressBar(barpos, barsize, leftprogressname, 0, barflip, min(1, leftcnt/leftmax), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
                                }
-                if(cvar("hud_panel_healtharmor_text"))
+                if(autocvar_hud_panel_healtharmor_text)
                     DrawNumIcon(iconalign, pos, eX * 0.5 * mySize_x + eY * mySize_y, leftcnt, leftname, 1, HUD_Get_Num_Color(leftcnt, leftmax), 1);
                        }
 
@@ -2498,7 +2498,7 @@ void HUD_HealthArmor(void)
                                        HUD_Panel_GetProgressBarColorForString(rightname);
                     HUD_Panel_DrawProgressBar(barpos, barsize, rightprogressname, 0, barflip, min(1, rightcnt/rightmax), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
                                }
-                if(cvar("hud_panel_healtharmor_text"))
+                if(autocvar_hud_panel_healtharmor_text)
                     DrawNumIcon(iconalign, pos + eX * 0.5 * mySize_x, eX * 0.5 * mySize_x + eY * mySize_y, rightcnt, rightname, 0, HUD_Get_Num_Color(rightcnt, rightmax), 1);
                        }
 
@@ -2527,7 +2527,7 @@ void HUD_HealthArmor(void)
                                        HUD_Panel_GetProgressBarColorForString(leftname);
                     HUD_Panel_DrawProgressBar(barpos, barsize, leftprogressname, 0, barflip, min(1, leftcnt/leftmax), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
                                }
-                if(cvar("hud_panel_healtharmor_text"))
+                if(autocvar_hud_panel_healtharmor_text)
                     DrawNumIcon(iconalign, pos, eX * mySize_x + eY * 0.5 * mySize_y, leftcnt, leftname, 1, HUD_Get_Num_Color(leftcnt, leftmax), 1);
                        }
 
@@ -2545,7 +2545,7 @@ void HUD_HealthArmor(void)
                                        HUD_Panel_GetProgressBarColorForString(rightname);
                     HUD_Panel_DrawProgressBar(barpos, barsize, rightprogressname, 0, barflip, min(1, rightcnt/rightmax), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
                                }
-                if(cvar("hud_panel_healtharmor_text"))
+                if(autocvar_hud_panel_healtharmor_text)
                     DrawNumIcon(iconalign, pos + eY * 0.5 * mySize_y, eX * mySize_x + eY * 0.5 * mySize_y, rightcnt, rightname, 0, HUD_Get_Num_Color(rightcnt, rightmax), 1);
                        }
 
@@ -2582,7 +2582,7 @@ void HUD_HealthArmor(void)
                                        HUD_Panel_GetProgressBarColorForString(leftname);
                     HUD_Panel_DrawProgressBar(barpos, barsize, leftprogressname, 1, barflip, min(1, leftcnt/leftmax), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
                                }
-                if(cvar("hud_panel_healtharmor_text"))
+                if(autocvar_hud_panel_healtharmor_text)
                 {
                     drawpic_aspect_skin(picpos, leftname, '0.4 0.4 0' * mySize_x, '1 1 1', leftalpha * panel_fg_alpha, DRAWFLAG_NORMAL);
                     drawstring_aspect(numpos, ftos(leftcnt), eX * 0.5 * mySize_x + eY * 0.25 * mySize_x, HUD_Get_Num_Color(leftcnt, leftmax), panel_fg_alpha, DRAWFLAG_NORMAL);
@@ -2611,7 +2611,7 @@ void HUD_HealthArmor(void)
                                        HUD_Panel_GetProgressBarColorForString(rightname);
                     HUD_Panel_DrawProgressBar(barpos, barsize, rightprogressname, 1, barflip, min(1, rightcnt/rightmax), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
                                }
-                if(cvar("hud_panel_healtharmor_text"))
+                if(autocvar_hud_panel_healtharmor_text)
                 {
                     drawpic_aspect_skin(picpos, rightname, '0.4 0.4 0' * mySize_x, '1 1 1', rightalpha * panel_fg_alpha, DRAWFLAG_NORMAL);
                     drawstring_aspect(numpos, ftos(rightcnt), eX * 0.5 * mySize_x + eY * 0.25 * mySize_x, HUD_Get_Num_Color(rightcnt, rightmax), panel_fg_alpha, DRAWFLAG_NORMAL);
@@ -2674,8 +2674,8 @@ void HUD_KillNotify(string s1, string s2, string s3, float type, float msg) // s
 {
        float w;
        float alsoprint, gentle;
-       alsoprint = (cvar("hud_panel_notify_print") || !panel_enabled); // print message to console if: notify panel disabled, or cvar to do so enabled
-       gentle = (cvar("cl_gentle") || cvar("cl_gentle_messages"));
+       alsoprint = (autocvar_hud_panel_notify_print || !panel_enabled); // print message to console if: notify panel disabled, or cvar to do so enabled
+       gentle = (autocvar_cl_gentle || autocvar_cl_gentle_messages);
        
        if ((msg == MSG_SUICIDE || msg == MSG_KILL || msg == MSG_KILL_ACTION) && gametype == GAME_CTS) // selfkill isn't interesting in CTS and only spams up the notify panel
                return;
@@ -3042,7 +3042,7 @@ void HUD_KillNotify(string s1, string s2, string s3, float type, float msg) // s
 void HUD_Centerprint(string s1, string s2, float type, float msg)
 {
        float gentle;
-       gentle = (cvar("cl_gentle") || cvar("cl_gentle_messages"));
+       gentle = (autocvar_cl_gentle || autocvar_cl_gentle_messages);
        if(msg == MSG_SUICIDE) {
                if (type == DEATH_TEAMCHANGE) {
                        centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "You are now on: ", s1));
@@ -3153,9 +3153,9 @@ void HUD_Notify (void)
 
        float a;
        float when;
-       when = cvar("hud_panel_notify_time");
+       when = autocvar_hud_panel_notify_time;
        float fadetime;
-       fadetime = cvar("hud_panel_notify_fadetime");
+       fadetime = autocvar_hud_panel_notify_fadetime;
 
        string s;
 
@@ -3165,7 +3165,7 @@ void HUD_Notify (void)
        string attacker, victim;
 
        float i, j, w, step, limit;
-       if(cvar("hud_panel_notify_flip")) //order items from the top down
+       if(autocvar_hud_panel_notify_flip) //order items from the top down
        {
                i = 0;
                step = +1;
@@ -3920,7 +3920,7 @@ void HUD_VoteWindow(void)
        if(!autocvar__hud_configure)
        {
                panel_fg_alpha = autocvar_hud_panel_fg_alpha;
-               panel_bg_alpha_str = cvar_string("hud_panel_vote_bg_alpha");
+               panel_bg_alpha_str = autocvar_hud_panel_vote_bg_alpha;
 
                if(panel_bg_alpha_str == "") {
                        panel_bg_alpha_str = ftos(autocvar_hud_panel_bg_alpha);
@@ -3964,7 +3964,7 @@ void HUD_VoteWindow(void)
        pos = panel_pos;
        mySize = panel_size;
 
-       a = vote_alpha * bound(cvar("hud_panel_vote_alreadyvoted_alpha"), 1 - vote_highlighted, 1);
+       a = vote_alpha * bound(autocvar_hud_panel_vote_alreadyvoted_alpha, 1 - vote_highlighted, 1);
        HUD_Panel_DrawBg(a);
        a = panel_fg_alpha * a;
 
@@ -4483,9 +4483,9 @@ void HUD_Mod_Race(vector pos, vector mySize)
 
        if(score && (score < t || !t)) {
                db_put(ClientProgsDB, strcat(shortmapname, rr, "time"), ftos(score));
-               if(cvar("cl_autodemo_delete_keeprecords"))
+               if(autocvar_cl_autodemo_delete_keeprecords)
                {
-                       f = cvar("cl_autodemo_delete");
+                       f = autocvar_cl_autodemo_delete;
                        f &~= 1;
                        cvar_set("cl_autodemo_delete", ftos(f)); // don't delete demo with new record!
                }
@@ -4674,7 +4674,7 @@ void HUD_DrawPressedKeys(void)
        }
 
        // force custom aspect
-       float aspect = cvar("hud_panel_pressedkeys_aspect");
+       float aspect = autocvar_hud_panel_pressedkeys_aspect;
        if(aspect)
        {
                vector newSize;
@@ -4755,20 +4755,20 @@ void HUD_Chat(void)
        cvar_set("con_chatrect_y", ftos(pos_y/vid_conheight));
 
        cvar_set("con_chatwidth", ftos(mySize_x/vid_conwidth));
-       cvar_set("con_chat", ftos(floor(mySize_y/cvar("con_chatsize") - 0.5)));
+       cvar_set("con_chat", ftos(floor(mySize_y/autocvar_con_chatsize - 0.5)));
 
        if(autocvar__hud_configure)
        {
                float chatsize;
-               chatsize = cvar("con_chatsize");
+               chatsize = autocvar_con_chatsize;
                cvar_set("con_chatrect_x", "9001"); // over 9000, we'll fake it instead for more control over alpha and such
                float i, a;
-               for(i = 0; i < cvar("con_chat"); ++i)
+               for(i = 0; i < autocvar_con_chat; ++i)
                {
-                       if(i == cvar("con_chat") - 1)
+                       if(i == autocvar_con_chat - 1)
                                a = panel_fg_alpha;
                        else
-                               a = panel_fg_alpha * floor(((i + 1) * 7 + cvar("con_chattime"))/45);
+                               a = panel_fg_alpha * floor(((i + 1) * 7 + autocvar_con_chattime)/45);
                        drawcolorcodedstring(pos + eY * i * chatsize, textShortenToWidth("^3Player^7: This is the chat area.", mySize_x, '1 1 0' * chatsize, stringwidth_colors), '1 1 0' * chatsize, a, DRAWFLAG_NORMAL);
                }
        }
@@ -4822,7 +4822,7 @@ void HUD_EngineInfo(void)
        else
        {
                framecounter += 1;
-               if(currentTime - prevfps_time > cvar("hud_panel_engineinfo_framecounter_time"))
+               if(currentTime - prevfps_time > autocvar_hud_panel_engineinfo_framecounter_time)
                {
                        prevfps = framecounter/(currentTime - prevfps_time);
                        framecounter = 0;
@@ -4833,7 +4833,7 @@ void HUD_EngineInfo(void)
        vector color;
        color = HUD_Get_Num_Color (prevfps, 100);
        drawfont = hud_bigfont;
-       drawstring_aspect(pos, strcat("FPS: ", ftos_decimals(prevfps, cvar("hud_panel_engineinfo_framecounter_decimals"))), mySize, color, panel_fg_alpha, DRAWFLAG_NORMAL);
+       drawstring_aspect(pos, strcat("FPS: ", ftos_decimals(prevfps, autocvar_hud_panel_engineinfo_framecounter_decimals)), mySize, color, panel_fg_alpha, DRAWFLAG_NORMAL);
        drawfont = hud_font;
 }
 
@@ -5035,7 +5035,7 @@ void HUD_ShowSpeed(void)
        float pos, conversion_factor;
        string speed, zspeed, unit;
 
-       switch(cvar("cl_showspeed_unit"))
+       switch(autocvar_cl_showspeed_unit)
        {
                default:
                case 0:
@@ -5066,13 +5066,13 @@ void HUD_ShowSpeed(void)
 
        speed = strcat(ftos(floor( vlen(pmove_vel - pmove_vel_z * '0 0 1') * conversion_factor + 0.5 )), unit);
 
-       numsize_x = numsize_y = cvar("cl_showspeed_size");
-       pos = (vid_conheight - numsize_y) * cvar("cl_showspeed_position");
+       numsize_x = numsize_y = autocvar_cl_showspeed_size;
+       pos = (vid_conheight - numsize_y) * autocvar_cl_showspeed_position;
 
        drawfont = hud_bigfont;
        drawstringcenter(eX + pos * eY, speed, numsize, '1 1 1', autocvar_hud_panel_fg_alpha * hud_fade_alpha, DRAWFLAG_NORMAL);
 
-       if (cvar("cl_showspeed_z") == 1) {
+       if (autocvar_cl_showspeed_z == 1) {
                zspeed = strcat(ftos(fabs(floor( pmove_vel_z * conversion_factor + 0.5 ))), unit);
                drawstringcenter(eX + pos * eY + numsize_y * eY, zspeed, numsize * 0.5, '1 1 1', autocvar_hud_panel_fg_alpha * hud_fade_alpha, DRAWFLAG_NORMAL);
        }
@@ -5092,7 +5092,7 @@ void HUD_ShowAcceleration(void)
        top_y = 0;
 
        f = time - acc_prevtime;
-       if(cvar("cl_showacceleration_z"))
+       if(autocvar_cl_showacceleration_z)
                acceleration = (vlen(pmove_vel) - vlen(acc_prevspeed)) * (1 / f);
        else
                acceleration = (vlen(pmove_vel - '0 0 1' * pmove_vel_z) - vlen(acc_prevspeed - '0 0 1' * acc_prevspeed_z)) * (1 / f);
@@ -5105,13 +5105,13 @@ void HUD_ShowAcceleration(void)
        if (acceleration == 0)
                return;
 
-       pos = top - sz/2 * eY + (cvar("cl_showacceleration_position") * vid_conheight) * eY;
+       pos = top - sz/2 * eY + (autocvar_cl_showacceleration_position * vid_conheight) * eY;
 
-       sz = cvar("cl_showacceleration_size");
-       scale = cvar("cl_showacceleration_scale");
-       alpha = cvar("cl_showacceleration_alpha");
-       if (cvar("cl_showacceleration_color_custom"))
-               rgb = stov(cvar_string("cl_showacceleration_color"));
+       sz = autocvar_cl_showacceleration_size;
+       scale = autocvar_cl_showacceleration_scale;
+       alpha = autocvar_cl_showacceleration_alpha;
+       if (autocvar_cl_showacceleration_color_custom)
+               rgb = stov(autocvar_cl_showacceleration_color);
        else {
                if (acceleration < 0)
                        rgb = '1 .5 .5' - '0 .5 .5' * bound(0, -acceleration * 0.2, 1);
@@ -5191,11 +5191,11 @@ void HUD_Main (void)
                return;
 
        // Drawing stuff
-       if (hud_skin_path != cvar_string("hud_skin"))
+       if (hud_skin_path != autocvar_hud_skin)
        {
                if (hud_skin_path)
                        strunzone(hud_skin_path);
-               hud_skin_path = strzone(strcat("gfx/hud/", cvar_string("hud_skin")));
+               hud_skin_path = strzone(strcat("gfx/hud/", autocvar_hud_skin));
        }
 
        // HUD configure visible grid
@@ -5218,7 +5218,7 @@ void HUD_Main (void)
        {
                float f;
                vector color;
-               float hud_dock_color_team = cvar("hud_dock_color_team");
+               float hud_dock_color_team = autocvar_hud_dock_color_team;
                if((teamplay) && hud_dock_color_team) {
                        f = stof(getplayerkey(player_localentnum - 1, "colors"));
                        color = colormapPaletteColor(mod(f, 16), 1) * hud_dock_color_team;
@@ -5228,7 +5228,7 @@ void HUD_Main (void)
                }
                else
                {
-                       string hud_dock_color = cvar_string("hud_dock_color");
+                       string hud_dock_color = autocvar_hud_dock_color;
                        if(hud_dock_color == "shirt") {
                                f = stof(getplayerkey(player_localentnum - 1, "colors"));
                                color = colormapPaletteColor(floor(f / 16), 0);
@@ -5249,7 +5249,7 @@ void HUD_Main (void)
                                pic = "gfx/hud/default/dock_medium";
                        }
                }
-               drawpic('0 0 0', pic, eX * vid_conwidth + eY * vid_conheight, color, cvar("hud_dock_alpha") * hud_fade_alpha, DRAWFLAG_NORMAL); // no aspect ratio forcing on dock...
+               drawpic('0 0 0', pic, eX * vid_conwidth + eY * vid_conheight, color, autocvar_hud_dock_alpha * hud_fade_alpha, DRAWFLAG_NORMAL); // no aspect ratio forcing on dock...
        }
 
        // cache the panel order into the panel_order array
@@ -5273,9 +5273,9 @@ void HUD_Main (void)
                HUD_Chat(); // HUD_DrawPanel(HUD_PANEL_CHAT);
 
        // TODO hud_'ify these
-       if (cvar("cl_showspeed"))
+       if (autocvar_cl_showspeed)
                HUD_ShowSpeed();
-       if (cvar("cl_showacceleration"))
+       if (autocvar_cl_showacceleration)
                HUD_ShowAcceleration();
 
        if (autocvar__hud_configure && spectatee_status && hud_configure_prev == -1) // try to join if we are in hud_configure mode, but still spectating, and in the first frame (in order to get rid of motd when launching a server via the menu "HUD Setup" button)
index 40fcfda11cda44efbbf29b787f599be41c069489..8ff4817b0ff113c49b05d36262c4ea273742313c 100644 (file)
@@ -172,9 +172,9 @@ void MapVote_Draw()
        xmin = vid_conwidth*0.05; // 5% border must suffice
        xmax = vid_conwidth - xmin;
        ymin = 20;
-       i = cvar("con_chatpos"); //*cvar("con_chatsize");
+       i = autocvar_con_chatpos; //*autocvar_con_chatsize;
        if(i < 0)
-               ymax = vid_conheight + (i - cvar("con_chat")) * cvar("con_chatsize");
+               ymax = vid_conheight + (i - autocvar_con_chat) * autocvar_con_chatsize;
        if(i >= 0 || ymax < (vid_conheight*0.5))
                ymax = vid_conheight - ymin;
 
@@ -244,7 +244,7 @@ void MapVote_Draw()
                MapVote_DrawAbstain(pos, isize, xmax - xmin, tmp, i);
        }
 
-       drawpic(mv_mousepos, strcat("gfx/menu/", cvar_string("menu_skin"), "/cursor.tga"), '32 32 0', '1 1 1', autocvar_hud_panel_fg_alpha, DRAWFLAG_NORMAL);
+       drawpic(mv_mousepos, strcat("gfx/menu/", autocvar_menu_skin, "/cursor.tga"), '32 32 0', '1 1 1', autocvar_hud_panel_fg_alpha, DRAWFLAG_NORMAL);
 }
 
 void Cmd_MapVote_MapDownload(float argc)
index b37e209a569bbd74faa991ea2b75b35f21bc334a..57e25810f7664de12d5e8ccf62d4e4f66494a1b8 100644 (file)
@@ -8,7 +8,7 @@ void serverAnnouncer()
        // check for pending announcement, play it and remove it
        if(announce_snd != "")
        {
-               sound(world, CHAN_AUTO, strcat("announcer/", cvar_string("cl_announcer"), "/", announce_snd, ".wav"), VOL_BASEVOICE, ATTN_NONE);
+               sound(world, CHAN_AUTO, strcat("announcer/", autocvar_cl_announcer, "/", announce_snd, ".wav"), VOL_BASEVOICE, ATTN_NONE);
                strunzone(announce_snd);
                announce_snd = "";
        }
@@ -22,7 +22,7 @@ void restartAnnouncer_Think() {
                if (!spectatee_status) //do cprint only for players
                        centerprint("^1Begin!");
 
-               sound(world, CHAN_AUTO, strcat("announcer/", cvar_string("cl_announcer"), "/begin.wav"), VOL_BASEVOICE, ATTN_NONE);
+               sound(world, CHAN_AUTO, strcat("announcer/", autocvar_cl_announcer, "/begin.wav"), VOL_BASEVOICE, ATTN_NONE);
                //reset maptime announcers now as well
                announcer_5min = announcer_1min = FALSE;
 
@@ -34,7 +34,7 @@ void restartAnnouncer_Think() {
                        centerprint(strcat("^1Game starts in ", ftos(countdown_rounded), " seconds"));
 
                if(countdown_rounded <= 3 && countdown_rounded >= 1) {
-                       sound(world, CHAN_AUTO, strcat("announcer/", cvar_string("cl_announcer"), "/", ftos(countdown_rounded), ".wav"), VOL_BASEVOICE, ATTN_NONE);
+                       sound(world, CHAN_AUTO, strcat("announcer/", autocvar_cl_announcer, "/", ftos(countdown_rounded), ".wav"), VOL_BASEVOICE, ATTN_NONE);
                }
 
                self.nextthink = getstatf(STAT_GAMESTARTTIME) - (countdown - 1);
@@ -53,14 +53,14 @@ void maptimeAnnouncer() {
        float warmuplimit;
        float warmuptimeleft;
        if(warmup_stage) {
-               warmuplimit = cvar("g_warmup_limit");
+               warmuplimit = autocvar_g_warmup_limit;
                if(warmuplimit > 0) {
                        warmuptimeleft = max(0, warmuplimit + getstatf(STAT_GAMESTARTTIME) - time); 
                }
        }
 
        //5 minute check
-       if (cvar("cl_sound_maptime_warning") >= 2) {
+       if (autocvar_cl_sound_maptime_warning >= 2) {
                //make sure that after connect (and e.g. 4 minutes left) we will not get a wrong sound
                if(announcer_5min)
                {
@@ -72,12 +72,12 @@ void maptimeAnnouncer() {
                        if not (warmuplimit == -1 && warmup_stage) {
                                announcer_5min = TRUE;
                                //dprint("i will play the sound, I promise!\n");
-                               sound(world, CHAN_AUTO, strcat("announcer/", cvar_string("cl_announcer"), "/5minutesremain.wav"), VOL_BASEVOICE, ATTN_NONE);
+                               sound(world, CHAN_AUTO, strcat("announcer/", autocvar_cl_announcer, "/5minutesremain.wav"), VOL_BASEVOICE, ATTN_NONE);
                        }
        }
 
        //1 minute check
-       if (cvar("cl_sound_maptime_warning") == 1 || cvar("cl_sound_maptime_warning") == 3) {
+       if (autocvar_cl_sound_maptime_warning == 1 || autocvar_cl_sound_maptime_warning == 3) {
                if (announcer_1min)
                {
                        if(((!warmup_stage || warmuplimit == 0) && timeleft > 60) || (warmup_stage && warmuplimit > 0 && warmuptimeleft > 60))
@@ -87,7 +87,7 @@ void maptimeAnnouncer() {
                        //if we're in warmup mode, check whether there's a warmup timelimit
                        if not (warmuplimit == -1 && warmup_stage) {
                                announcer_1min = TRUE;
-                               sound(world, CHAN_AUTO, strcat("announcer/", cvar_string("cl_announcer"), "/1minuteremains.wav"), VOL_BASEVOICE, ATTN_NONE);
+                               sound(world, CHAN_AUTO, strcat("announcer/", autocvar_cl_announcer, "/1minuteremains.wav"), VOL_BASEVOICE, ATTN_NONE);
                        }
        }
 }
@@ -102,7 +102,7 @@ void carrierAnnouncer() {
        float pickup;
        string item;
 
-       if not(cvar("cl_notify_carried_items"))
+       if not(autocvar_cl_notify_carried_items)
                return;
 
        stat_items = getstati(STAT_ITEMS);
@@ -123,11 +123,11 @@ void carrierAnnouncer() {
        if (item)
        {
                if (pickup) {
-                       if (cvar("cl_notify_carried_items") & 2)
+                       if (autocvar_cl_notify_carried_items & 2)
                                centerprint(strcat("You picked up the ", item, "!"));
                }
                else {
-                       if (cvar("cl_notify_carried_items") & 1)
+                       if (autocvar_cl_notify_carried_items & 1)
                                centerprint(strcat("You got the ", item, "!"));
                }
        }
@@ -141,50 +141,50 @@ void carrierAnnouncer() {
  * TODO: announcer queues
  */
 void Announcer_Precache () {
-       precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/1minuteremains.wav"));
-       precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/5minutesremain.wav"));
-
-       precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/electrobitch.wav"));
-       precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/airshot.wav"));
-       precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/03kills.wav"));
-       precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/05kills.wav"));
-       precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/10kills.wav"));
-       precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/15kills.wav"));
-       precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/20kills.wav"));
-       precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/25kills.wav"));
-       precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/30kills.wav"));
-       precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/botlike.wav"));
-       precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/yoda.wav"));
-       precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/amazing.wav"));
-       precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/awesome.wav"));
-       precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/headshot.wav"));
-       precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/impressive.wav"));
-
-       precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/prepareforbattle.wav"));
-       precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/begin.wav"));
-       precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/timeoutcalled.wav"));
-       precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/1fragleft.wav"));
-       precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/2fragsleft.wav"));
-       precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/3fragsleft.wav"));
-       precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/terminated.wav"));
-
-       precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/1.wav"));
-       precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/2.wav"));
-       precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/3.wav"));
-       precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/4.wav"));
-       precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/5.wav"));
-       precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/6.wav"));
-       precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/7.wav"));
-       precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/8.wav"));
-       precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/9.wav"));
-       precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/10.wav"));
-
-       precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/lastsecond.wav"));
-       precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/narrowly.wav"));
-
-       precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/voteaccept.wav"));
-       precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/votecall.wav"));
-       precache_sound (strcat("announcer/", cvar_string("cl_announcer"), "/votefail.wav"));
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/1minuteremains.wav"));
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/5minutesremain.wav"));
+
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/electrobitch.wav"));
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/airshot.wav"));
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/03kills.wav"));
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/05kills.wav"));
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/10kills.wav"));
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/15kills.wav"));
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/20kills.wav"));
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/25kills.wav"));
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/30kills.wav"));
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/botlike.wav"));
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/yoda.wav"));
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/amazing.wav"));
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/awesome.wav"));
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/headshot.wav"));
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/impressive.wav"));
+
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/prepareforbattle.wav"));
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/begin.wav"));
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/timeoutcalled.wav"));
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/1fragleft.wav"));
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/2fragsleft.wav"));
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/3fragsleft.wav"));
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/terminated.wav"));
+
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/1.wav"));
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/2.wav"));
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/3.wav"));
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/4.wav"));
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/5.wav"));
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/6.wav"));
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/7.wav"));
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/8.wav"));
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/9.wav"));
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/10.wav"));
+
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/lastsecond.wav"));
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/narrowly.wav"));
+
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/voteaccept.wav"));
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/votecall.wav"));
+       precache_sound (strcat("announcer/", autocvar_cl_announcer, "/votefail.wav"));
 }
 
 void AuditLists()
@@ -329,7 +329,7 @@ float PreviewExists(string name)
        float f;
        string file;
 
-       if(cvar("cl_readpicture_force"))
+       if(autocvar_cl_readpicture_force)
                return false;
 
        file = strcat(name, ".tga");
index e9a02631f2e572c43c954b3a7c202201e1d0b316..b33b81a018ca982638304afd5edcc3e5adf753d3 100644 (file)
@@ -296,7 +296,7 @@ void Net_ReadNexgunBeamParticle()
        //draw either the old v2.3 beam or the new beam
        charge = sqrt(charge); // divide evenly among trail spacing and alpha
        particles_alphamin = particles_alphamax = charge;
-       if (cvar("cl_particles_oldnexbeam") && (getstati(STAT_ALLOW_OLDNEXBEAM) || isdemo()))
+       if (autocvar_cl_particles_oldnexbeam && (getstati(STAT_ALLOW_OLDNEXBEAM) || isdemo()))
                WarpZone_TrailParticles_WithMultiplier(world, particleeffectnum("TE_TEI_G3"), shotorg, endpos, charge, 1);
        else
                WarpZone_TrailParticles_WithMultiplier(world, particleeffectnum("nex_beam"), shotorg, endpos, charge, 1);
index 0476428d7b836e9978cc10913ec8c7a546ee314c..502c4481bcb2183da2863b480fdb2b8c050b922a 100644 (file)
@@ -266,7 +266,7 @@ void Cmd_HUD_SetFields(float argc)
 
        // TODO: re enable with gametype dependant cvars?
        if(argc < 2) // no arguments provided
-               argc = tokenizebyseparator(strcat("x ", cvar_string("scoreboard_columns")), " ");
+               argc = tokenizebyseparator(strcat("x ", autocvar_scoreboard_columns), " ");
 
        if(argc < 2)
                argc = tokenizebyseparator(strcat("x ", HUD_DefaultColumnLayout()), " ");
@@ -624,9 +624,9 @@ void HUD_PrintScoreboardItem(vector pos, entity pl, float is_self, float pl_numb
        is_spec = (GetPlayerColor(pl.sv_entnum) == COLOR_SPECTATOR);
 
        if((rgb == '1 1 1') && (!is_spec)) {
-               rgb_x = cvar("scoreboard_color_bg_r") + 0.5;
-               rgb_y = cvar("scoreboard_color_bg_g") + 0.5;
-               rgb_z = cvar("scoreboard_color_bg_b") + 0.5; }
+               rgb_x = autocvar_scoreboard_color_bg_r + 0.5;
+               rgb_y = autocvar_scoreboard_color_bg_g + 0.5;
+               rgb_z = autocvar_scoreboard_color_bg_b + 0.5; }
 
        // Layout:
        tmp_x = sbwidth;
@@ -883,7 +883,7 @@ float HUD_WouldDrawScoreboard() {
                return 1;
        else if (intermission == 1)
                return 1;
-       else if (getstati(STAT_HEALTH) <= 0 && cvar("cl_deathscoreboard"))
+       else if (getstati(STAT_HEALTH) <= 0 && autocvar_cl_deathscoreboard)
                return 1;
        else if (scoreboard_showscores_force)
                return 1;
@@ -897,7 +897,7 @@ vector HUD_DrawScoreboardAccuracyStats(vector pos, vector rgb, vector bg_size)
        float i;
        float weapon_cnt = WEP_COUNT - 3; // either minstanex/nex are hidden, no port-o-launch, no tuba
        float rows;
-       if(cvar("scoreboard_accuracy_doublerows"))
+       if(autocvar_scoreboard_accuracy_doublerows)
                rows = 2;
        else
                rows = 1;
@@ -1028,9 +1028,9 @@ vector HUD_DrawScoreboardRankings(vector pos, entity pl,  vector rgb, vector bg_
        float is_spec;
        is_spec = (GetPlayerColor(pl.sv_entnum) == COLOR_SPECTATOR);
        vector hl_rgb;
-       hl_rgb_x = cvar("scoreboard_color_bg_r") + 0.5;
-       hl_rgb_y = cvar("scoreboard_color_bg_g") + 0.5;
-       hl_rgb_z = cvar("scoreboard_color_bg_b") + 0.5;
+       hl_rgb_x = autocvar_scoreboard_color_bg_r + 0.5;
+       hl_rgb_y = autocvar_scoreboard_color_bg_g + 0.5;
+       hl_rgb_z = autocvar_scoreboard_color_bg_b + 0.5;
 
        pos_y += hud_fontsize_y;
        drawstring(pos, strcat("Rankings"), hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
@@ -1080,14 +1080,14 @@ void HUD_DrawScoreboard()
        }
 
        if(hud_woulddrawscoreboard) {
-               float scoreboard_fadeinspeed = cvar_or("scoreboard_fadeinspeed", 10);
+               float scoreboard_fadeinspeed = autocvar_scoreboard_fadeinspeed;
                if (scoreboard_fadeinspeed)
                        scoreboard_fade_alpha = bound (0, (time - hud_woulddrawscoreboard_change) * scoreboard_fadeinspeed, 1);
                else
                        scoreboard_fade_alpha = 1;
        }
        else {
-               float scoreboard_fadeoutspeed = cvar_or("scoreboard_fadeoutspeed", 5);
+               float scoreboard_fadeoutspeed = autocvar_scoreboard_fadeoutspeed;
                if (scoreboard_fadeoutspeed)
                        scoreboard_fade_alpha = bound (0, (1/scoreboard_fadeoutspeed - (time - hud_woulddrawscoreboard_change)) * scoreboard_fadeoutspeed, 1);
                else
@@ -1099,21 +1099,21 @@ void HUD_DrawScoreboard()
 
        HUD_UpdatePlayerTeams();
 
-       scoreboard_alpha_bg = cvar("scoreboard_alpha_bg") * scoreboard_fade_alpha * (1 - autocvar__menu_alpha);
-       scoreboard_alpha_fg = cvar_or("scoreboard_alpha_fg", 1.0) * scoreboard_fade_alpha * (1 - autocvar__menu_alpha);
-       scoreboard_highlight = cvar("scoreboard_highlight");
-       scoreboard_highlight_alpha = cvar_or("scoreboard_highlight_alpha", 0.10) * scoreboard_alpha_fg;
-       scoreboard_highlight_alpha_self = cvar_or("scoreboard_highlight_alpha_self", 0.25) * scoreboard_alpha_fg;
-       scoreboard_alpha_name = cvar_or("scoreboard_alpha_name", 0.9) * scoreboard_alpha_fg;
-       scoreboard_alpha_name_self = cvar_or("scoreboard_alpha_name_self", 1) * scoreboard_alpha_fg;
+       scoreboard_alpha_bg = autocvar_scoreboard_alpha_bg * scoreboard_fade_alpha * (1 - autocvar__menu_alpha);
+       scoreboard_alpha_fg = autocvar_scoreboard_alpha_fg * scoreboard_fade_alpha * (1 - autocvar__menu_alpha);
+       scoreboard_highlight = autocvar_scoreboard_highlight;
+       scoreboard_highlight_alpha = autocvar_scoreboard_highlight_alpha * scoreboard_alpha_fg;
+       scoreboard_highlight_alpha_self = autocvar_scoreboard_highlight_alpha_self * scoreboard_alpha_fg;
+       scoreboard_alpha_name = autocvar_scoreboard_alpha_name * scoreboard_alpha_fg;
+       scoreboard_alpha_name_self = autocvar_scoreboard_alpha_name_self * scoreboard_alpha_fg;
 
        vector rgb, pos, tmp;
        entity pl, tm;
 
-       xmin = cvar("scoreboard_offset_left") * vid_conwidth;
-       ymin = cvar("con_notify") * cvar("con_notifysize");
+       xmin = autocvar_scoreboard_offset_left * vid_conwidth;
+       ymin = autocvar_con_notify * autocvar_con_notifysize;
 
-       xmax = (1 - cvar("scoreboard_offset_right")) * vid_conwidth;
+       xmax = (1 - autocvar_scoreboard_offset_right) * vid_conwidth;
        ymax = vid_conheight - ymin;
 
        sbwidth = xmax - xmin;
@@ -1135,7 +1135,7 @@ void HUD_DrawScoreboard()
        drawfont = hud_font;
 
        // Draw the scoreboard
-       vector bg_size = drawgetimagesize("gfx/scoreboard/scoreboard_bg") * cvar("scoreboard_bg_scale");
+       vector bg_size = drawgetimagesize("gfx/scoreboard/scoreboard_bg") * autocvar_scoreboard_bg_scale;
 
        if(teamplay)
        {
@@ -1155,9 +1155,9 @@ void HUD_DrawScoreboard()
        }
        else
        {
-               rgb_x = cvar("scoreboard_color_bg_r");
-               rgb_y = cvar("scoreboard_color_bg_g");
-               rgb_z = cvar("scoreboard_color_bg_b");
+               rgb_x = autocvar_scoreboard_color_bg_r;
+               rgb_y = autocvar_scoreboard_color_bg_g;
+               rgb_z = autocvar_scoreboard_color_bg_b;
 
                for(tm = teams.sort_next; tm; tm = tm.sort_next)
                {
@@ -1179,7 +1179,7 @@ void HUD_DrawScoreboard()
                }
                pos = HUD_DrawScoreboardRankings(pos, pl, rgb, bg_size);
        }
-       else if(cvar("scoreboard_accuracy") && spectatee_status != -1 && !warmup_stage) {
+       else if(autocvar_scoreboard_accuracy && spectatee_status != -1 && !warmup_stage) {
                if(teamplay)
                        pos = HUD_DrawScoreboardAccuracyStats(pos, GetTeamRGB(myteam), bg_size);
                else
index b1957038eb4eb9b7c1a97574713ceed3e42bf2e4..5703c146d21703d650638a7d42277c7a9f3fdfc6 100644 (file)
@@ -39,7 +39,7 @@ void TargetMusic_Advance()
                        else
                                e.state = 0;
                }
-               vol = e.state * e.volume * cvar("bgmvolume");
+               vol = e.state * e.volume * autocvar_bgmvolume;
                if(vol != vol0)
                {
                        if(vol0 < 0)
index a486af68edbbe1c16bf7962b02ed14b91f35dc3f..cccce7680b4c352eb5af05e821ac62f04cf31fd8 100644 (file)
@@ -176,11 +176,11 @@ float hud_panel_radar_zoommode;
 
 void teamradar_loadcvars()
 {
-       v_flipped = cvar("v_flipped");
-       hud_panel_radar_scale = cvar("hud_panel_radar_scale");
-       hud_panel_radar_foreground_alpha = cvar("hud_panel_radar_foreground_alpha") * panel_fg_alpha;
-       hud_panel_radar_rotation = cvar("hud_panel_radar_rotation");
-       hud_panel_radar_zoommode = cvar("hud_panel_radar_zoommode");
+       v_flipped = autocvar_v_flipped;
+       hud_panel_radar_scale = autocvar_hud_panel_radar_scale;
+       hud_panel_radar_foreground_alpha = autocvar_hud_panel_radar_foreground_alpha * panel_fg_alpha;
+       hud_panel_radar_rotation = autocvar_hud_panel_radar_rotation;
+       hud_panel_radar_zoommode = autocvar_hud_panel_radar_zoommode;
 
        // others default to 0
        // match this to defaultXonotic.cfg!
index cf33b0183136745cc332ce033c22b93a46235c0a..5f1228557f37f2974a8e3efe4434b3241555acd1 100644 (file)
@@ -5,7 +5,7 @@
 void Ent_TubaNote_Think()
 {
        float f;
-       f = cvar("g_balance_tuba_fadetime");
+       f = autocvar_g_balance_tuba_fadetime;
        if(f > 0)
                self.cnt -= frametime * self.count / f;
        else
@@ -17,14 +17,14 @@ void Ent_TubaNote_Think()
                remove(self);
        }
        else
-               sound(self, CHAN_PROJECTILE, "", self.cnt, self.attenuate * cvar("g_balance_tuba_attenuation"));
+               sound(self, CHAN_PROJECTILE, "", self.cnt, self.attenuate * autocvar_g_balance_tuba_attenuation);
 }
 
 void Ent_TubaNote_UpdateSound()
 {
-       self.enemy.cnt = bound(0, VOL_BASE * cvar("g_balance_tuba_volume"), 1);
+       self.enemy.cnt = bound(0, VOL_BASE * autocvar_g_balance_tuba_volume, 1);
        self.enemy.count = self.enemy.cnt;
-       sound(self.enemy, CHAN_PROJECTILE, TUBA_STARTNOTE(self.cnt), self.enemy.cnt, self.enemy.attenuate * cvar("g_balance_tuba_attenuation"));
+       sound(self.enemy, CHAN_PROJECTILE, TUBA_STARTNOTE(self.cnt), self.enemy.cnt, self.enemy.attenuate * autocvar_g_balance_tuba_attenuation);
 }
 
 void Ent_TubaNote_StopSound()
index f53c60f0c3e1a89fdd1b000956f4e53eaa2ef8ee..0a0bfa9ec143208ed3f2f286f6cf776f181fbb12 100644 (file)
@@ -17,7 +17,7 @@ void Ent_Wall_Draw()
 
        if(self.lodmodelindex1)
        {
-               d = cvar("loddebug");
+               d = autocvar_loddebug;
                if(d > 0)
                {
                        if(d == 1)
index 816a2e4851eb8827eee5505e67e91f99b1e65844..8584d24f2b26a52fad6a308b753bfdf3dcab4463 100644 (file)
@@ -119,11 +119,11 @@ void Draw_WaypointSprite()
        if(self.hideflags & 2)
                return; // radar only
 
-       if(cvar("cl_hidewaypoints") >= 2)
+       if(autocvar_cl_hidewaypoints >= 2)
                return;
 
        if(self.hideflags & 1)
-               if(cvar("cl_hidewaypoints"))
+               if(autocvar_cl_hidewaypoints)
                        return; // fixed waypoint
 
        InterpolateOrigin_Do();
@@ -198,7 +198,7 @@ void Draw_WaypointSprite()
                d = o - '0.5 0 0' * vid_conwidth - '0 0.5 0' * vid_conheight;
 
                /*
-               if(cvar("v_flipped"))
+               if(autocvar_v_flipped)
                        d_x = -d_x;
                */
 
@@ -410,22 +410,22 @@ void Ent_WaypointSprite()
 void WaypointSprite_Load()
 {
        waypointsprite_fadedistance = vlen(mi_max - mi_min);
-       waypointsprite_normdistance = cvar("g_waypointsprite_normdistance");
-       waypointsprite_minscale = cvar("g_waypointsprite_minscale");
-       waypointsprite_minalpha = cvar("g_waypointsprite_minalpha");
-       waypointsprite_distancealphaexponent = cvar("g_waypointsprite_distancealphaexponent");
-       waypointsprite_timealphaexponent = cvar("g_waypointsprite_timealphaexponent");
-       waypointsprite_scale = cvar_or("g_waypointsprite_scale", 1);
-       waypointsprite_edgefadealpha = cvar_or("g_waypointsprite_edgefadealpha", 1);
-       waypointsprite_edgefadescale = cvar_or("g_waypointsprite_edgefadescale", 1);
-       waypointsprite_edgefadedistance = cvar("g_waypointsprite_edgefadedistance");
-       waypointsprite_crosshairfadealpha = cvar_or("g_waypointsprite_crosshairfadealpha", 1);
-       waypointsprite_crosshairfadescale = cvar_or("g_waypointsprite_crosshairfadescale", 1);
-       waypointsprite_crosshairfadedistance = cvar("g_waypointsprite_crosshairfadedistance");
-       waypointsprite_distancefadealpha = cvar_or("g_waypointsprite_distancefadealpha", 1);
-       waypointsprite_distancefadescale = cvar_or("g_waypointsprite_distancefadescale", 1);
-       waypointsprite_distancefadedistance = vlen(mi_max - mi_min) * cvar_or("g_waypointsprite_distancefadedistancemultiplier", 1);
-       waypointsprite_alpha = cvar_or("g_waypointsprite_alpha", 1) * (1 - autocvar__menu_alpha);
+       waypointsprite_normdistance = autocvar_g_waypointsprite_normdistance;
+       waypointsprite_minscale = autocvar_g_waypointsprite_minscale;
+       waypointsprite_minalpha = autocvar_g_waypointsprite_minalpha;
+       waypointsprite_distancealphaexponent = autocvar_g_waypointsprite_distancealphaexponent;
+       waypointsprite_timealphaexponent = autocvar_g_waypointsprite_timealphaexponent;
+       waypointsprite_scale = autocvar_g_waypointsprite_scale;
+       waypointsprite_edgefadealpha = autocvar_g_waypointsprite_edgefadealpha;
+       waypointsprite_edgefadescale = autocvar_g_waypointsprite_edgefadescale;
+       waypointsprite_edgefadedistance = autocvar_g_waypointsprite_edgefadedistance;
+       waypointsprite_crosshairfadealpha = autocvar_g_waypointsprite_crosshairfadealpha;
+       waypointsprite_crosshairfadescale = autocvar_g_waypointsprite_crosshairfadescale;
+       waypointsprite_crosshairfadedistance = autocvar_g_waypointsprite_crosshairfadedistance;
+       waypointsprite_distancefadealpha = autocvar_g_waypointsprite_distancefadealpha;
+       waypointsprite_distancefadescale = autocvar_g_waypointsprite_distancefadescale;
+       waypointsprite_distancefadedistance = vlen(mi_max - mi_min) * autocvar_g_waypointsprite_distancefadedistancemultiplier;
+       waypointsprite_alpha = autocvar_g_waypointsprite_alpha * (1 - autocvar__menu_alpha);
 
        if(!waypointsprite_initialized)
        {
index 5e7eb707565c6ed0d54eaf9bee4442afb74632b6..1da6ad3ec6732043e3ad6abcd755b5d2993990e5 100644 (file)
@@ -153,7 +153,7 @@ void anticheat_prethink()
 
 void anticheat_report()
 {
-       if(!cvar("sv_eventlog"))
+       if(!autocvar_sv_eventlog)
                return;
        GameLogEcho(strcat(":anticheat:speedhack:", ftos(self.playerid), ":", ftos(MEAN_EVALUATE(anticheat_speedhack))));
        GameLogEcho(strcat(":anticheat:div0_strafebot_old:", ftos(self.playerid), ":", ftos(MEAN_EVALUATE(anticheat_div0_strafebot_old))));
index fbabbcf74ac6c4e5c0bfff4ae32ab41ec2fd734e..5110d373b8a682e657e1a5f10201c2c91303dbba 100644 (file)
@@ -41,15 +41,15 @@ void reset_map(float dorespawn)
        entity oldself;
        oldself = self;
 
-       if(g_arena && cvar("g_arena_warmup"))
-               warmup = time + cvar("g_arena_warmup");
+       if(g_arena && autocvar_g_arena_warmup)
+               warmup = time + autocvar_g_arena_warmup;
        else if(g_ca) {
-               warmup = time + cvar("g_ca_warmup");
+               warmup = time + autocvar_g_ca_warmup;
                allowed_to_spawn = 1;
        }
        else if(g_freezetag)
        {
-               warmup = time + cvar("g_freezetag_warmup");
+               warmup = time + autocvar_g_freezetag_warmup;
        }
 
        lms_lowest_lives = 999;
@@ -137,7 +137,7 @@ void reset_map(float dorespawn)
        }
 
        if(g_keyhunt)
-               kh_Controller_SetThink(cvar("g_balance_keyhunt_delay_round")+(game_starttime - time), "", kh_StartRound);
+               kh_Controller_SetThink(autocvar_g_balance_keyhunt_delay_round+(game_starttime - time), "", kh_StartRound);
 
        if(g_arena)
        if(champion && champion.classname == "player" && player_count > 1)
@@ -386,7 +386,7 @@ void Spawnqueue_Check()
                return;
 
        if(g_ca) {
-               required_ca_players = max(2, fabs(cvar("bot_vs_human") + 1));
+               required_ca_players = max(2, fabs(autocvar_bot_vs_human + 1));
 
                if(ca_players < required_ca_players && (redspawned && bluespawned)) {
                        reset_map(TRUE);
@@ -404,7 +404,7 @@ void Spawnqueue_Check()
                                        strunzone(champion_name);
                                champion_name = strzone(champion.netname);
                        }
-                       else if((!redspawned && !bluespawned) || time - warmup > cvar("g_ca_round_timelimit")) {
+                       else if((!redspawned && !bluespawned) || time - warmup > autocvar_g_ca_round_timelimit) {
                                FOR_EACH_CLIENT(self) centerprint(self, strcat("^7Round tied.", "^7\n"));
                                next_round = time + 5;
                        }
index 53b6f133fd7bd40cb64f8fa3359877e6a1f186c8..a9c3525f8b4604f8c6844733d9e9978dd260cd24 100644 (file)
-float autocvar_sv_cheats;
+float autocvar__campaign_index;
+string autocvar__campaign_name;
+float autocvar__sv_init;
+float autocvar_bot_ai_aimskill_blendrate;
+float autocvar_bot_ai_aimskill_firetolerance_distdegrees;
+float autocvar_bot_ai_aimskill_firetolerance_maxdegrees;
+float autocvar_bot_ai_aimskill_firetolerance_mindegrees;
+float autocvar_bot_ai_aimskill_fixedrate;
+float autocvar_bot_ai_aimskill_mouse;
+float autocvar_bot_ai_aimskill_offset;
+float autocvar_bot_ai_aimskill_order_filter_1st;
+float autocvar_bot_ai_aimskill_order_filter_2nd;
+float autocvar_bot_ai_aimskill_order_filter_3th;
+float autocvar_bot_ai_aimskill_order_filter_4th;
+float autocvar_bot_ai_aimskill_order_filter_5th;
+float autocvar_bot_ai_aimskill_order_mix_1st;
+float autocvar_bot_ai_aimskill_order_mix_2nd;
+float autocvar_bot_ai_aimskill_order_mix_3th;
+float autocvar_bot_ai_aimskill_order_mix_4th;
+float autocvar_bot_ai_aimskill_order_mix_5th;
+float autocvar_bot_ai_aimskill_think;
+float autocvar_bot_ai_bunnyhop_firstjumpdelay;
+float autocvar_bot_ai_bunnyhop_skilloffset;
+float autocvar_bot_ai_bunnyhop_startdistance;
+float autocvar_bot_ai_bunnyhop_stopdistance;
+float autocvar_bot_ai_chooseweaponinterval;
+string autocvar_bot_ai_custom_weapon_priority_close;
+string autocvar_bot_ai_custom_weapon_priority_distances;
+string autocvar_bot_ai_custom_weapon_priority_far;
+string autocvar_bot_ai_custom_weapon_priority_mid;
+float autocvar_bot_ai_dangerdetectioninterval;
+float autocvar_bot_ai_dangerdetectionupdates;
+float autocvar_bot_ai_enemydetectioninterval;
+float autocvar_bot_ai_enemydetectionradius;
+float autocvar_bot_ai_friends_aware_pickup_radius;
+float autocvar_bot_ai_ignoregoal_timeout;
+float autocvar_bot_ai_keyboard_distance;
+float autocvar_bot_ai_keyboard_treshold;
+float autocvar_bot_ai_navigation_jetpack;
+float autocvar_bot_ai_navigation_jetpack_mindistance;
+float autocvar_bot_ai_strategyinterval;
+float autocvar_bot_ai_thinkinterval;
+float autocvar_bot_ai_weapon_combo;
+float autocvar_bot_ai_weapon_combo_threshold;
+string autocvar_bot_config_file;
+float autocvar_bot_god;
+float autocvar_bot_ignore_bots;
+float autocvar_bot_join_empty;
+float autocvar_bot_navigation_ignoreplayers;
+float autocvar_bot_nofire;
+#define autocvar_bot_number cvar("bot_number")
+#define autocvar_bot_prefix cvar_string("bot_prefix")
+float autocvar_bot_sound_monopoly;
+#define autocvar_bot_suffix cvar_string("bot_suffix")
+float autocvar_bot_usemodelnames;
+float autocvar_bot_vs_human;
+float autocvar_captureleadlimit_override;
+#define autocvar_capturelimit_override cvar("capturelimit_override")
+float autocvar_deathmatch_force_teamplay;
+#define autocvar_developer cvar("developer")
+float autocvar_developer_fteqccbugs;
+float autocvar_ekg;
+#define autocvar_fraglimit cvar("fraglimit")
+#define autocvar_fraglimit_override cvar("fraglimit_override")
+float autocvar_g_allow_oldnexbeam;
+float autocvar_g_antilag;
+float autocvar_g_antilag_bullets;
+float autocvar_g_antilag_nudge;
+float autocvar_g_arena_maxspawned;
+float autocvar_g_arena_point_leadlimit;
+float autocvar_g_arena_point_limit;
+float autocvar_g_arena_powerups;
+float autocvar_g_arena_roundbased;
+float autocvar_g_arena_warmup;
+float autocvar_g_assault;
+float autocvar_g_balance_armor_blockpercent;
+float autocvar_g_balance_armor_limit;
+float autocvar_g_balance_armor_regen;
+float autocvar_g_balance_armor_regenlinear;
+float autocvar_g_balance_armor_regenstable;
+float autocvar_g_balance_armor_rot;
+float autocvar_g_balance_armor_rotlinear;
+float autocvar_g_balance_armor_rotstable;
+float autocvar_g_balance_armor_start;
+float autocvar_g_balance_campingrifle_auto_reload_on_switch;
+float autocvar_g_balance_campingrifle_bursttime;
+float autocvar_g_balance_campingrifle_magazinecapacity;
+float autocvar_g_balance_campingrifle_primary_ammo;
+float autocvar_g_balance_campingrifle_primary_animtime;
+float autocvar_g_balance_campingrifle_primary_bulletconstant;
+float autocvar_g_balance_campingrifle_primary_bullethail;
+float autocvar_g_balance_campingrifle_primary_burstcost;
+float autocvar_g_balance_campingrifle_primary_damage;
+float autocvar_g_balance_campingrifle_primary_force;
+float autocvar_g_balance_campingrifle_primary_headshotaddeddamage;
+float autocvar_g_balance_campingrifle_primary_lifetime;
+float autocvar_g_balance_campingrifle_primary_refire;
+float autocvar_g_balance_campingrifle_primary_speed;
+float autocvar_g_balance_campingrifle_primary_spread;
+float autocvar_g_balance_campingrifle_primary_tracer;
+float autocvar_g_balance_campingrifle_reloadtime;
+float autocvar_g_balance_campingrifle_secondary;
+float autocvar_g_balance_campingrifle_secondary_ammo;
+float autocvar_g_balance_campingrifle_secondary_animtime;
+float autocvar_g_balance_campingrifle_secondary_bulletconstant;
+float autocvar_g_balance_campingrifle_secondary_bullethail;
+float autocvar_g_balance_campingrifle_secondary_burstcost;
+float autocvar_g_balance_campingrifle_secondary_damage;
+float autocvar_g_balance_campingrifle_secondary_force;
+float autocvar_g_balance_campingrifle_secondary_headshotaddeddamage;
+float autocvar_g_balance_campingrifle_secondary_lifetime;
+float autocvar_g_balance_campingrifle_secondary_refire;
+float autocvar_g_balance_campingrifle_secondary_speed;
+float autocvar_g_balance_campingrifle_secondary_spread;
+float autocvar_g_balance_campingrifle_secondary_tracer;
+float autocvar_g_balance_cloaked_alpha;
+float autocvar_g_balance_crylink_primary_ammo;
+float autocvar_g_balance_crylink_primary_animtime;
+float autocvar_g_balance_crylink_primary_bouncedamagefactor;
+float autocvar_g_balance_crylink_primary_bounces;
+float autocvar_g_balance_crylink_primary_damage;
+float autocvar_g_balance_crylink_primary_edgedamage;
+float autocvar_g_balance_crylink_primary_force;
+float autocvar_g_balance_crylink_primary_joinexplode;
+float autocvar_g_balance_crylink_primary_joinexplode_damage;
+float autocvar_g_balance_crylink_primary_joinexplode_edgedamage;
+float autocvar_g_balance_crylink_primary_joinexplode_force;
+float autocvar_g_balance_crylink_primary_joinexplode_radius;
+float autocvar_g_balance_crylink_primary_joinspread;
+float autocvar_g_balance_crylink_primary_jointime;
+float autocvar_g_balance_crylink_primary_linkexplode;
+float autocvar_g_balance_crylink_primary_middle_fadetime;
+float autocvar_g_balance_crylink_primary_middle_lifetime;
+float autocvar_g_balance_crylink_primary_other_fadetime;
+float autocvar_g_balance_crylink_primary_other_lifetime;
+float autocvar_g_balance_crylink_primary_radius;
+float autocvar_g_balance_crylink_primary_refire;
+float autocvar_g_balance_crylink_primary_shots;
+float autocvar_g_balance_crylink_primary_speed;
+float autocvar_g_balance_crylink_primary_spread;
+float autocvar_g_balance_crylink_secondary;
+float autocvar_g_balance_crylink_secondary_ammo;
+float autocvar_g_balance_crylink_secondary_animtime;
+float autocvar_g_balance_crylink_secondary_bouncedamagefactor;
+float autocvar_g_balance_crylink_secondary_bounces;
+float autocvar_g_balance_crylink_secondary_damage;
+float autocvar_g_balance_crylink_secondary_edgedamage;
+float autocvar_g_balance_crylink_secondary_force;
+float autocvar_g_balance_crylink_secondary_joinexplode;
+float autocvar_g_balance_crylink_secondary_joinexplode_damage;
+float autocvar_g_balance_crylink_secondary_joinexplode_edgedamage;
+float autocvar_g_balance_crylink_secondary_joinexplode_force;
+float autocvar_g_balance_crylink_secondary_joinexplode_radius;
+float autocvar_g_balance_crylink_secondary_joinspread;
+float autocvar_g_balance_crylink_secondary_jointime;
+float autocvar_g_balance_crylink_secondary_line_fadetime;
+float autocvar_g_balance_crylink_secondary_line_lifetime;
+float autocvar_g_balance_crylink_secondary_linkexplode;
+float autocvar_g_balance_crylink_secondary_middle_fadetime;
+float autocvar_g_balance_crylink_secondary_middle_lifetime;
+float autocvar_g_balance_crylink_secondary_radius;
+float autocvar_g_balance_crylink_secondary_refire;
+float autocvar_g_balance_crylink_secondary_shots;
+float autocvar_g_balance_crylink_secondary_speed;
+float autocvar_g_balance_crylink_secondary_spread;
+float autocvar_g_balance_ctf_damageforcescale;
+float autocvar_g_balance_ctf_delay_collect;
+float autocvar_g_balance_curse_empathy_minhealth;
+float autocvar_g_balance_curse_empathy_takedamage;
+float autocvar_g_balance_curse_slow_atkrate;
+float autocvar_g_balance_curse_slow_highspeed;
+float autocvar_g_balance_curse_venom_hpmod;
+float autocvar_g_balance_curse_venom_limitmod;
+float autocvar_g_balance_curse_venom_rotrate;
+float autocvar_g_balance_curse_vulner_takedamage;
+float autocvar_g_balance_curse_weak_damage;
+float autocvar_g_balance_curse_weak_force;
+float autocvar_g_balance_electro_combo_comboradius;
+float autocvar_g_balance_electro_combo_damage;
+float autocvar_g_balance_electro_combo_edgedamage;
+float autocvar_g_balance_electro_combo_force;
+float autocvar_g_balance_electro_combo_radius;
+float autocvar_g_balance_electro_combo_speed;
+float autocvar_g_balance_electro_lightning;
+float autocvar_g_balance_electro_primary_ammo;
+float autocvar_g_balance_electro_primary_animtime;
+float autocvar_g_balance_electro_primary_comboradius;
+float autocvar_g_balance_electro_primary_damage;
+float autocvar_g_balance_electro_primary_edgedamage;
+float autocvar_g_balance_electro_primary_falloff_halflifedist;
+float autocvar_g_balance_electro_primary_falloff_maxdist;
+float autocvar_g_balance_electro_primary_falloff_mindist;
+float autocvar_g_balance_electro_primary_force;
+float autocvar_g_balance_electro_primary_force_up;
+float autocvar_g_balance_electro_primary_lifetime;
+float autocvar_g_balance_electro_primary_radius;
+float autocvar_g_balance_electro_primary_range;
+float autocvar_g_balance_electro_primary_refire;
+float autocvar_g_balance_electro_primary_speed;
+float autocvar_g_balance_electro_secondary_ammo;
+float autocvar_g_balance_electro_secondary_animtime;
+float autocvar_g_balance_electro_secondary_bouncefactor;
+float autocvar_g_balance_electro_secondary_bouncestop;
+float autocvar_g_balance_electro_secondary_count;
+float autocvar_g_balance_electro_secondary_damage;
+float autocvar_g_balance_electro_secondary_damageforcescale;
+float autocvar_g_balance_electro_secondary_edgedamage;
+float autocvar_g_balance_electro_secondary_force;
+float autocvar_g_balance_electro_secondary_health;
+float autocvar_g_balance_electro_secondary_lifetime;
+float autocvar_g_balance_electro_secondary_radius;
+float autocvar_g_balance_electro_secondary_refire;
+float autocvar_g_balance_electro_secondary_refire2;
+float autocvar_g_balance_electro_secondary_speed;
+float autocvar_g_balance_falldamage_deadminspeed;
+float autocvar_g_balance_falldamage_factor;
+float autocvar_g_balance_falldamage_maxdamage;
+float autocvar_g_balance_falldamage_minspeed;
+float autocvar_g_balance_fireball_primary_ammo;
+float autocvar_g_balance_fireball_primary_animtime;
+float autocvar_g_balance_fireball_primary_bfgdamage;
+float autocvar_g_balance_fireball_primary_bfgforce;
+float autocvar_g_balance_fireball_primary_bfgradius;
+float autocvar_g_balance_fireball_primary_damage;
+float autocvar_g_balance_fireball_primary_damageforcescale;
+float autocvar_g_balance_fireball_primary_edgedamage;
+float autocvar_g_balance_fireball_primary_force;
+float autocvar_g_balance_fireball_primary_health;
+float autocvar_g_balance_fireball_primary_laserburntime;
+float autocvar_g_balance_fireball_primary_laserdamage;
+float autocvar_g_balance_fireball_primary_laseredgedamage;
+float autocvar_g_balance_fireball_primary_laserradius;
+float autocvar_g_balance_fireball_primary_lifetime;
+float autocvar_g_balance_fireball_primary_radius;
+float autocvar_g_balance_fireball_primary_refire;
+float autocvar_g_balance_fireball_primary_refire2;
+float autocvar_g_balance_fireball_primary_speed;
+float autocvar_g_balance_fireball_secondary_ammo;
+float autocvar_g_balance_fireball_secondary_animtime;
+float autocvar_g_balance_fireball_secondary_damage;
+float autocvar_g_balance_fireball_secondary_damageforcescale;
+float autocvar_g_balance_fireball_secondary_damagetime;
+float autocvar_g_balance_fireball_secondary_laserburntime;
+float autocvar_g_balance_fireball_secondary_laserdamage;
+float autocvar_g_balance_fireball_secondary_laseredgedamage;
+float autocvar_g_balance_fireball_secondary_laserradius;
+float autocvar_g_balance_fireball_secondary_lifetime;
+float autocvar_g_balance_fireball_secondary_refire;
+float autocvar_g_balance_fireball_secondary_speed;
+float autocvar_g_balance_fireball_secondary_speed_up;
+float autocvar_g_balance_firetransfer_damage;
+float autocvar_g_balance_firetransfer_time;
+float autocvar_g_balance_fuel_limit;
+float autocvar_g_balance_fuel_regen;
+float autocvar_g_balance_fuel_regenlinear;
+float autocvar_g_balance_fuel_regenstable;
+float autocvar_g_balance_fuel_rot;
+float autocvar_g_balance_fuel_rotlinear;
+float autocvar_g_balance_fuel_rotstable;
+float autocvar_g_balance_grapplehook_airfriction;
+float autocvar_g_balance_grapplehook_force_rubber;
+float autocvar_g_balance_grapplehook_force_rubber_overstretch;
+float autocvar_g_balance_grapplehook_health;
+float autocvar_g_balance_grapplehook_length_min;
+float autocvar_g_balance_grapplehook_speed_fly;
+float autocvar_g_balance_grapplehook_speed_pull;
+float autocvar_g_balance_grapplehook_stretch;
+float autocvar_g_balance_grenadelauncher_bouncefactor;
+float autocvar_g_balance_grenadelauncher_bouncestop;
+float autocvar_g_balance_grenadelauncher_primary_ammo;
+float autocvar_g_balance_grenadelauncher_primary_animtime;
+float autocvar_g_balance_grenadelauncher_primary_damage;
+float autocvar_g_balance_grenadelauncher_primary_damageforcescale;
+float autocvar_g_balance_grenadelauncher_primary_edgedamage;
+float autocvar_g_balance_grenadelauncher_primary_force;
+float autocvar_g_balance_grenadelauncher_primary_health;
+float autocvar_g_balance_grenadelauncher_primary_lifetime;
+float autocvar_g_balance_grenadelauncher_primary_lifetime2;
+float autocvar_g_balance_grenadelauncher_primary_radius;
+float autocvar_g_balance_grenadelauncher_primary_refire;
+float autocvar_g_balance_grenadelauncher_primary_remote_minbouncecnt;
+float autocvar_g_balance_grenadelauncher_primary_speed;
+float autocvar_g_balance_grenadelauncher_primary_speed_up;
+float autocvar_g_balance_grenadelauncher_primary_type;
+float autocvar_g_balance_grenadelauncher_secondary_ammo;
+float autocvar_g_balance_grenadelauncher_secondary_animtime;
+float autocvar_g_balance_grenadelauncher_secondary_damage;
+float autocvar_g_balance_grenadelauncher_secondary_damageforcescale;
+float autocvar_g_balance_grenadelauncher_secondary_edgedamage;
+float autocvar_g_balance_grenadelauncher_secondary_force;
+float autocvar_g_balance_grenadelauncher_secondary_health;
+float autocvar_g_balance_grenadelauncher_secondary_lifetime;
+float autocvar_g_balance_grenadelauncher_secondary_lifetime2;
+float autocvar_g_balance_grenadelauncher_secondary_radius;
+float autocvar_g_balance_grenadelauncher_secondary_refire;
+float autocvar_g_balance_grenadelauncher_secondary_speed;
+float autocvar_g_balance_grenadelauncher_secondary_speed_up;
+float autocvar_g_balance_grenadelauncher_secondary_type;
+float autocvar_g_balance_hagar_primary_ammo;
+float autocvar_g_balance_hagar_primary_damage;
+float autocvar_g_balance_hagar_primary_edgedamage;
+float autocvar_g_balance_hagar_primary_force;
+float autocvar_g_balance_hagar_primary_lifetime;
+float autocvar_g_balance_hagar_primary_radius;
+float autocvar_g_balance_hagar_primary_refire;
+float autocvar_g_balance_hagar_primary_speed;
+float autocvar_g_balance_hagar_secondary;
+float autocvar_g_balance_hagar_secondary_ammo;
+float autocvar_g_balance_hagar_secondary_damage;
+float autocvar_g_balance_hagar_secondary_edgedamage;
+float autocvar_g_balance_hagar_secondary_force;
+float autocvar_g_balance_hagar_secondary_lifetime_min;
+float autocvar_g_balance_hagar_secondary_lifetime_rand;
+float autocvar_g_balance_hagar_secondary_radius;
+float autocvar_g_balance_hagar_secondary_refire;
+float autocvar_g_balance_health_limit;
+float autocvar_g_balance_health_regen;
+float autocvar_g_balance_health_regenlinear;
+float autocvar_g_balance_health_regenstable;
+float autocvar_g_balance_health_rot;
+float autocvar_g_balance_health_rotlinear;
+float autocvar_g_balance_health_rotstable;
+float autocvar_g_balance_health_start;
+float autocvar_g_balance_hlac_primary_ammo;
+float autocvar_g_balance_hlac_primary_animtime;
+float autocvar_g_balance_hlac_primary_damage;
+float autocvar_g_balance_hlac_primary_edgedamage;
+float autocvar_g_balance_hlac_primary_force;
+float autocvar_g_balance_hlac_primary_lifetime;
+float autocvar_g_balance_hlac_primary_radius;
+float autocvar_g_balance_hlac_primary_refire;
+float autocvar_g_balance_hlac_primary_speed;
+float autocvar_g_balance_hlac_primary_spread_add;
+float autocvar_g_balance_hlac_primary_spread_crouchmod;
+float autocvar_g_balance_hlac_primary_spread_max;
+float autocvar_g_balance_hlac_primary_spread_min;
+float autocvar_g_balance_hlac_secondary;
+float autocvar_g_balance_hlac_secondary_ammo;
+float autocvar_g_balance_hlac_secondary_animtime;
+float autocvar_g_balance_hlac_secondary_damage;
+float autocvar_g_balance_hlac_secondary_edgedamage;
+float autocvar_g_balance_hlac_secondary_force;
+float autocvar_g_balance_hlac_secondary_lifetime;
+float autocvar_g_balance_hlac_secondary_radius;
+float autocvar_g_balance_hlac_secondary_refire;
+float autocvar_g_balance_hlac_secondary_shots;
+float autocvar_g_balance_hlac_secondary_speed;
+float autocvar_g_balance_hlac_secondary_spread;
+float autocvar_g_balance_hlac_secondary_spread_crouchmod;
+float autocvar_g_balance_hook_primary_animtime;
+float autocvar_g_balance_hook_primary_fuel;
+float autocvar_g_balance_hook_primary_hooked_fuel;
+float autocvar_g_balance_hook_primary_hooked_time_free;
+float autocvar_g_balance_hook_primary_hooked_time_max;
+float autocvar_g_balance_hook_primary_refire;
+float autocvar_g_balance_hook_secondary_ammo;
+float autocvar_g_balance_hook_secondary_animtime;
+float autocvar_g_balance_hook_secondary_damage;
+float autocvar_g_balance_hook_secondary_duration;
+float autocvar_g_balance_hook_secondary_edgedamage;
+float autocvar_g_balance_hook_secondary_force;
+float autocvar_g_balance_hook_secondary_gravity;
+float autocvar_g_balance_hook_secondary_lifetime;
+float autocvar_g_balance_hook_secondary_power;
+float autocvar_g_balance_hook_secondary_radius;
+float autocvar_g_balance_hook_secondary_refire;
+float autocvar_g_balance_hook_secondary_speed;
+float autocvar_g_balance_keyhunt_damageforcescale;
+float autocvar_g_balance_keyhunt_delay_collect;
+float autocvar_g_balance_keyhunt_delay_drop;
+float autocvar_g_balance_keyhunt_delay_return;
+float autocvar_g_balance_keyhunt_delay_round;
+float autocvar_g_balance_keyhunt_delay_tracking;
+float autocvar_g_balance_keyhunt_dropvelocity;
+float autocvar_g_balance_keyhunt_maxdist;
+float autocvar_g_balance_keyhunt_protecttime;
+float autocvar_g_balance_keyhunt_score_capture;
+float autocvar_g_balance_keyhunt_score_carrierfrag;
+float autocvar_g_balance_keyhunt_score_collect;
+float autocvar_g_balance_keyhunt_score_destroyed;
+float autocvar_g_balance_keyhunt_score_destroyed_ownfactor;
+float autocvar_g_balance_keyhunt_score_push;
+float autocvar_g_balance_keyhunt_throwvelocity;
+float autocvar_g_balance_kill_delay;
+float autocvar_g_balance_laser_primary_animtime;
+float autocvar_g_balance_laser_primary_damage;
+float autocvar_g_balance_laser_primary_delay;
+float autocvar_g_balance_laser_primary_edgedamage;
+float autocvar_g_balance_laser_primary_force;
+float autocvar_g_balance_laser_primary_force_velocitybias;
+float autocvar_g_balance_laser_primary_force_zscale;
+float autocvar_g_balance_laser_primary_lifetime;
+float autocvar_g_balance_laser_primary_radius;
+float autocvar_g_balance_laser_primary_refire;
+float autocvar_g_balance_laser_primary_shotangle;
+float autocvar_g_balance_laser_primary_speed;
+float autocvar_g_balance_laser_secondary;
+float autocvar_g_balance_laser_secondary_animtime;
+float autocvar_g_balance_laser_secondary_damage;
+float autocvar_g_balance_laser_secondary_edgedamage;
+float autocvar_g_balance_laser_secondary_force;
+float autocvar_g_balance_laser_secondary_force_velocitybias;
+float autocvar_g_balance_laser_secondary_force_zscale;
+float autocvar_g_balance_laser_secondary_lifetime;
+float autocvar_g_balance_laser_secondary_radius;
+float autocvar_g_balance_laser_secondary_speed;
+float autocvar_g_balance_minelayer_ammo;
+float autocvar_g_balance_minelayer_animtime;
+float autocvar_g_balance_minelayer_damage;
+float autocvar_g_balance_minelayer_damageforcescale;
+float autocvar_g_balance_minelayer_detonatedelay;
+float autocvar_g_balance_minelayer_edgedamage;
+float autocvar_g_balance_minelayer_force;
+float autocvar_g_balance_minelayer_health;
+float autocvar_g_balance_minelayer_lifetime;
+float autocvar_g_balance_minelayer_limit;
+float autocvar_g_balance_minelayer_protection;
+float autocvar_g_balance_minelayer_proximityradius;
+float autocvar_g_balance_minelayer_radius;
+float autocvar_g_balance_minelayer_refire;
+float autocvar_g_balance_minelayer_remote_damage;
+float autocvar_g_balance_minelayer_remote_edgedamage;
+float autocvar_g_balance_minelayer_remote_force;
+float autocvar_g_balance_minelayer_remote_radius;
+float autocvar_g_balance_minelayer_speed;
+float autocvar_g_balance_minelayer_time;
+float autocvar_g_balance_minstanex_ammo;
+float autocvar_g_balance_minstanex_animtime;
+float autocvar_g_balance_minstanex_refire;
+float autocvar_g_balance_nex_charge;
+float autocvar_g_balance_nex_charge_limit;
+float autocvar_g_balance_nex_charge_maxspeed;
+float autocvar_g_balance_nex_charge_mindmg;
+float autocvar_g_balance_nex_charge_minspeed;
+float autocvar_g_balance_nex_charge_rate;
+float autocvar_g_balance_nex_charge_rot_pause;
+float autocvar_g_balance_nex_charge_rot_rate;
+float autocvar_g_balance_nex_charge_shot_multiplier;
+float autocvar_g_balance_nex_charge_start;
+float autocvar_g_balance_nex_charge_velocity_rate;
+float autocvar_g_balance_nex_primary_ammo;
+float autocvar_g_balance_nex_primary_animtime;
+float autocvar_g_balance_nex_primary_damage;
+float autocvar_g_balance_nex_primary_damagefalloff_forcehalflife;
+float autocvar_g_balance_nex_primary_damagefalloff_halflife;
+float autocvar_g_balance_nex_primary_damagefalloff_maxdist;
+float autocvar_g_balance_nex_primary_damagefalloff_mindist;
+float autocvar_g_balance_nex_primary_force;
+float autocvar_g_balance_nex_primary_refire;
+float autocvar_g_balance_nex_secondary;
+float autocvar_g_balance_nex_secondary_ammo;
+float autocvar_g_balance_nex_secondary_animtime;
+float autocvar_g_balance_nex_secondary_charge;
+float autocvar_g_balance_nex_secondary_charge_rate;
+float autocvar_g_balance_nex_secondary_chargepool;
+float autocvar_g_balance_nex_secondary_chargepool_pause_health_regen;
+float autocvar_g_balance_nex_secondary_chargepool_pause_regen;
+float autocvar_g_balance_nex_secondary_chargepool_regen;
+float autocvar_g_balance_nex_secondary_damage;
+float autocvar_g_balance_nex_secondary_damagefalloff_forcehalflife;
+float autocvar_g_balance_nex_secondary_damagefalloff_halflife;
+float autocvar_g_balance_nex_secondary_damagefalloff_maxdist;
+float autocvar_g_balance_nex_secondary_damagefalloff_mindist;
+float autocvar_g_balance_nex_secondary_force;
+float autocvar_g_balance_nex_secondary_refire;
+float autocvar_g_balance_nexball_primary_animtime;
+float autocvar_g_balance_nexball_primary_refire;
+float autocvar_g_balance_nexball_primary_speed;
+float autocvar_g_balance_nexball_secondary_animtime;
+float autocvar_g_balance_nexball_secondary_force;
+float autocvar_g_balance_nexball_secondary_lifetime;
+float autocvar_g_balance_nexball_secondary_refire;
+float autocvar_g_balance_nexball_secondary_speed;
+float autocvar_g_balance_nix_ammo_cells;
+float autocvar_g_balance_nix_ammo_fuel;
+float autocvar_g_balance_nix_ammo_nails;
+float autocvar_g_balance_nix_ammo_rockets;
+float autocvar_g_balance_nix_ammo_shells;
+float autocvar_g_balance_nix_ammoincr_cells;
+float autocvar_g_balance_nix_ammoincr_fuel;
+float autocvar_g_balance_nix_ammoincr_nails;
+float autocvar_g_balance_nix_ammoincr_rockets;
+float autocvar_g_balance_nix_ammoincr_shells;
+float autocvar_g_balance_nix_incrtime;
+float autocvar_g_balance_nix_roundtime;
+float autocvar_g_balance_pause_armor_rot;
+float autocvar_g_balance_pause_armor_rot_spawn;
+float autocvar_g_balance_pause_fuel_regen;
+float autocvar_g_balance_pause_fuel_rot;
+float autocvar_g_balance_pause_fuel_rot_spawn;
+float autocvar_g_balance_pause_health_regen;
+float autocvar_g_balance_pause_health_regen_spawn;
+float autocvar_g_balance_pause_health_rot;
+float autocvar_g_balance_pause_health_rot_spawn;
+float autocvar_g_balance_portal_health;
+float autocvar_g_balance_portal_lifetime;
+float autocvar_g_balance_porto_primary_animtime;
+float autocvar_g_balance_porto_primary_lifetime;
+float autocvar_g_balance_porto_primary_refire;
+float autocvar_g_balance_porto_primary_speed;
+float autocvar_g_balance_powerup_invincible_takedamage;
+float autocvar_g_balance_powerup_invincible_time;
+float autocvar_g_balance_powerup_strength_damage;
+float autocvar_g_balance_powerup_strength_force;
+float autocvar_g_balance_powerup_strength_selfdamage;
+float autocvar_g_balance_powerup_strength_selfforce;
+float autocvar_g_balance_powerup_strength_time;
+float autocvar_g_balance_powerup_timer;
+float autocvar_g_balance_rocketlauncher_ammo;
+float autocvar_g_balance_rocketlauncher_animtime;
+float autocvar_g_balance_rocketlauncher_damage;
+float autocvar_g_balance_rocketlauncher_damageforcescale;
+float autocvar_g_balance_rocketlauncher_detonatedelay;
+float autocvar_g_balance_rocketlauncher_edgedamage;
+float autocvar_g_balance_rocketlauncher_force;
+float autocvar_g_balance_rocketlauncher_guidedelay;
+float autocvar_g_balance_rocketlauncher_guidegoal;
+float autocvar_g_balance_rocketlauncher_guiderate;
+float autocvar_g_balance_rocketlauncher_guideratedelay;
+float autocvar_g_balance_rocketlauncher_guidestop;
+float autocvar_g_balance_rocketlauncher_health;
+float autocvar_g_balance_rocketlauncher_lifetime;
+float autocvar_g_balance_rocketlauncher_radius;
+float autocvar_g_balance_rocketlauncher_refire;
+float autocvar_g_balance_rocketlauncher_remote_damage;
+float autocvar_g_balance_rocketlauncher_remote_edgedamage;
+float autocvar_g_balance_rocketlauncher_remote_force;
+float autocvar_g_balance_rocketlauncher_remote_radius;
+float autocvar_g_balance_rocketlauncher_speed;
+float autocvar_g_balance_rocketlauncher_speedaccel;
+float autocvar_g_balance_rocketlauncher_speedstart;
+float autocvar_g_balance_rune_defense_combo_takedamage;
+float autocvar_g_balance_rune_defense_takedamage;
+float autocvar_g_balance_rune_regen_combo_hpmod;
+float autocvar_g_balance_rune_regen_combo_limitmod;
+float autocvar_g_balance_rune_regen_combo_regenrate;
+float autocvar_g_balance_rune_regen_combo_rotrate;
+float autocvar_g_balance_rune_regen_hpmod;
+float autocvar_g_balance_rune_regen_limitmod;
+float autocvar_g_balance_rune_regen_regenrate;
+float autocvar_g_balance_rune_speed_atkrate;
+float autocvar_g_balance_rune_speed_combo_atkrate;
+float autocvar_g_balance_rune_speed_combo_highspeed;
+float autocvar_g_balance_rune_speed_highspeed;
+float autocvar_g_balance_rune_strength_combo_damage;
+float autocvar_g_balance_rune_strength_combo_force;
+float autocvar_g_balance_rune_strength_damage;
+float autocvar_g_balance_rune_strength_force;
+float autocvar_g_balance_rune_vampire_absorb;
+float autocvar_g_balance_rune_vampire_combo_absorb;
+float autocvar_g_balance_rune_vampire_maxhealth;
+float autocvar_g_balance_seeker_flac_ammo;
+float autocvar_g_balance_seeker_flac_animtime;
+float autocvar_g_balance_seeker_flac_damage;
+float autocvar_g_balance_seeker_flac_edgedamage;
+float autocvar_g_balance_seeker_flac_force;
+float autocvar_g_balance_seeker_flac_lifetime;
+float autocvar_g_balance_seeker_flac_lifetime_rand;
+float autocvar_g_balance_seeker_flac_radius;
+float autocvar_g_balance_seeker_flac_refire;
+float autocvar_g_balance_seeker_missile_accel;
+float autocvar_g_balance_seeker_missile_ammo;
+float autocvar_g_balance_seeker_missile_count;
+float autocvar_g_balance_seeker_missile_damage;
+float autocvar_g_balance_seeker_missile_damageforcescale;
+float autocvar_g_balance_seeker_missile_decel;
+float autocvar_g_balance_seeker_missile_delay;
+float autocvar_g_balance_seeker_missile_edgedamage;
+float autocvar_g_balance_seeker_missile_force;
+float autocvar_g_balance_seeker_missile_health;
+float autocvar_g_balance_seeker_missile_lifetime;
+float autocvar_g_balance_seeker_missile_proxy;
+float autocvar_g_balance_seeker_missile_proxy_delay;
+float autocvar_g_balance_seeker_missile_proxy_maxrange;
+float autocvar_g_balance_seeker_missile_radius;
+float autocvar_g_balance_seeker_missile_smart;
+float autocvar_g_balance_seeker_missile_smart_mindist;
+float autocvar_g_balance_seeker_missile_smart_trace_max;
+float autocvar_g_balance_seeker_missile_smart_trace_min;
+float autocvar_g_balance_seeker_missile_speed_max;
+float autocvar_g_balance_seeker_missile_turnrate;
+float autocvar_g_balance_seeker_tag_ammo;
+float autocvar_g_balance_seeker_tag_animtime;
+float autocvar_g_balance_seeker_tag_damageforcescale;
+float autocvar_g_balance_seeker_tag_health;
+float autocvar_g_balance_seeker_tag_lifetime;
+float autocvar_g_balance_seeker_tag_refire;
+float autocvar_g_balance_seeker_tag_speed;
+float autocvar_g_balance_selfdamagepercent;
+float autocvar_g_balance_shotgun_primary_ammo;
+float autocvar_g_balance_shotgun_primary_animtime;
+float autocvar_g_balance_shotgun_primary_bulletconstant;
+float autocvar_g_balance_shotgun_primary_bullets;
+float autocvar_g_balance_shotgun_primary_damage;
+float autocvar_g_balance_shotgun_primary_force;
+float autocvar_g_balance_shotgun_primary_refire;
+float autocvar_g_balance_shotgun_primary_speed;
+float autocvar_g_balance_shotgun_primary_spread;
+float autocvar_g_balance_shotgun_secondary;
+float autocvar_g_balance_shotgun_secondary_animtime;
+float autocvar_g_balance_shotgun_secondary_damage;
+float autocvar_g_balance_shotgun_secondary_force;
+float autocvar_g_balance_shotgun_secondary_melee_delay;
+float autocvar_g_balance_shotgun_secondary_melee_range;
+float autocvar_g_balance_shotgun_secondary_melee_swing;
+float autocvar_g_balance_shotgun_secondary_melee_time;
+float autocvar_g_balance_shotgun_secondary_refire;
+float autocvar_g_balance_teams;
+float autocvar_g_balance_teams_force;
+float autocvar_g_balance_teams_prevent_imbalance;
+float autocvar_g_balance_tuba_animtime;
+float autocvar_g_balance_tuba_attenuation;
+float autocvar_g_balance_tuba_damage;
+float autocvar_g_balance_tuba_edgedamage;
+float autocvar_g_balance_tuba_force;
+float autocvar_g_balance_tuba_radius;
+float autocvar_g_balance_tuba_refire;
+float autocvar_g_balance_uzi_bulletconstant;
+float autocvar_g_balance_uzi_burst;
+float autocvar_g_balance_uzi_burst_ammo;
+float autocvar_g_balance_uzi_burst_refire;
+float autocvar_g_balance_uzi_burst_refire2;
+float autocvar_g_balance_uzi_burst_spread;
+float autocvar_g_balance_uzi_first;
+float autocvar_g_balance_uzi_first_ammo;
+float autocvar_g_balance_uzi_first_damage;
+float autocvar_g_balance_uzi_first_force;
+float autocvar_g_balance_uzi_first_refire;
+float autocvar_g_balance_uzi_first_spread;
+float autocvar_g_balance_uzi_mode;
+float autocvar_g_balance_uzi_speed;
+float autocvar_g_balance_uzi_spread_add;
+float autocvar_g_balance_uzi_spread_max;
+float autocvar_g_balance_uzi_spread_min;
+float autocvar_g_balance_uzi_sustained_ammo;
+float autocvar_g_balance_uzi_sustained_damage;
+float autocvar_g_balance_uzi_sustained_force;
+float autocvar_g_balance_uzi_sustained_refire;
+float autocvar_g_balance_uzi_sustained_spread;
+float autocvar_g_balance_weaponswitchdelay;
+float autocvar_g_ballistics_density_corpse;
+float autocvar_g_ballistics_density_player;
+float autocvar_g_ballistics_materialconstant;
+float autocvar_g_ballistics_mindistance;
+float autocvar_g_ban_default_bantime;
+float autocvar_g_ban_default_masksize;
+float autocvar_g_ban_sync_interval;
+float autocvar_g_ban_sync_timeout;
+string autocvar_g_ban_sync_trusted_servers;
+float autocvar_g_ban_sync_trusted_servers_verify;
+string autocvar_g_ban_sync_uri;
+string autocvar_g_banned_list;
+float autocvar_g_banned_list_idmode;
 float autocvar_g_bastet;
-float autocvar_teamplay_mode;
+float autocvar_g_botclip_collisions;
+float autocvar_g_bugrigs;
+float autocvar_g_ca_damage2score_multiplier;
+float autocvar_g_ca_point_leadlimit;
+float autocvar_g_ca_point_limit;
+float autocvar_g_ca_round_timelimit;
+float autocvar_g_ca_warmup;
+float autocvar_g_campaign;
+float autocvar_g_campaign_forceteam;
+float autocvar_g_campaign_skill;
+float autocvar_g_casings;
+float autocvar_g_changeteam_banned;
+float autocvar_g_chat_flood_burst;
+float autocvar_g_chat_flood_burst_team;
+float autocvar_g_chat_flood_burst_tell;
+float autocvar_g_chat_flood_lmax;
+float autocvar_g_chat_flood_lmax_team;
+float autocvar_g_chat_flood_lmax_tell;
+float autocvar_g_chat_flood_notify_flooder;
+float autocvar_g_chat_flood_spl;
+float autocvar_g_chat_flood_spl_team;
+float autocvar_g_chat_flood_spl_tell;
+float autocvar_g_chat_nospectators;
+float autocvar_g_chat_teamcolors;
+float autocvar_g_ctf_allow_drop;
+float autocvar_g_ctf_captimerecord_always;
+float autocvar_g_ctf_capture_leadlimit;
+float autocvar_g_ctf_capture_limit;
+float autocvar_g_ctf_dynamiclights;
+string autocvar_g_ctf_flag_blue_model;
+float autocvar_g_ctf_flag_blue_skin;
+float autocvar_g_ctf_flag_capture_effects;
+float autocvar_g_ctf_flag_glowtrails;
+float autocvar_g_ctf_flag_pickup_effects;
+string autocvar_g_ctf_flag_red_model;
+float autocvar_g_ctf_flag_red_skin;
+float autocvar_g_ctf_flag_returntime;
+float autocvar_g_ctf_flagcarrier_selfdamage;
+float autocvar_g_ctf_flagcarrier_selfforce;
+float autocvar_g_ctf_fullbrightflags;
+float autocvar_g_ctf_ignore_frags;
+float autocvar_g_ctf_shield_force;
+float autocvar_g_ctf_shield_max_ratio;
+float autocvar_g_ctf_shield_min_negscore;
+float autocvar_g_ctf_win_mode;
+float autocvar_g_cts_finish_kill_delay;
+float autocvar_g_cts_selfdamage;
+float autocvar_g_deathglow;
+float autocvar_g_debug_bot_commands;
+float autocvar_g_domination_default_teams;
+float autocvar_g_domination_disable_frags;
+float autocvar_g_domination_point_amt;
+float autocvar_g_domination_point_fullbright;
+float autocvar_g_domination_point_leadlimit;
+#define autocvar_g_domination_point_limit cvar("g_domination_point_limit")
+float autocvar_g_domination_point_rate;
+float autocvar_g_domination_teams_override;
+float autocvar_g_forced_respawn;
+string autocvar_g_forced_team_blue;
+string autocvar_g_forced_team_otherwise;
+string autocvar_g_forced_team_pink;
+string autocvar_g_forced_team_red;
+string autocvar_g_forced_team_yellow;
+float autocvar_g_freezetag_frozen_force;
+float autocvar_g_freezetag_point_leadlimit;
+float autocvar_g_freezetag_point_limit;
+float autocvar_g_freezetag_revive_extra_size;
+float autocvar_g_freezetag_revive_time;
+float autocvar_g_freezetag_warmup;
+#define autocvar_g_friendlyfire cvar("g_friendlyfire")
+float autocvar_g_full_getstatus_responses;
+float autocvar_g_fullbrightitems;
+float autocvar_g_fullbrightplayers;
+string autocvar_g_ghost_items_color;
+#define autocvar_g_grappling_hook cvar("g_grappling_hook")
+float autocvar_g_grappling_hook_tarzan;
+float autocvar_g_hitplots;
+string autocvar_g_hitplots_individuals;
+float autocvar_g_jetpack_acceleration_side;
+float autocvar_g_jetpack_acceleration_up;
+float autocvar_g_jetpack_antigravity;
+float autocvar_g_jetpack_attenuation;
+float autocvar_g_jetpack_fuel;
+float autocvar_g_jetpack_maxspeed_side;
+float autocvar_g_jetpack_maxspeed_up;
+float autocvar_g_keepaway_ballcarrier_alpha;
+float autocvar_g_keepaway_ballcarrier_damage;
+float autocvar_g_keepaway_ballcarrier_force;
+float autocvar_g_keepaway_ballcarrier_highspeed;
+float autocvar_g_keepaway_ballcarrier_selfdamage;
+float autocvar_g_keepaway_ballcarrier_selfforce;
+float autocvar_g_keepaway_bckillscore;
+float autocvar_g_keepaway_noncarrier_damage;
+float autocvar_g_keepaway_noncarrier_force;
+float autocvar_g_keepaway_noncarrier_selfdamage;
+float autocvar_g_keepaway_noncarrier_selfforce;
+float autocvar_g_keepaway_noncarrier_warn;
+float autocvar_g_keepawayball_damageforcescale;
+float autocvar_g_keepawayball_respawntime;
+float autocvar_g_keepawayball_trail_color;
+float autocvar_g_keyhunt_point_leadlimit;
+#define autocvar_g_keyhunt_point_limit cvar("g_keyhunt_point_limit")
+float autocvar_g_keyhunt_teams;
+float autocvar_g_keyhunt_teams_override;
+float autocvar_g_lms_campcheck_damage;
+float autocvar_g_lms_campcheck_distance;
+float autocvar_g_lms_campcheck_interval;
+string autocvar_g_lms_campcheck_message;
+float autocvar_g_lms_join_anytime;
+float autocvar_g_lms_last_join;
+#define autocvar_g_lms_lives_override cvar("g_lms_lives_override")
+float autocvar_g_lms_regenerate;
+#define autocvar_g_maplist cvar_string("g_maplist")
+float autocvar_g_maplist_check_waypoints;
+float autocvar_g_maplist_index;
+string autocvar_g_maplist_mostrecent;
+float autocvar_g_maplist_mostrecent_count;
+float autocvar_g_maplist_selectrandom;
+float autocvar_g_maplist_shuffle;
+#define autocvar_g_maplist_votable cvar("g_maplist_votable")
+float autocvar_g_maplist_votable_abstain;
+float autocvar_g_maplist_votable_keeptwotime;
+float autocvar_g_maplist_votable_nodetail;
+string autocvar_g_maplist_votable_screenshot_dir;
+float autocvar_g_maplist_votable_suggestions;
+float autocvar_g_maplist_votable_suggestions_override_mostrecent;
+float autocvar_g_maplist_votable_timeout;
+float autocvar_g_maxplayers;
+float autocvar_g_maxplayers_spectator_blocktime;
+float autocvar_g_maxpushtime;
+float autocvar_g_maxspeed;
+#define autocvar_g_midair cvar("g_midair")
+float autocvar_g_midair_shieldtime;
+#define autocvar_g_minstagib cvar("g_minstagib")
+float autocvar_g_minstagib_ammo_drop;
+float autocvar_g_minstagib_extralives;
+float autocvar_g_minstagib_speed_highspeed;
+#define autocvar_g_mirrordamage cvar("g_mirrordamage")
+float autocvar_g_monster_zombie_attack_run_damage;
+float autocvar_g_monster_zombie_attack_run_delay;
+float autocvar_g_monster_zombie_attack_run_force;
+float autocvar_g_monster_zombie_attack_run_hitrange;
+float autocvar_g_monster_zombie_attack_run_range;
+float autocvar_g_monster_zombie_attack_stand_damage;
+float autocvar_g_monster_zombie_attack_stand_delay;
+float autocvar_g_monster_zombie_attack_stand_force;
+float autocvar_g_monster_zombie_attack_stand_range;
+float autocvar_g_monster_zombie_health;
+float autocvar_g_monster_zombie_idle_timer_max;
+float autocvar_g_monster_zombie_idle_timer_min;
+float autocvar_g_monster_zombie_movespeed;
+float autocvar_g_monster_zombie_respawntime;
+float autocvar_g_monster_zombie_stopspeed;
+float autocvar_g_monster_zombie_targetrange;
+float autocvar_g_monster_zombie_turnspeed;
+float autocvar_g_monsters;
 var float autocvar_g_movement_highspeed = 1;
-var float autocvar_sv_accuracy_data_share = 1;
-
+float autocvar_g_multijump;
+float autocvar_g_multijump_add;
+float autocvar_g_multijump_speed;
+string autocvar_g_mutatormsg;
+float autocvar_g_nexball_basketball_bouncefactor;
+float autocvar_g_nexball_basketball_bouncestop;
+float autocvar_g_nexball_basketball_carrier_highspeed;
+float autocvar_g_nexball_basketball_meter;
+float autocvar_g_nexball_basketball_meter_maxpower;
+float autocvar_g_nexball_basketball_meter_minpower;
+float autocvar_g_nexball_delay_collect;
+float autocvar_g_nexball_delay_goal;
+float autocvar_g_nexball_delay_start;
+float autocvar_g_nexball_football_bouncefactor;
+float autocvar_g_nexball_football_bouncestop;
+float autocvar_g_nexball_goalleadlimit;
+#define autocvar_g_nexball_goallimit cvar("g_nexball_goallimit")
+float autocvar_g_nexball_radar_showallplayers;
+float autocvar_g_nexball_sound_bounce;
+float autocvar_g_nexball_trail_color;
+float autocvar_g_nick_flood_penalty;
+float autocvar_g_nick_flood_penalty_red;
+float autocvar_g_nick_flood_penalty_yellow;
+float autocvar_g_nick_flood_timeout;
+float autocvar_g_nix_with_healtharmor;
+float autocvar_g_nix_with_laser;
+float autocvar_g_nix_with_powerups;
+float autocvar_g_nodepthtestitems;
+float autocvar_g_nodepthtestplayers;
+float autocvar_g_norecoil;
+float autocvar_g_onslaught_cp_buildhealth;
+float autocvar_g_onslaught_cp_buildtime;
+float autocvar_g_onslaught_cp_health;
+float autocvar_g_onslaught_cp_regen;
+float autocvar_g_onslaught_gen_health;
+float autocvar_g_pickup_cells_max;
+float autocvar_g_pickup_fuel_max;
+float autocvar_g_pickup_items;
+float autocvar_g_pickup_nails_max;
+float autocvar_g_pickup_rockets_max;
+float autocvar_g_pickup_shells_max;
+float autocvar_g_player_alpha;
+float autocvar_g_player_brightness;
+float autocvar_g_playerclip_collisions;
+string autocvar_g_playerstats_uri;
+float autocvar_g_powerup_shield;
+float autocvar_g_powerup_strength;
+float autocvar_g_powerup_superhealth;
+float autocvar_g_projectiles_newton_style;
+float autocvar_g_projectiles_newton_style_2_maxfactor;
+float autocvar_g_projectiles_newton_style_2_minfactor;
+float autocvar_g_projectiles_spread_style;
+#define autocvar_g_race_laps_limit cvar("g_race_laps_limit")
+float autocvar_g_race_qualifying_timelimit;
+float autocvar_g_race_qualifying_timelimit_override;
+float autocvar_g_race_teams;
+float autocvar_g_respawn_delay;
+float autocvar_g_respawn_ghosts;
+float autocvar_g_respawn_ghosts_maxtime;
+float autocvar_g_respawn_ghosts_speed;
+float autocvar_g_respawn_waves;
+float autocvar_g_runematch_allow_same;
+float autocvar_g_runematch_drop_runes_max;
+float autocvar_g_runematch_fixedspawns;
+float autocvar_g_runematch_frags_killed_runeholder;
+float autocvar_g_runematch_frags_killedby_runeholder;
+float autocvar_g_runematch_frags_norune;
+float autocvar_g_runematch_point_leadlimit;
+#define autocvar_g_runematch_point_limit cvar("g_runematch_point_limit")
+float autocvar_g_runematch_pointamt;
+float autocvar_g_runematch_pointrate;
+float autocvar_g_runematch_respawntime;
+float autocvar_g_runematch_rune_alpha;
+float autocvar_g_runematch_rune_color_strength;
+float autocvar_g_runematch_rune_effects;
+float autocvar_g_runematch_shuffletime;
+float autocvar_g_running_guns;
+float autocvar_g_shootfromcenter;
+float autocvar_g_shootfromclient;
+float autocvar_g_shootfromeye;
+string autocvar_g_shootfromfixedorigin;
+float autocvar_g_showweaponspawns;
+float autocvar_g_spawn_furthest;
+float autocvar_g_spawnpoints_auto_move_out_of_solid;
+#define autocvar_g_spawnshieldtime cvar("g_spawnshieldtime")
+float autocvar_g_spawnsound;
+float autocvar_g_start_delay;
+#define autocvar_g_start_weapon_laser cvar("g_start_weapon_laser")
+float autocvar_g_tdm_team_spawns;
+float autocvar_g_tdm_teams;
+float autocvar_g_tdm_teams_override;
+float autocvar_g_teamdamage_resetspeed;
+float autocvar_g_teamdamage_threshold;
+float autocvar_g_telefrags;
+float autocvar_g_telefrags_avoid;
+float autocvar_g_telefrags_teamplay;
+float autocvar_g_teleport_maxspeed;
+float autocvar_g_throughfloor_damage;
+float autocvar_g_throughfloor_force;
+float autocvar_g_triggerimpulse_accel_multiplier;
+float autocvar_g_triggerimpulse_accel_power;
+float autocvar_g_triggerimpulse_directional_multiplier;
+float autocvar_g_triggerimpulse_radial_multiplier;
+float autocvar_g_turrets;
+float autocvar_g_turrets_aimidle_delay;
+float autocvar_g_turrets_nofire;
+float autocvar_g_turrets_reloadcvars;
+float autocvar_g_turrets_targetscan_maxdelay;
+float autocvar_g_turrets_targetscan_mindelay;
+float autocvar_g_turrets_unit_ewheel_speed_fast;
+float autocvar_g_turrets_unit_ewheel_speed_slow;
+float autocvar_g_turrets_unit_ewheel_speed_slower;
+float autocvar_g_turrets_unit_ewheel_speed_stop;
+float autocvar_g_turrets_unit_ewheel_turnrate;
+float autocvar_g_turrets_unit_hellion_std_shot_speed_gain;
+float autocvar_g_turrets_unit_hellion_std_shot_speed_max;
+float autocvar_g_turrets_unit_hk_std_shot_speed;
+float autocvar_g_turrets_unit_hk_std_shot_speed_accel;
+float autocvar_g_turrets_unit_hk_std_shot_speed_accel2;
+float autocvar_g_turrets_unit_hk_std_shot_speed_decel;
+float autocvar_g_turrets_unit_hk_std_shot_speed_max;
+float autocvar_g_turrets_unit_hk_std_shot_speed_turnrate;
+float autocvar_g_turrets_unit_walker_speed_jump;
+float autocvar_g_turrets_unit_walker_speed_roam;
+float autocvar_g_turrets_unit_walker_speed_run;
+float autocvar_g_turrets_unit_walker_speed_stop;
+float autocvar_g_turrets_unit_walker_speed_swim;
+float autocvar_g_turrets_unit_walker_speed_walk;
+float autocvar_g_turrets_unit_walker_std_meele_dmg;
+float autocvar_g_turrets_unit_walker_std_meele_force;
+float autocvar_g_turrets_unit_walker_std_meele_range;
+float autocvar_g_turrets_unit_walker_std_rocket_dmg;
+float autocvar_g_turrets_unit_walker_std_rocket_force;
+float autocvar_g_turrets_unit_walker_std_rocket_radius;
+float autocvar_g_turrets_unit_walker_std_rocket_refire;
+float autocvar_g_turrets_unit_walker_std_rocket_speed;
+float autocvar_g_turrets_unit_walker_std_rocket_turnrate;
+float autocvar_g_turrets_unit_walker_std_rockets_range;
+float autocvar_g_turrets_unit_walker_std_rockets_range_min;
+float autocvar_g_use_ammunition;
+float autocvar_g_vehicle_racer_afterburn_cost;
+float autocvar_g_vehicle_racer_anglestabilizer;
+float autocvar_g_vehicle_racer_downforce;
+float autocvar_g_vehicle_racer_energy;
+float autocvar_g_vehicle_racer_energy_usepause;
+float autocvar_g_vehicle_racer_health;
+float autocvar_g_vehicle_racer_laser_cost;
+float autocvar_g_vehicle_racer_laser_damage;
+float autocvar_g_vehicle_racer_laser_radius;
+float autocvar_g_vehicle_racer_laser_refire;
+float autocvar_g_vehicle_racer_laser_speed;
+float autocvar_g_vehicle_racer_pitchspeed;
+float autocvar_g_vehicle_racer_power_air;
+float autocvar_g_vehicle_racer_power_min;
+float autocvar_g_vehicle_racer_power_solid;
+float autocvar_g_vehicle_racer_reload;
+float autocvar_g_vehicle_racer_respawntime;
+float autocvar_g_vehicle_racer_rocket_accel;
+float autocvar_g_vehicle_racer_rocket_damage;
+float autocvar_g_vehicle_racer_rocket_radius;
+float autocvar_g_vehicle_racer_rocket_refire;
+float autocvar_g_vehicle_racer_rocket_speed;
+float autocvar_g_vehicle_racer_rocket_turnrate;
+float autocvar_g_vehicle_racer_shield;
+float autocvar_g_vehicle_racer_speed_afterburn;
+float autocvar_g_vehicle_racer_speed_forward;
+float autocvar_g_vehicle_racer_speed_strafe;
+float autocvar_g_vehicle_racer_springlength;
+float autocvar_g_vehicle_racer_turnroll;
+float autocvar_g_vehicle_racer_turnspeed;
+float autocvar_g_vehicle_raptor_reload;
+float autocvar_g_vehicle_spiderbot_crush_dmg;
+float autocvar_g_vehicle_spiderbot_crush_force;
+float autocvar_g_vehicle_spiderbot_head_pitchlimit_down;
+float autocvar_g_vehicle_spiderbot_head_pitchlimit_up;
+float autocvar_g_vehicle_spiderbot_head_pitchspeed;
+float autocvar_g_vehicle_spiderbot_head_turnlimit;
+float autocvar_g_vehicle_spiderbot_head_turnspeed;
+float autocvar_g_vehicle_spiderbot_health;
+float autocvar_g_vehicle_spiderbot_minigun_cooldown;
+float autocvar_g_vehicle_spiderbot_minigun_damage;
+float autocvar_g_vehicle_spiderbot_minigun_heat;
+float autocvar_g_vehicle_spiderbot_minigun_refire;
+float autocvar_g_vehicle_spiderbot_minigun_spread;
+float autocvar_g_vehicle_spiderbot_movement_inertia;
+float autocvar_g_vehicle_spiderbot_respawntime;
+float autocvar_g_vehicle_spiderbot_rocket_damage;
+float autocvar_g_vehicle_spiderbot_rocket_edgedamage;
+float autocvar_g_vehicle_spiderbot_rocket_force;
+float autocvar_g_vehicle_spiderbot_rocket_health;
+float autocvar_g_vehicle_spiderbot_rocket_lifetime;
+float autocvar_g_vehicle_spiderbot_rocket_noise;
+float autocvar_g_vehicle_spiderbot_rocket_radius;
+float autocvar_g_vehicle_spiderbot_rocket_refire;
+float autocvar_g_vehicle_spiderbot_rocket_reload;
+float autocvar_g_vehicle_spiderbot_rocket_speed;
+float autocvar_g_vehicle_spiderbot_rocket_turnrate;
+float autocvar_g_vehicle_spiderbot_shield;
+float autocvar_g_vehicle_spiderbot_speed_stop;
+float autocvar_g_vehicle_spiderbot_speed_strafe;
+float autocvar_g_vehicle_spiderbot_speed_walk;
+float autocvar_g_vehicle_spiderbot_turnspeed;
+float autocvar_g_waypointeditor;
+float autocvar_g_waypoints_for_items;
+float autocvar_g_waypointsprite_deadlifetime;
+float autocvar_g_waypointsprite_deployed_lifetime;
+float autocvar_g_waypointsprite_limitedrange;
+float autocvar_g_weapon_charge_colormod_blue_full;
+float autocvar_g_weapon_charge_colormod_blue_half;
+float autocvar_g_weapon_charge_colormod_green_full;
+float autocvar_g_weapon_charge_colormod_green_half;
+float autocvar_g_weapon_charge_colormod_hdrmultiplier;
+float autocvar_g_weapon_charge_colormod_red_full;
+float autocvar_g_weapon_charge_colormod_red_half;
+#define autocvar_g_weapon_stay cvar("g_weapon_stay")
+float autocvar_g_weapon_throwable;
+#define autocvar_g_weaponarena cvar_string("g_weaponarena")
+string autocvar_g_xonoticversion;
+float autocvar_gamecfg;
+float autocvar_gameversion;
+string autocvar_hostname;
+float autocvar_lastlevel;
+float autocvar_leadlimit;
+float autocvar_leadlimit_and_fraglimit;
+float autocvar_leadlimit_override;
+float autocvar_loddebug;
+float autocvar_minplayers;
+string autocvar_nextmap;
+float autocvar_prvm_backtraceforwarnings;
+string autocvar_quit_and_redirect;
+float autocvar_quit_when_empty;
+float autocvar_r_showbboxes;
+float autocvar_rescan_pending;
+float autocvar_samelevel;
+#define autocvar_skill cvar("skill")
+float autocvar_skill_auto;
+#define autocvar_slowmo cvar("slowmo")
+float autocvar_snd_soundradius;
+float autocvar_spawn_debug;
+float autocvar_spawn_debugview;
+float autocvar_speedmeter;
 float autocvar_sv_accelerate;
-float autocvar_sv_friction;
-float autocvar_sv_maxspeed;
-float autocvar_sv_airaccelerate;
-float autocvar_sv_maxairspeed;
-float autocvar_sv_stopspeed;
-float autocvar_sv_gravity;
-float autocvar_sv_airaccel_sideways_friction;
+var float autocvar_sv_accuracy_data_share = 1;
+string autocvar_sv_adminnick;
 float autocvar_sv_airaccel_qw;
+float autocvar_sv_airaccel_sideways_friction;
+float autocvar_sv_airaccelerate;
+float autocvar_sv_aircontrol;
+float autocvar_sv_aircontrol_penalty;
+float autocvar_sv_aircontrol_power;
+float autocvar_sv_airspeedlimit_nonqw;
 float autocvar_sv_airstopaccelerate;
+float autocvar_sv_airstrafeaccel_qw;
 float autocvar_sv_airstrafeaccelerate;
+float autocvar_sv_allow_shownames;
+float autocvar_sv_autoscreenshot;
+float autocvar_sv_cheats;
+float autocvar_sv_curl_serverpackages_auto;
+float autocvar_sv_db_saveasdump;
+float autocvar_sv_defaultcharacter;
+string autocvar_sv_defaultplayercolors;
+string autocvar_sv_defaultplayermodel;
+string autocvar_sv_defaultplayermodel_blue;
+string autocvar_sv_defaultplayermodel_pink;
+string autocvar_sv_defaultplayermodel_red;
+string autocvar_sv_defaultplayermodel_yellow;
+float autocvar_sv_defaultplayerskin;
+float autocvar_sv_dodging_delay;
+float autocvar_sv_dodging_height_threshold;
+float autocvar_sv_dodging_horiz_speed;
+float autocvar_sv_dodging_ramp_time;
+float autocvar_sv_dodging_sound;
+float autocvar_sv_dodging_up_speed;
+float autocvar_sv_dodging_wall_distance_threshold;
+float autocvar_sv_dodging_wall_dodging;
+float autocvar_sv_eventlog;
+float autocvar_sv_eventlog_console;
+float autocvar_sv_eventlog_files;
+float autocvar_sv_eventlog_files_counter;
+string autocvar_sv_eventlog_files_nameprefix;
+string autocvar_sv_eventlog_files_namesuffix;
+float autocvar_sv_eventlog_files_timestamps;
+float autocvar_sv_fragmessage_information_handicap;
+float autocvar_sv_fragmessage_information_ping;
+float autocvar_sv_fragmessage_information_stats;
+float autocvar_sv_fragmessage_information_typefrag;
+float autocvar_sv_friction;
+float autocvar_sv_friction_on_land;
+float autocvar_sv_gameplayfix_q2airaccelerate;
+#define autocvar_sv_gravity cvar("sv_gravity")
+float autocvar_sv_hitsound_antispam_time;
+string autocvar_sv_intermission_cdtrack;
+string autocvar_sv_jumpspeedcap_max;
+float autocvar_sv_jumpspeedcap_max_disable_on_ramps;
+string autocvar_sv_jumpspeedcap_min;
+float autocvar_sv_jumpvelocity;
+float autocvar_sv_logscores_bots;
+float autocvar_sv_logscores_console;
+float autocvar_sv_logscores_file;
+string autocvar_sv_logscores_filename;
+float autocvar_sv_mapchange_delay;
+float autocvar_sv_maxairspeed;
 float autocvar_sv_maxairstrafespeed;
-float autocvar_sv_airstrafeaccel_qw;
-float autocvar_sv_aircontrol;
-float autocvar_sv_aircontrol_power;
-float autocvar_sv_aircontrol_penalty;
-float autocvar_sv_warsowbunny_airforwardaccel;
+float autocvar_sv_maxspeed;
+string autocvar_sv_motd;
+string autocvar_sv_player_crouch_maxs;
+string autocvar_sv_player_crouch_mins;
+string autocvar_sv_player_crouch_viewoffset;
+string autocvar_sv_player_headsize;
+string autocvar_sv_player_maxs;
+string autocvar_sv_player_mins;
+string autocvar_sv_player_viewoffset;
+float autocvar_sv_precacheplayermodels;
+float autocvar_sv_precacheweapons;
+float autocvar_sv_q3acompat_machineshotgunswap;
+float autocvar_sv_qcweaponanimation;
+float autocvar_sv_ready_restart;
+float autocvar_sv_ready_restart_after_countdown;
+float autocvar_sv_ready_restart_repeatable;
+float autocvar_sv_servermodelsonly;
+float autocvar_sv_spectate;
+float autocvar_sv_spectator_speed_multiplier;
+float autocvar_sv_stepheight;
+float autocvar_sv_stopspeed;
+float autocvar_sv_strengthsound_antispam_refire_threshold;
+float autocvar_sv_strengthsound_antispam_time;
+float autocvar_sv_teamnagger;
+float autocvar_sv_timeout;
+float autocvar_sv_timeout_leadtime;
+float autocvar_sv_timeout_length;
+float autocvar_sv_timeout_number;
+float autocvar_sv_timeout_resumetime;
+float autocvar_sv_vote_call;
+float autocvar_sv_vote_change;
+string autocvar_sv_vote_commands;
+float autocvar_sv_vote_majority_factor;
+float autocvar_sv_vote_master;
+string autocvar_sv_vote_master_commands;
+string autocvar_sv_vote_master_password;
+float autocvar_sv_vote_nospectators;
+string autocvar_sv_vote_only_commands;
+float autocvar_sv_vote_override_mostrecent;
+float autocvar_sv_vote_simple_majority_factor;
+float autocvar_sv_vote_singlecount;
+float autocvar_sv_vote_stop;
+float autocvar_sv_vote_timeout;
+float autocvar_sv_vote_wait;
 float autocvar_sv_warsowbunny_accel;
+float autocvar_sv_warsowbunny_airforwardaccel;
+float autocvar_sv_warsowbunny_backtosideratio;
 float autocvar_sv_warsowbunny_topspeed;
 float autocvar_sv_warsowbunny_turnaccel;
-float autocvar_sv_warsowbunny_backtosideratio;
-float autocvar_sv_airspeedlimit_nonqw;
+string autocvar_sv_weaponstats_damagefile;
+string autocvar_sv_weaponstats_killfile;
+float autocvar_sys_ticrate;
+float autocvar_teamplay_lockonrestart;
+float autocvar_teamplay_mode;
+#define autocvar_timelimit cvar("timelimit")
+#define autocvar_timelimit_override cvar("timelimit_override")
+float autocvar_timelimit_overtime;
+float autocvar_timelimit_overtimes;
+float autocvar_timelimit_suddendeath;
+#define autocvar_utf8_enable cvar("utf8_enable")
+float autocvar_waypoint_benchmark;
+float autocvar_welcome_message_time;
index e6950dd3e4ebc472a4e59b10244ce9432f5cdd61..1911daf9e6a3ad2f5504995fac11f68b3256f5f1 100644 (file)
@@ -176,7 +176,7 @@ float bot_aimdir(vector v, float maxfiredeviation)
        if (time >= self.bot_badaimtime)
        {
                self.bot_badaimtime = max(self.bot_badaimtime + 0.3, time);
-               self.bot_badaimoffset = randomvec() * bound(0, 5 - 0.5 * (skill+self.bot_offsetskill), 5) * cvar("bot_ai_aimskill_offset");
+               self.bot_badaimoffset = randomvec() * bound(0, 5 - 0.5 * (skill+self.bot_offsetskill), 5) * autocvar_bot_ai_aimskill_offset;
        }
        desiredang = vectoangles(v) + self.bot_badaimoffset;
        //dprint(" desired:", vtos(desiredang));
@@ -206,25 +206,25 @@ float bot_aimdir(vector v, float maxfiredeviation)
        self.bot_prevaimtime = time;
        // Here we will try to anticipate the comming aiming direction
        self.bot_1st_order_aimfilter= self.bot_1st_order_aimfilter
-               + (diffang * (1 / delta_t)    - self.bot_1st_order_aimfilter) * bound(0, cvar("bot_ai_aimskill_order_filter_1st"),1);
+               + (diffang * (1 / delta_t)    - self.bot_1st_order_aimfilter) * bound(0, autocvar_bot_ai_aimskill_order_filter_1st,1);
        self.bot_2nd_order_aimfilter= self.bot_2nd_order_aimfilter
-               + (self.bot_1st_order_aimfilter - self.bot_2nd_order_aimfilter) * bound(0, cvar("bot_ai_aimskill_order_filter_2nd"),1);
+               + (self.bot_1st_order_aimfilter - self.bot_2nd_order_aimfilter) * bound(0, autocvar_bot_ai_aimskill_order_filter_2nd,1);
        self.bot_3th_order_aimfilter= self.bot_3th_order_aimfilter
-               + (self.bot_2nd_order_aimfilter - self.bot_3th_order_aimfilter) * bound(0, cvar("bot_ai_aimskill_order_filter_3th"),1);
+               + (self.bot_2nd_order_aimfilter - self.bot_3th_order_aimfilter) * bound(0, autocvar_bot_ai_aimskill_order_filter_3th,1);
        self.bot_4th_order_aimfilter= self.bot_4th_order_aimfilter
-               + (self.bot_3th_order_aimfilter - self.bot_4th_order_aimfilter) * bound(0, cvar("bot_ai_aimskill_order_filter_4th"),1);
+               + (self.bot_3th_order_aimfilter - self.bot_4th_order_aimfilter) * bound(0, autocvar_bot_ai_aimskill_order_filter_4th,1);
        self.bot_5th_order_aimfilter= self.bot_5th_order_aimfilter
-               + (self.bot_4th_order_aimfilter - self.bot_5th_order_aimfilter) * bound(0, cvar("bot_ai_aimskill_order_filter_5th"),1);
+               + (self.bot_4th_order_aimfilter - self.bot_5th_order_aimfilter) * bound(0, autocvar_bot_ai_aimskill_order_filter_5th,1);
 
        //blend = (bound(0,skill,10)*0.1)*pow(1-bound(0,skill,10)*0.05,2.5)*5.656854249; //Plot formule before changing !
        blend = bound(0,skill+self.bot_aimskill,10)*0.1;
        desiredang = desiredang + blend *
        (
-                 self.bot_1st_order_aimfilter * cvar("bot_ai_aimskill_order_mix_1st")
-               + self.bot_2nd_order_aimfilter * cvar("bot_ai_aimskill_order_mix_2nd")
-               + self.bot_3th_order_aimfilter * cvar("bot_ai_aimskill_order_mix_3th")
-               + self.bot_4th_order_aimfilter * cvar("bot_ai_aimskill_order_mix_4th")
-               + self.bot_5th_order_aimfilter * cvar("bot_ai_aimskill_order_mix_5th")
+                 self.bot_1st_order_aimfilter * autocvar_bot_ai_aimskill_order_mix_1st
+               + self.bot_2nd_order_aimfilter * autocvar_bot_ai_aimskill_order_mix_2nd
+               + self.bot_3th_order_aimfilter * autocvar_bot_ai_aimskill_order_mix_3th
+               + self.bot_4th_order_aimfilter * autocvar_bot_ai_aimskill_order_mix_4th
+               + self.bot_5th_order_aimfilter * autocvar_bot_ai_aimskill_order_mix_5th
        );
 
        // calculate turn angles
@@ -248,7 +248,7 @@ float bot_aimdir(vector v, float maxfiredeviation)
        diffang_y = diffang_y - floor(diffang_y / 360) * 360;
        if (diffang_y >= 180)
                diffang_y = diffang_y - 360;
-       desiredang = desiredang + diffang * bound(0,cvar("bot_ai_aimskill_think"),1);
+       desiredang = desiredang + diffang * bound(0,autocvar_bot_ai_aimskill_think,1);
 
        // calculate turn angles
        diffang = desiredang - self.v_angle;
@@ -264,12 +264,12 @@ float bot_aimdir(vector v, float maxfiredeviation)
 
        // turn
        local float r, fixedrate, blendrate;
-       fixedrate = cvar("bot_ai_aimskill_fixedrate") / bound(1,dist,1000);
-       blendrate = cvar("bot_ai_aimskill_blendrate");
+       fixedrate = autocvar_bot_ai_aimskill_fixedrate / bound(1,dist,1000);
+       blendrate = autocvar_bot_ai_aimskill_blendrate;
        r = max(fixedrate, blendrate);
        //self.v_angle = self.v_angle + diffang * bound(frametime, r * frametime * (2+skill*skill*0.05-random()*0.05*(10-skill)), 1);
        self.v_angle = self.v_angle + diffang * bound(delta_t, r * delta_t * (2+pow(skill+self.bot_mouseskill,3)*0.005-random()), 1);
-       self.v_angle = self.v_angle * bound(0,cvar("bot_ai_aimskill_mouse"),1) + desiredang * bound(0,(1-cvar("bot_ai_aimskill_mouse")),1);
+       self.v_angle = self.v_angle * bound(0,autocvar_bot_ai_aimskill_mouse,1) + desiredang * bound(0,(1-autocvar_bot_ai_aimskill_mouse),1);
        //self.v_angle = self.v_angle + diffang * bound(0, r * frametime * (skill * 0.5 + 2), 1);
        //self.v_angle = self.v_angle + diffang * (1/ blendrate);
        self.v_angle_z = 0;
@@ -339,10 +339,10 @@ float bot_aim(float shotspeed, float shotspeedupward, float maxshottime, float a
        shotdir = v_forward;
        v = bot_shotlead(self.bot_aimtargorigin, self.bot_aimtargvelocity, shotspeed, self.bot_aimlatency);
        local float distanceratio;
-       distanceratio =sqrt(bound(0,skill,10000))*0.3*(vlen(v-shotorg)-100)/cvar("bot_ai_aimskill_firetolerance_distdegrees");
+       distanceratio =sqrt(bound(0,skill,10000))*0.3*(vlen(v-shotorg)-100)/autocvar_bot_ai_aimskill_firetolerance_distdegrees;
        distanceratio = bound(0,distanceratio,1);
-       r =  (cvar("bot_ai_aimskill_firetolerance_maxdegrees")-cvar("bot_ai_aimskill_firetolerance_mindegrees"))
-               * (1-distanceratio) + cvar("bot_ai_aimskill_firetolerance_mindegrees");
+       r =  (autocvar_bot_ai_aimskill_firetolerance_maxdegrees-autocvar_bot_ai_aimskill_firetolerance_mindegrees)
+               * (1-distanceratio) + autocvar_bot_ai_aimskill_firetolerance_mindegrees;
        if (applygravity && self.bot_aimtarg)
        {
                if (!findtrajectorywithleading(shotorg, '0 0 0', '0 0 0', self.bot_aimtarg, shotspeed, shotspeedupward, maxshottime, 0, self))
index a784ef48b17542c38d9448ea3631ec344aa23654..581e3f0c758050dae69b33c9c983a98a4ba735c4 100644 (file)
@@ -33,17 +33,17 @@ void bot_think()
                return;
 
        self.flags &~= FL_GODMODE;
-       if(cvar("bot_god"))
+       if(autocvar_bot_god)
                self.flags |= FL_GODMODE;
 
-       self.bot_nextthink = self.bot_nextthink + cvar("bot_ai_thinkinterval") * pow(0.5, self.bot_aiskill);
+       self.bot_nextthink = self.bot_nextthink + autocvar_bot_ai_thinkinterval * pow(0.5, self.bot_aiskill);
        //if (self.bot_painintensity > 0)
        //      self.bot_painintensity = self.bot_painintensity - (skill + 1) * 40 * frametime;
 
        //self.bot_painintensity = self.bot_painintensity + self.bot_oldhealth - self.health;
        //self.bot_painintensity = bound(0, self.bot_painintensity, 100);
 
-       if (cvar("g_campaign") && !campaign_bots_may_start)
+       if (autocvar_g_campaign && !campaign_bots_may_start)
        {
                self.nextthink = time + 0.5;
                return;
@@ -112,21 +112,21 @@ void bot_setnameandstuff()
        string bot_name, bot_model, bot_skin, bot_shirt, bot_pants;
        string name, prefix, suffix;
 
-       if(cvar("g_campaign"))
+       if(autocvar_g_campaign)
        {
                prefix = "";
                suffix = "";
        }
        else
        {
-               prefix = cvar_string("bot_prefix");
-               suffix = cvar_string("bot_suffix");
+               prefix = autocvar_bot_prefix;
+               suffix = autocvar_bot_suffix;
        }
 
-       file = fopen(cvar_string("bot_config_file"), FILE_READ);
+       file = fopen(autocvar_bot_config_file, FILE_READ);
 
        if(file < 0)
-               print(strcat("Error: Can not open the bot configuration file '",cvar_string("bot_config_file"),"'\n"));
+               print(strcat("Error: Can not open the bot configuration file '",autocvar_bot_config_file,"'\n"));
        else
        {
                RandomSelection_Init();
@@ -177,7 +177,7 @@ void bot_setnameandstuff()
 
        prio = 6;
 
-       #define READSKILL(f,w,r) if(argv(prio) != "") self.f = stof(argv(prio)) * (w); else self.f = (!cvar("g_campaign")) * (2 * random() - 1) * (r) * (w); ++prio
+       #define READSKILL(f,w,r) if(argv(prio) != "") self.f = stof(argv(prio)) * (w); else self.f = (!autocvar_g_campaign) * (2 * random() - 1) * (r) * (w); ++prio
        //print(bot_name, ": ping=", argv(9), "\n");
 
        READSKILL(havocbot_keyboardskill, 0.5, 0.5); // keyboard skill
@@ -204,7 +204,7 @@ void bot_setnameandstuff()
        self.bot_preferredcolors = self.clientcolors;
 
        // pick the name
-       if (cvar("bot_usemodelnames"))
+       if (autocvar_bot_usemodelnames)
                name = bot_model;
        else
                name = bot_name;
@@ -241,15 +241,15 @@ void bot_custom_weapon_priority_setup()
 
        bot_custom_weapon = FALSE;
 
-       if(     cvar_string("bot_ai_custom_weapon_priority_far") == "" ||
-               cvar_string("bot_ai_custom_weapon_priority_mid") == "" ||
-               cvar_string("bot_ai_custom_weapon_priority_close") == "" ||
-               cvar_string("bot_ai_custom_weapon_priority_distances") == ""
+       if(     autocvar_bot_ai_custom_weapon_priority_far == "" ||
+               autocvar_bot_ai_custom_weapon_priority_mid == "" ||
+               autocvar_bot_ai_custom_weapon_priority_close == "" ||
+               autocvar_bot_ai_custom_weapon_priority_distances == ""
        )
                return;
 
        // Parse distances
-       tokens = tokenizebyseparator(cvar_string("bot_ai_custom_weapon_priority_distances")," ");
+       tokens = tokenizebyseparator(autocvar_bot_ai_custom_weapon_priority_distances," ");
 
        if (tokens!=2)
                return;
@@ -268,7 +268,7 @@ void bot_custom_weapon_priority_setup()
        bot_weapons_close[0] = -1;
 
        // Parse far distance weapon priorities
-       tokens = tokenizebyseparator(W_NumberWeaponOrder(cvar_string("bot_ai_custom_weapon_priority_far"))," ");
+       tokens = tokenizebyseparator(W_NumberWeaponOrder(autocvar_bot_ai_custom_weapon_priority_far)," ");
 
        c = 0;
        for(i=0; i < tokens && c < WEP_COUNT; ++i){
@@ -282,7 +282,7 @@ void bot_custom_weapon_priority_setup()
                bot_weapons_far[c] = -1;
 
        // Parse mid distance weapon priorities
-       tokens = tokenizebyseparator(W_NumberWeaponOrder(cvar_string("bot_ai_custom_weapon_priority_mid"))," ");
+       tokens = tokenizebyseparator(W_NumberWeaponOrder(autocvar_bot_ai_custom_weapon_priority_mid)," ");
 
        c = 0;
        for(i=0; i < tokens && c < WEP_COUNT; ++i){
@@ -296,7 +296,7 @@ void bot_custom_weapon_priority_setup()
                bot_weapons_mid[c] = -1;
 
        // Parse close distance weapon priorities
-       tokens = tokenizebyseparator(W_NumberWeaponOrder(cvar_string("bot_ai_custom_weapon_priority_close"))," ");
+       tokens = tokenizebyseparator(W_NumberWeaponOrder(autocvar_bot_ai_custom_weapon_priority_close)," ");
 
        c = 0;
        for(i=0; i < tokens && i < WEP_COUNT; ++i){
@@ -498,20 +498,20 @@ void autoskill(float factor)
        }
        else if(bestbot <= bestplayer * factor - 2)
        {
-               if(cvar("skill") < 17)
+               if(autocvar_skill < 17)
                {
                        dprint("2 frags difference, increasing skill\n");
-                       cvar_set("skill", ftos(cvar("skill") + 1));
-                       bprint("^2SKILL UP!^7 Now at level ", ftos(cvar("skill")), "\n");
+                       cvar_set("skill", ftos(autocvar_skill + 1));
+                       bprint("^2SKILL UP!^7 Now at level ", ftos(autocvar_skill), "\n");
                }
        }
        else if(bestbot >= bestplayer * factor + 2)
        {
-               if(cvar("skill") > 0)
+               if(autocvar_skill > 0)
                {
                        dprint("2 frags difference, decreasing skill\n");
-                       cvar_set("skill", ftos(cvar("skill") - 1));
-                       bprint("^1SKILL DOWN!^7 Now at level ", ftos(cvar("skill")), "\n");
+                       cvar_set("skill", ftos(autocvar_skill - 1));
+                       bprint("^1SKILL DOWN!^7 Now at level ", ftos(autocvar_skill), "\n");
                }
        }
        else
@@ -536,13 +536,13 @@ void bot_serverframe()
        if (time < 2)
                return;
 
-       stepheightvec = cvar("sv_stepheight") * '0 0 1';
-       bot_navigation_movemode = ((cvar("bot_navigation_ignoreplayers")) ? MOVE_NOMONSTERS : MOVE_NORMAL);
+       stepheightvec = autocvar_sv_stepheight * '0 0 1';
+       bot_navigation_movemode = ((autocvar_bot_navigation_ignoreplayers) ? MOVE_NOMONSTERS : MOVE_NORMAL);
 
        if(time > autoskill_nextthink)
        {
                float a;
-               a = cvar("skill_auto");
+               a = autocvar_skill_auto;
                if(a)
                        autoskill(a);
                autoskill_nextthink = time + 5;
@@ -563,16 +563,16 @@ void bot_serverframe()
        // But don't remove bots immediately on level change, as the real players
        // usually haven't rejoined yet
        bots_would_leave = FALSE;
-       if (teams_matter && cvar("bot_vs_human") && (c3==-1 && c4==-1))
-               bots = min(ceil(fabs(cvar("bot_vs_human")) * activerealplayers), maxclients - realplayers);
-       else if ((realplayers || cvar("bot_join_empty") || (currentbots > 0 && time < 5)))
+       if (teams_matter && autocvar_bot_vs_human && (c3==-1 && c4==-1))
+               bots = min(ceil(fabs(autocvar_bot_vs_human) * activerealplayers), maxclients - realplayers);
+       else if ((realplayers || autocvar_bot_join_empty || (currentbots > 0 && time < 5)))
        {
                float realminplayers, minplayers;
-               realminplayers = cvar("minplayers");
+               realminplayers = autocvar_minplayers;
                minplayers = max(0, floor(realminplayers));
 
                float realminbots, minbots;
-               realminbots = cvar("bot_number");
+               realminbots = autocvar_bot_number;
                minbots = max(0, floor(realminbots));
 
                bots = min(max(minbots, minplayers - activerealplayers), maxclients - realplayers);
@@ -585,7 +585,7 @@ void bot_serverframe()
                bots = 0;
        }
 
-       bot_ignore_bots = cvar("bot_ignore_bots");
+       bot_ignore_bots = autocvar_bot_ignore_bots;
 
        // only add one bot per frame to avoid utter chaos
        if(time > botframe_nextthink)
@@ -606,11 +606,11 @@ void bot_serverframe()
 
        if(botframe_spawnedwaypoints)
        {
-               if(cvar("waypoint_benchmark"))
+               if(autocvar_waypoint_benchmark)
                        localcmd("quit\n");
        }
 
-       if (currentbots > 0 || cvar("g_waypointeditor"))
+       if (currentbots > 0 || autocvar_g_waypointeditor)
        if (botframe_spawnedwaypoints)
        {
                if(botframe_cachedwaypointlinks)
@@ -651,15 +651,15 @@ void bot_serverframe()
                if (botframe_nextdangertime < time)
                {
                        local float interval;
-                       interval = cvar("bot_ai_dangerdetectioninterval");
+                       interval = autocvar_bot_ai_dangerdetectioninterval;
                        if (botframe_nextdangertime < time - interval * 1.5)
                                botframe_nextdangertime = time;
                        botframe_nextdangertime = botframe_nextdangertime + interval;
-                       botframe_updatedangerousobjects(cvar("bot_ai_dangerdetectionupdates"));
+                       botframe_updatedangerousobjects(autocvar_bot_ai_dangerdetectionupdates);
                }
        }
 
-       if (cvar("g_waypointeditor"))
+       if (autocvar_g_waypointeditor)
                botframe_showwaypointlinks();
 
        if(time > bot_cvar_nextthink)
index 5ed78628a8889b6577153625ba6dbad6008be991..c1785a8d2754fc25c57fd527d38db2ecb79867ed 100644 (file)
@@ -80,7 +80,7 @@ void havocbot_ai()
        havocbot_chooseenemy();
        if (self.bot_chooseweapontime < time )
        {
-               self.bot_chooseweapontime = time + cvar("bot_ai_chooseweaponinterval");
+               self.bot_chooseweapontime = time + autocvar_bot_ai_chooseweaponinterval;
                havocbot_chooseweapon();
        }
        havocbot_aim();
@@ -93,7 +93,7 @@ void havocbot_ai()
                if(self.weapons)
                {
                        weapon_action(self.weapon, WR_AIM);
-                       if (cvar("bot_nofire") || IS_INDEPENDENT_PLAYER(self))
+                       if (autocvar_bot_nofire || IS_INDEPENDENT_PLAYER(self))
                        {
                                self.BUTTON_ATCK = FALSE;
                                self.BUTTON_ATCK2 = FALSE;
@@ -128,7 +128,7 @@ void havocbot_ai()
                        next = self.goalstack01.origin - (self.origin + self.view_ofs);
 
                skillblend=bound(0,(skill+self.bot_moveskill-2.5)*0.5,1); //lower skill player can't preturn
-               distanceblend=bound(0,aimdistance/cvar("bot_ai_keyboard_distance"),1);
+               distanceblend=bound(0,aimdistance/autocvar_bot_ai_keyboard_distance,1);
                blend = skillblend * (1-distanceblend);
                //v = (now * (distanceblend) + next * (1-distanceblend)) * (skillblend) + now * (1-skillblend);
                //v = now * (distanceblend) * (skillblend) + next * (1-distanceblend) * (skillblend) + now * (1-skillblend);
@@ -154,7 +154,7 @@ void havocbot_keyboard_movement(vector destorg)
 
        sk = skill + self.bot_moveskill;
 
-       maxspeed = cvar("sv_maxspeed");
+       maxspeed = autocvar_sv_maxspeed;
 
        if (time < self.havocbot_keyboardtime)
                return;
@@ -169,7 +169,7 @@ void havocbot_keyboard_movement(vector destorg)
 
        local float trigger, trigger1;
        blend = bound(0,sk*0.1,1);
-       trigger = cvar("bot_ai_keyboard_treshold");
+       trigger = autocvar_bot_ai_keyboard_treshold;
        trigger1 = 0 - trigger;
 
        // categorize forward movement
@@ -216,7 +216,7 @@ void havocbot_keyboard_movement(vector destorg)
        if (self.havocbot_ducktime>time) self.BUTTON_CROUCH=TRUE;
 
        keyboard = self.havocbot_keyboard;
-       blend = bound(0,vlen(destorg-self.origin)/cvar("bot_ai_keyboard_distance"),1); // When getting close move with 360 degree
+       blend = bound(0,vlen(destorg-self.origin)/autocvar_bot_ai_keyboard_distance,1); // When getting close move with 360 degree
        //dprint("movement ", vtos(self.movement), " keyboard ", vtos(keyboard), " blend ", ftos(blend), "\n");
        self.movement = self.movement + (keyboard - self.movement) * blend;
 };
@@ -227,7 +227,7 @@ void havocbot_bunnyhop(vector dir)
        local vector deviation;
        local float maxspeed;
 
-       if(cvar("g_midair"))
+       if(autocvar_g_midair)
                return;
 
        // Don't jump when using some weapons
@@ -238,7 +238,7 @@ void havocbot_bunnyhop(vector dir)
        if(self.goalcurrent.classname == "player")
                return;
 
-       maxspeed = cvar("sv_maxspeed");
+       maxspeed = autocvar_sv_maxspeed;
 
        if(self.aistatus & AI_STATUS_DANGER_AHEAD)
        {
@@ -274,7 +274,7 @@ void havocbot_bunnyhop(vector dir)
                        if(self.bot_timelastseengoal)
                        {
                                // for a period of time
-                               if(time - self.bot_timelastseengoal > cvar("bot_ai_bunnyhop_firstjumpdelay"))
+                               if(time - self.bot_timelastseengoal > autocvar_bot_ai_bunnyhop_firstjumpdelay)
                                {
                                        local float checkdistance;
                                        checkdistance = TRUE;
@@ -282,7 +282,7 @@ void havocbot_bunnyhop(vector dir)
                                        // don't run if it is too close
                                        if(self.bot_canruntogoal==0)
                                        {
-                                               if(bunnyhopdistance > cvar("bot_ai_bunnyhop_startdistance"))
+                                               if(bunnyhopdistance > autocvar_bot_ai_bunnyhop_startdistance)
                                                        self.bot_canruntogoal = 1;
                                                else
                                                        self.bot_canruntogoal = -1;
@@ -305,7 +305,7 @@ void havocbot_bunnyhop(vector dir)
                                                if(bunnyhopdistance < vlen(self.origin - self.goalstack01.origin))
                                                if(fabs(self.goalstack01.origin_z - self.goalcurrent.origin_z) < self.maxs_z - self.mins_z)
                                                {
-                                                       if(vlen(self.goalcurrent.origin - self.goalstack01.origin) > cvar("bot_ai_bunnyhop_startdistance"))
+                                                       if(vlen(self.goalcurrent.origin - self.goalstack01.origin) > autocvar_bot_ai_bunnyhop_startdistance)
                                                        if(checkpvs(self.origin + self.view_ofs, self.goalstack01))
                                                        {
                                                                checkdistance = FALSE;
@@ -316,7 +316,7 @@ void havocbot_bunnyhop(vector dir)
                                        if(checkdistance)
                                        {
                                                self.aistatus &~= AI_STATUS_RUNNING;
-                                               if(bunnyhopdistance > cvar("bot_ai_bunnyhop_stopdistance"))
+                                               if(bunnyhopdistance > autocvar_bot_ai_bunnyhop_stopdistance)
                                                        self.BUTTON_JUMP = TRUE;
                                        }
                                        else
@@ -379,7 +379,7 @@ void havocbot_movetogoal()
        //if (self.goalentity)
        //      te_lightning2(self, self.origin, (self.goalentity.absmin + self.goalentity.absmax) * 0.5);
        self.movement = '0 0 0';
-       maxspeed = cvar("sv_maxspeed");
+       maxspeed = autocvar_sv_maxspeed;
 
        // Jetpack navigation
        if(self.goalcurrent)
@@ -414,7 +414,7 @@ void havocbot_movetogoal()
                        dxy = self.origin - self.goalcurrent.origin; dxy_z = 0;
                        d = vlen(dxy);
                        v = vlen(self.velocity -  self.velocity_z * '0 0 1');
-                       db = (pow(v,2) / (cvar("g_jetpack_acceleration_side") * 2)) + 100;
+                       db = (pow(v,2) / (autocvar_g_jetpack_acceleration_side * 2)) + 100;
                //      dprint("distance ", ftos(ceil(d)), " velocity ", ftos(ceil(v)), " brake at ", ftos(ceil(db)), "\n");
                        if(d < db || d < 500)
                        {
@@ -491,7 +491,7 @@ void havocbot_movetogoal()
                                if(newgoal)
                                {
                                        self.ignoregoal = self.goalcurrent;
-                                       self.ignoregoaltime = time + cvar("bot_ai_ignoregoal_timeout");
+                                       self.ignoregoaltime = time + autocvar_bot_ai_ignoregoal_timeout;
                                        navigation_clearroute();
                                        navigation_routetogoal(newgoal, self.origin);
                                        self.aistatus &~= AI_STATUS_OUT_JUMPPAD;
@@ -559,7 +559,7 @@ void havocbot_movetogoal()
 
                        return;
                }
-               else if(self.health>cvar("g_balance_rocketlauncher_damage")*0.5)
+               else if(self.health>autocvar_g_balance_rocketlauncher_damage*0.5)
                {
                        if(self.velocity_z < 0)
                        if(client_hasweapon(self, WEP_ROCKET_LAUNCHER, TRUE, FALSE))
@@ -579,7 +579,7 @@ void havocbot_movetogoal()
                                self.switchweapon = WEP_ROCKET_LAUNCHER;
                                self.v_angle_x = 90;
                                self.BUTTON_ATCK = TRUE;
-                               self.rocketjumptime = time + cvar("g_balance_rocketlauncher_detonatedelay");
+                               self.rocketjumptime = time + autocvar_g_balance_rocketlauncher_detonatedelay;
                                return;
                        }
                }
@@ -702,7 +702,7 @@ void havocbot_movetogoal()
                                if(self.facingwalltime && time > self.facingwalltime)
                                {
                                        self.ignoregoal = self.goalcurrent;
-                                       self.ignoregoaltime = time + cvar("bot_ai_ignoregoal_timeout");
+                                       self.ignoregoaltime = time + autocvar_bot_ai_ignoregoal_timeout;
                                        self.bot_strategytime = 0;
                                        return;
                                }
@@ -808,10 +808,10 @@ void havocbot_movetogoal()
        // Bunnyhop!
 //     if(self.aistatus & AI_STATUS_ROAMING)
        if(self.goalcurrent)
-       if(skill+self.bot_moveskill >= cvar("bot_ai_bunnyhop_skilloffset"))
+       if(skill+self.bot_moveskill >= autocvar_bot_ai_bunnyhop_skilloffset)
                havocbot_bunnyhop(dir);
 
-       if ((dir * v_up) >= cvar("sv_jumpvelocity")*0.5 && (self.flags & FL_ONGROUND)) self.BUTTON_JUMP=1;
+       if ((dir * v_up) >= autocvar_sv_jumpvelocity*0.5 && (self.flags & FL_ONGROUND)) self.BUTTON_JUMP=1;
        if (((dodge * v_up) > 0) && random()*frametime >= 0.2*bound(0,(10-skill-self.bot_dodgeskill)*0.1,1)) self.BUTTON_JUMP=TRUE;
        if (((dodge * v_up) < 0) && random()*frametime >= 0.5*bound(0,(10-skill-self.bot_dodgeskill)*0.1,1)) self.havocbot_ducktime=time+0.3/bound(0.1,skill+self.bot_dodgeskill,10);
 };
@@ -821,7 +821,7 @@ void havocbot_chooseenemy()
        local entity head, best, head2;
        local float rating, bestrating, i, f;
        local vector eye, v;
-       if (cvar("bot_nofire") || IS_INDEPENDENT_PLAYER(self))
+       if (autocvar_bot_nofire || IS_INDEPENDENT_PLAYER(self))
        {
                self.enemy = world;
                return;
@@ -847,7 +847,7 @@ void havocbot_chooseenemy()
                        if (self.health > 30)
                        {
                                // remain tracking him for a shot while (case he went after a small corner or pilar
-                               self.havocbot_chooseenemy_finished = time + cvar("bot_ai_enemydetectioninterval");
+                               self.havocbot_chooseenemy_finished = time + autocvar_bot_ai_enemydetectioninterval;
                                return;
                        }
                        // enemy isn't visible, or is far away, or we're injured severely
@@ -858,7 +858,7 @@ void havocbot_chooseenemy()
        }
        if (time < self.havocbot_chooseenemy_finished)
                return;
-       self.havocbot_chooseenemy_finished = time + cvar("bot_ai_enemydetectioninterval");
+       self.havocbot_chooseenemy_finished = time + autocvar_bot_ai_enemydetectioninterval;
        eye = self.origin + self.view_ofs;
        best = world;
        bestrating = 100000000;
@@ -871,7 +871,7 @@ void havocbot_chooseenemy()
                {
                        v = (head.absmin + head.absmax) * 0.5;
                        rating = vlen(v - eye);
-                       if (rating<cvar("bot_ai_enemydetectionradius"))
+                       if (rating<autocvar_bot_ai_enemydetectionradius)
                        if (bestrating > rating)
                        if (bot_shouldattack(head))
                        {
@@ -942,7 +942,7 @@ void havocbot_chooseweapon()
 
        // Workaround for rifle reloading (..)
        if(self.weapon == WEP_CAMPINGRIFLE)
-       if(i < cvar("g_balance_campingrifle_reloadtime") + 1)
+       if(i < autocvar_g_balance_campingrifle_reloadtime + 1)
                return;
 
        local float w;
@@ -968,7 +968,7 @@ void havocbot_chooseweapon()
        local float af, ct, combo_time, combo;
 
        af = ATTACK_FINISHED(self);
-       ct = cvar("bot_ai_weapon_combo_threshold");
+       ct = autocvar_bot_ai_weapon_combo_threshold;
 
        // Bots with no skill will be 4 times more slower than "godlike" bots when doing weapon combos
        // Ideally this 4 should be calculated as longest_weapon_refire / bot_ai_weapon_combo_threshold
@@ -976,7 +976,7 @@ void havocbot_chooseweapon()
 
        combo = FALSE;
 
-       if(cvar("bot_ai_weapon_combo"))
+       if(autocvar_bot_ai_weapon_combo)
        if(self.weapon == self.lastfiredweapon)
        if(af > combo_time)
        {
index 1cb91819d551a1c6bfe36acbd2f19ea841bf3060..0ec0abb3ce5c1427d7fb8140928bd65b75cb943a 100644 (file)
@@ -251,7 +251,7 @@ void havocbot_role_ctf_carrier()
 
        if (self.bot_strategytime < time)
        {
-               self.bot_strategytime = time + cvar("bot_ai_strategyinterval");
+               self.bot_strategytime = time + autocvar_bot_ai_strategyinterval;
 
                navigation_goalrating_start();
                havocbot_goalrating_ctf_ourbase(50000);
@@ -324,7 +324,7 @@ void havocbot_role_ctf_escort()
        // Chase the flag carrier
        if (self.bot_strategytime < time)
        {
-               self.bot_strategytime = time + cvar("bot_ai_strategyinterval");
+               self.bot_strategytime = time + autocvar_bot_ai_strategyinterval;
                navigation_goalrating_start();
                havocbot_goalrating_ctf_enemyflag(30000);
                havocbot_goalrating_ctf_ourstolenflag(40000);
@@ -404,7 +404,7 @@ void havocbot_role_ctf_offense()
 
        if (self.bot_strategytime < time)
        {
-               self.bot_strategytime = time + cvar("bot_ai_strategyinterval");
+               self.bot_strategytime = time + autocvar_bot_ai_strategyinterval;
                navigation_goalrating_start();
                havocbot_goalrating_ctf_ourstolenflag(50000);
                havocbot_goalrating_ctf_enemybase(20000);
@@ -453,7 +453,7 @@ void havocbot_role_ctf_retriever()
                local float radius;
                radius = 10000;
 
-               self.bot_strategytime = time + cvar("bot_ai_strategyinterval");
+               self.bot_strategytime = time + autocvar_bot_ai_strategyinterval;
                navigation_goalrating_start();
                havocbot_goalrating_ctf_ourstolenflag(50000);
                havocbot_goalrating_ctf_droppedflags(40000, self.origin, radius);
@@ -502,7 +502,7 @@ void havocbot_role_ctf_middle()
                org = havocbot_ctf_middlepoint;
                org_z = self.origin_z;
 
-               self.bot_strategytime = time + cvar("bot_ai_strategyinterval");
+               self.bot_strategytime = time + autocvar_bot_ai_strategyinterval;
                navigation_goalrating_start();
                havocbot_goalrating_ctf_ourstolenflag(50000);
                havocbot_goalrating_ctf_droppedflags(30000, self.origin, 10000);
@@ -554,7 +554,7 @@ void havocbot_role_ctf_defense()
                org = mf.dropped_origin;
                radius = havocbot_ctf_middlepoint_radius;
 
-               self.bot_strategytime = time + cvar("bot_ai_strategyinterval");
+               self.bot_strategytime = time + autocvar_bot_ai_strategyinterval;
                navigation_goalrating_start();
 
                // if enemies are closer to our base, go there
index 7ac4a5fe66383d6d23d39aaeae12bb2075d32d41..8e30b37b5c569ce3f900f9b3e95934a0cef3acd3 100644 (file)
@@ -50,7 +50,7 @@ void havocbot_role_kh_carrier()
 
        if (self.bot_strategytime < time)
        {
-               self.bot_strategytime = time + cvar("bot_ai_strategyinterval");
+               self.bot_strategytime = time + autocvar_bot_ai_strategyinterval;
                navigation_goalrating_start();
 
                if(kh_Key_AllOwnedByWhichTeam() == self.team)
@@ -88,7 +88,7 @@ void havocbot_role_kh_defense()
        if (self.bot_strategytime < time)
        {
                float key_owner_team;
-               self.bot_strategytime = time + cvar("bot_ai_strategyinterval");
+               self.bot_strategytime = time + autocvar_bot_ai_strategyinterval;
                navigation_goalrating_start();
 
                key_owner_team = kh_Key_AllOwnedByWhichTeam();
@@ -130,7 +130,7 @@ void havocbot_role_kh_offense()
        {
                float key_owner_team;
 
-               self.bot_strategytime = time + cvar("bot_ai_strategyinterval");
+               self.bot_strategytime = time + autocvar_bot_ai_strategyinterval;
                navigation_goalrating_start();
 
                key_owner_team = kh_Key_AllOwnedByWhichTeam();
@@ -180,7 +180,7 @@ void havocbot_role_kh_freelancer()
        {
                float key_owner_team;
 
-               self.bot_strategytime = time + cvar("bot_ai_strategyinterval");
+               self.bot_strategytime = time + autocvar_bot_ai_strategyinterval;
                navigation_goalrating_start();
 
                key_owner_team = kh_Key_AllOwnedByWhichTeam();
index 3268daefa5a5ae601056dc02a1b6d6142ee3662f..af6eeb686d07537a54d956131e4385c17af66b52 100644 (file)
@@ -319,7 +319,7 @@ void havocbot_role_ons_offense()
                havocbot_goalrating_ons_offenseitems(10000, self.origin, 10000);
                navigation_goalrating_end();
 
-               self.bot_strategytime = time + cvar("bot_ai_strategyinterval");
+               self.bot_strategytime = time + autocvar_bot_ai_strategyinterval;
        }
 };
 
index 1e9231b6a12b853d211f69ee683ab2ae0b41c0e7..cfd0503985f5d2a39d25ea3dc606f49c9932da42 100644 (file)
@@ -112,7 +112,7 @@ void havocbot_goalrating_items(float ratingscale, vector org, float sradius)
 
                        // Rate the item only if no one needs it, or if an enemy is closer to it
                        if ( (enemy_distance < friend_distance && distance < enemy_distance) ||
-                               (friend_distance > cvar("bot_ai_friends_aware_pickup_radius") ) || !discard )
+                               (friend_distance > autocvar_bot_ai_friends_aware_pickup_radius ) || !discard )
                                rating = head.bot_pickupevalfunc(self, head);
 
                }
@@ -150,7 +150,7 @@ void havocbot_goalrating_enemyplayers(float ratingscale, vector org, float sradi
        local float t, noteam, distance;
        noteam = ((self.team == 0) || !teams_matter); // fteqcc sucks
 
-       if (cvar("bot_nofire"))
+       if (autocvar_bot_nofire)
                return;
 
        // don't chase players if we're under water
@@ -212,7 +212,7 @@ void havocbot_role_dom()
 
        if (self.bot_strategytime < time)
        {
-               self.bot_strategytime = time + cvar("bot_ai_strategyinterval");
+               self.bot_strategytime = time + autocvar_bot_ai_strategyinterval;
                navigation_goalrating_start();
                havocbot_goalrating_controlpoints(10000, self.origin, 15000);
                havocbot_goalrating_items(8000, self.origin, 8000);
@@ -231,7 +231,7 @@ void havocbot_role_dm()
 
        if (self.bot_strategytime < time)
        {
-               self.bot_strategytime = time + cvar("bot_ai_strategyinterval");
+               self.bot_strategytime = time + autocvar_bot_ai_strategyinterval;
                navigation_goalrating_start();
                havocbot_goalrating_items(10000, self.origin, 10000);
                havocbot_goalrating_enemyplayers(20000, self.origin, 10000);
@@ -251,7 +251,7 @@ void havocbot_role_race()
        entity e;
        if (self.bot_strategytime < time)
        {
-               self.bot_strategytime = time + cvar("bot_ai_strategyinterval");
+               self.bot_strategytime = time + autocvar_bot_ai_strategyinterval;
                navigation_goalrating_start();
                /*
                havocbot_goalrating_items(100, self.origin, 10000);
@@ -283,7 +283,7 @@ void havocbot_role_ka()
 
        if (self.bot_strategytime < time)
        {
-               self.bot_strategytime = time + cvar("bot_ai_strategyinterval");
+               self.bot_strategytime = time + autocvar_bot_ai_strategyinterval;
                navigation_goalrating_start();
                havocbot_goalrating_items(10000, self.origin, 10000);
                havocbot_goalrating_enemyplayers(20000, self.origin, 10000);
index cb6d16c3fc2d80e9482a54e98793c4831d80a44f..f3e5c26a8faf412d40aca941a619dddeb0f51e51 100644 (file)
@@ -653,8 +653,8 @@ void navigation_routerating(entity e, float f, float rangebias)
        // Evaluate path using jetpack
        if(g_jetpack)
        if(self.items & IT_JETPACK)
-       if(cvar("bot_ai_navigation_jetpack"))
-       if(vlen(self.origin - e.origin) > cvar("bot_ai_navigation_jetpack_mindistance"))
+       if(autocvar_bot_ai_navigation_jetpack)
+       if(vlen(self.origin - e.origin) > autocvar_bot_ai_navigation_jetpack_mindistance)
        {
                vector pointa, pointb;
 
@@ -706,9 +706,9 @@ void navigation_routerating(entity e, float f, float rangebias)
                        xydistance = vlen(pointa - pointb);
                        zdistance = fabs(pointa_z - self.origin_z);
 
-                       t = zdistance / cvar("g_jetpack_maxspeed_up");
-                       t += xydistance / cvar("g_jetpack_maxspeed_side");
-                       fuel = t * cvar("g_jetpack_fuel") * 0.8;
+                       t = zdistance / autocvar_g_jetpack_maxspeed_up;
+                       t += xydistance / autocvar_g_jetpack_maxspeed_side;
+                       fuel = t * autocvar_g_jetpack_fuel * 0.8;
 
                //      dprint("jetpack ai: required fuel ", ftos(fuel), " self.ammo_fuel ", ftos(self.ammo_fuel),"\n");
 
@@ -719,8 +719,8 @@ void navigation_routerating(entity e, float f, float rangebias)
                                // (as onground costs calculation is mostly based on distances, here we do the same establishing some relationship
                                //  - between air and ground speeds)
 
-                               cost = xydistance / (cvar("g_jetpack_maxspeed_side")/cvar("sv_maxspeed"));
-                               cost += zdistance / (cvar("g_jetpack_maxspeed_up")/cvar("sv_maxspeed"));
+                               cost = xydistance / (autocvar_g_jetpack_maxspeed_side/autocvar_sv_maxspeed);
+                               cost += zdistance / (autocvar_g_jetpack_maxspeed_up/autocvar_sv_maxspeed);
                                cost *= 1.5;
 
                                // Compare against other goals
index 196e3d7b6963d5ba34ac2e56b0ca679645360264..ef25a958d21f8908545ad4c51ba32dfb11754818 100644 (file)
@@ -868,14 +868,14 @@ float bot_presskeys()
                return FALSE;
 
        if(self.bot_cmd_keys & BOT_CMD_KEY_FORWARD)
-               self.movement_x = cvar("sv_maxspeed");
+               self.movement_x = autocvar_sv_maxspeed;
        else if(self.bot_cmd_keys & BOT_CMD_KEY_BACKWARD)
-               self.movement_x = -cvar("sv_maxspeed");
+               self.movement_x = -autocvar_sv_maxspeed;
 
        if(self.bot_cmd_keys & BOT_CMD_KEY_RIGHT)
-               self.movement_y = cvar("sv_maxspeed");
+               self.movement_y = autocvar_sv_maxspeed;
        else if(self.bot_cmd_keys & BOT_CMD_KEY_LEFT)
-               self.movement_y = -cvar("sv_maxspeed");
+               self.movement_y = -autocvar_sv_maxspeed;
 
        if(self.bot_cmd_keys & BOT_CMD_KEY_JUMP)
                self.BUTTON_JUMP = TRUE;
@@ -1269,7 +1269,7 @@ float bot_execute_commands_once()
        }
        else
        {
-               if(cvar("g_debug_bot_commands"))
+               if(autocvar_g_debug_bot_commands)
                {
                        local string parms;
 
index 4f3640e26eac35786e17dea56cdb15bdef6c97c7..b39e59f762343fe4d15e2aa7ed5fc7519e41f82a 100644 (file)
@@ -37,7 +37,7 @@ entity waypoint_spawn(vector m1, vector m2, float f)
                        }
                        else
                        {
-                               if(cvar("developer"))
+                               if(autocvar_developer)
                                {
                                        print("A generated waypoint is stuck in solid at ", vtos(w.origin), "\n");
                                        backtrace("Waypoint stuck");
@@ -50,7 +50,7 @@ entity waypoint_spawn(vector m1, vector m2, float f)
        waypoint_clearlinks(w);
        //waypoint_schedulerelink(w);
 
-       if (cvar("g_waypointeditor"))
+       if (autocvar_g_waypointeditor)
        {
                m1 = w.mins;
                m2 = w.maxs;
@@ -154,8 +154,8 @@ void waypoint_think()
        local entity e;
        local vector sv, sm1, sm2, ev, em1, em2, dv;
 
-       stepheightvec = cvar("sv_stepheight") * '0 0 1';
-       bot_navigation_movemode = ((cvar("bot_navigation_ignoreplayers")) ? MOVE_NOMONSTERS : MOVE_NORMAL);
+       stepheightvec = autocvar_sv_stepheight * '0 0 1';
+       bot_navigation_movemode = ((autocvar_bot_navigation_ignoreplayers) ? MOVE_NOMONSTERS : MOVE_NORMAL);
 
        //dprint("waypoint_think wpisbox = ", ftos(self.wpisbox), "\n");
        sm1 = self.origin + self.mins;
@@ -251,7 +251,7 @@ void waypoint_schedulerelink(entity wp)
        if (wp == world)
                return;
        // TODO: add some sort of visible box in edit mode for box waypoints
-       if (cvar("g_waypointeditor"))
+       if (autocvar_g_waypointeditor)
        {
                local vector m1, m2;
                m1 = wp.mins;
index 816f71bf9d683445d12195f54ec3b0c8bb4ae681..9a36546716d6dc644512e2536a1f449791be55c8 100644 (file)
@@ -69,8 +69,8 @@ void CampaignPreInit()
                CampaignBailout("JOLLY CHEATS AHAHAHAHAHAHAH))");
                return;
        }
-       campaign_level = cvar("_campaign_index");
-       campaign_name = strzone(cvar_string("_campaign_name"));
+       campaign_level = autocvar__campaign_index;
+       campaign_name = strzone(autocvar__campaign_name);
        campaign_index_var = strzone(strcat("g_campaign", campaign_name, "_index"));
        CampaignFile_Load(campaign_level, 2);
        if(campaign_entries < 1)
@@ -79,7 +79,7 @@ void CampaignPreInit()
                return;
        }
 
-       baseskill = cvar("g_campaign_skill");
+       baseskill = autocvar_g_campaign_skill;
        baseskill = baseskill + campaign_botskill[0];
        if(baseskill < 0)
                baseskill = 0;
@@ -101,7 +101,7 @@ void CampaignPreInit()
 
        // copy sv_gravity cvar, as the engine needs it too (sorry, this will mess
        // with the menu a little still...)
-       cvar_set_normal("sv_gravity", ftos(cvar("sv_gravity")));
+       cvar_set_normal("sv_gravity", ftos(autocvar_sv_gravity));
 
        if(Campaign_Invalid())
                return;
@@ -188,7 +188,7 @@ void CampaignPreIntermission()
 
        if(won == 1 && lost == 0 && checkrules_equality == 0 && cheatcount_total == 0)
        {
-               if(cvar("timelimit") != 0 && cvar("fraglimit") != 0 && time > cvar("timelimit") * 60) // checks if the timelimit has expired.
+               if(autocvar_timelimit != 0 && autocvar_fraglimit != 0 && time > autocvar_timelimit * 60) // checks if the timelimit has expired.
                {
                        campaign_won = 0;
                        bprint("Time's up! The current level has been LOST.\n");
@@ -201,7 +201,7 @@ void CampaignPreIntermission()
                        // sound!
                }
        }
-       else if(cvar("timelimit") != 0 && time > cvar("timelimit") * 60)
+       else if(autocvar_timelimit != 0 && time > autocvar_timelimit * 60)
        {
                campaign_won = 0;
                bprint("Time's up! The current level has been LOST.\n");
index 1bb39dfe0195dc71f9eeb43966db00cbe1fe6f66..fc54d49148835d9ed584c1632866f22ccaedc1f4 100644 (file)
@@ -28,7 +28,7 @@ float gamestart_sv_cheats;
 
 void CheatInit()
 {
-       gamestart_sv_cheats = cvar("sv_cheats");
+       gamestart_sv_cheats = autocvar_sv_cheats;
 }
 
 void CheatShutdown()
@@ -180,10 +180,10 @@ float CheatImpulse(float i)
                                        self.health = start_health;
                                        self.armorvalue = start_armorvalue;
                                        self.weapons |= weaponsInMap;
-                                       self.pauserotarmor_finished = time + cvar("g_balance_pause_armor_rot_spawn");
-                                       self.pauserothealth_finished = time + cvar("g_balance_pause_health_rot_spawn");
-                                       self.pauserotfuel_finished = time + cvar("g_balance_pause_fuel_rot_spawn");
-                                       self.pauseregen_finished = time + cvar("g_balance_pause_health_regen_spawn");
+                                       self.pauserotarmor_finished = time + autocvar_g_balance_pause_armor_rot_spawn;
+                                       self.pauserothealth_finished = time + autocvar_g_balance_pause_health_rot_spawn;
+                                       self.pauserotfuel_finished = time + autocvar_g_balance_pause_fuel_rot_spawn;
+                                       self.pauseregen_finished = time + autocvar_g_balance_pause_health_regen_spawn;
                                        self.strength_finished = 0;
                                        self.invincible_finished = 0;
                                }
@@ -606,7 +606,7 @@ float CheatCommand(float argc)
                        break;
                case "warp":
                        IS_CHEAT(0, argc, 0);
-                       if(argc == 2) if(cvar("g_campaign"))
+                       if(argc == 2) if(autocvar_g_campaign)
                        {
                                CampaignLevelWarp(stof(argv(1)));
                                DID_CHEAT();
index 3a416375b3874eb41a6593fb8933e9a5813bb4d6..430913466f1475f01db7c449f3a25f14bb753aba 100644 (file)
@@ -10,7 +10,7 @@ void send_CSQC_cr_maxbullets(entity e) {
        msg_entity = e;
        WriteByte(MSG_ONE, SVC_TEMPENTITY);
        WriteByte(MSG_ONE, TE_CSQC_CR_MAXBULLETS);
-       WriteByte(MSG_ONE, cvar("g_balance_campingrifle_magazinecapacity"));
+       WriteByte(MSG_ONE, autocvar_g_balance_campingrifle_magazinecapacity);
 }
 
 void Announce(string snd) {
@@ -242,7 +242,7 @@ entity Spawn_FilterOutBadSpots(entity firstspot, entity playerlist, float mindis
        {
                spot.spawnpoint_score = Spawn_Score(spot, playerlist, teamcheck, anypoint);
 
-               if(cvar("spawn_debugview"))
+               if(autocvar_spawn_debugview)
                {
                        setmodel(spot, "models/runematch/rune.mdl");
                        if(spot.spawnpoint_score_y < mindist)
@@ -364,13 +364,13 @@ entity SelectSpawnPoint (float anypoint)
                                firstspot = firstspot_new;
                        spot = Spawn_WeightedPoint(firstspot, 1, 1, 1);
                }
-               else if (random() > cvar("g_spawn_furthest"))
+               else if (random() > autocvar_g_spawn_furthest)
                        spot = Spawn_WeightedPoint(firstspot, 1, 1, 1);
                else
                        spot = Spawn_WeightedPoint(firstspot, 1, 5000, 5); // chooses a far far away spawnpoint
        }
 
-       if(cvar("spawn_debugview"))
+       if(autocvar_spawn_debugview)
        {
                print("spot mindistance: ", vtos(spot.spawnpoint_score), "\n");
 
@@ -383,7 +383,7 @@ entity SelectSpawnPoint (float anypoint)
 
        if (!spot)
        {
-               if(cvar("spawn_debug"))
+               if(autocvar_spawn_debug)
                        GotoNextMap();
                else
                {
@@ -418,7 +418,7 @@ string CheckPlayerModel(string plyermodel) {
                return FallbackPlayerModel;
        if( substring(plyermodel,0,14) != "models/player/")
                return FallbackPlayerModel;
-       else if(cvar("sv_servermodelsonly"))
+       else if(autocvar_sv_servermodelsonly)
        {
                if(substring(plyermodel,-4,4) != ".zym")
                if(substring(plyermodel,-4,4) != ".dpm")
@@ -650,7 +650,7 @@ void PutObserverInServer (void)
        self.flags = FL_CLIENT | FL_NOTARGET;
        self.armorvalue = 666;
        self.effects = 0;
-       self.armorvalue = cvar("g_balance_armor_start");
+       self.armorvalue = autocvar_g_balance_armor_start;
        self.pauserotarmor_finished = 0;
        self.pauserothealth_finished = 0;
        self.pauseregen_finished = 0;
@@ -741,7 +741,7 @@ void FixPlayermodel()
 
        defaultmodel = "";
 
-       if(cvar("sv_defaultcharacter") == 1) {
+       if(autocvar_sv_defaultcharacter == 1) {
                defaultskin = 0;
 
                if(teams_matter)
@@ -757,8 +757,8 @@ void FixPlayermodel()
 
                if(defaultmodel == "")
                {
-                       defaultmodel = cvar_string("sv_defaultplayermodel");
-                       defaultskin = cvar("sv_defaultplayerskin");
+                       defaultmodel = autocvar_sv_defaultplayermodel;
+                       defaultskin = autocvar_sv_defaultplayerskin;
                }
        }
 
@@ -801,9 +801,9 @@ void FixPlayermodel()
                self.species = player_getspecies(); // model or skin has changed
 
        if(!teams_matter)
-               if(strlen(cvar_string("sv_defaultplayercolors")))
-                       if(self.clientcolors != stof(cvar_string("sv_defaultplayercolors")))
-                               setcolor(self, stof(cvar_string("sv_defaultplayercolors")));
+               if(strlen(autocvar_sv_defaultplayercolors))
+                       if(self.clientcolors != stof(autocvar_sv_defaultplayercolors))
+                               setcolor(self, stof(autocvar_sv_defaultplayercolors));
 }
 
 void PlayerTouchExplode(entity p1, entity p2)
@@ -883,9 +883,9 @@ void PutClientInServer (void)
                self.movetype = MOVETYPE_WALK;
                self.solid = SOLID_SLIDEBOX;
                self.dphitcontentsmask = DPCONTENTS_BODY | DPCONTENTS_SOLID;
-               if(cvar("g_playerclip_collisions"))
+               if(autocvar_g_playerclip_collisions)
                        self.dphitcontentsmask |= DPCONTENTS_PLAYERCLIP;
-               if(clienttype(self) == CLIENTTYPE_BOT && cvar("g_botclip_collisions"))
+               if(clienttype(self) == CLIENTTYPE_BOT && autocvar_g_botclip_collisions)
                        self.dphitcontentsmask |= DPCONTENTS_BOTCLIP;
                self.frags = FRAGS_PLAYER;
                if(independent_players)
@@ -898,11 +898,11 @@ void PutClientInServer (void)
                        self.effects = 0;
                self.air_finished = time + 12;
                self.dmg = 2;
-               if(cvar("g_balance_nex_charge"))
+               if(autocvar_g_balance_nex_charge)
                {
-                       if(cvar("g_balance_nex_secondary_chargepool"))
+                       if(autocvar_g_balance_nex_secondary_chargepool)
                                self.nex_chargepool_ammo = 1;
-                       self.nex_charge = cvar("g_balance_nex_charge_start");
+                       self.nex_charge = autocvar_g_balance_nex_charge_start;
                }
 
                if(inWarmupStage)
@@ -940,13 +940,13 @@ void PutClientInServer (void)
                self.items = start_items;
                self.jump_interval = time;
 
-               self.spawnshieldtime = time + cvar("g_spawnshieldtime");
-               self.pauserotarmor_finished = time + cvar("g_balance_pause_armor_rot_spawn");
-               self.pauserothealth_finished = time + cvar("g_balance_pause_health_rot_spawn");
-               self.pauserotfuel_finished = time + cvar("g_balance_pause_fuel_rot_spawn");
-               self.pauseregen_finished = time + cvar("g_balance_pause_health_regen_spawn");
+               self.spawnshieldtime = time + autocvar_g_spawnshieldtime;
+               self.pauserotarmor_finished = time + autocvar_g_balance_pause_armor_rot_spawn;
+               self.pauserothealth_finished = time + autocvar_g_balance_pause_health_rot_spawn;
+               self.pauserotfuel_finished = time + autocvar_g_balance_pause_fuel_rot_spawn;
+               self.pauseregen_finished = time + autocvar_g_balance_pause_health_regen_spawn;
                //extend the pause of rotting if client was reset at the beginning of the countdown
-               if(!cvar("sv_ready_restart_after_countdown") && time < game_starttime) { // TODO why is this cvar NOTted?
+               if(!autocvar_sv_ready_restart_after_countdown && time < game_starttime) { // TODO why is this cvar NOTted?
                        self.spawnshieldtime += game_starttime - time;
                        self.pauserotarmor_finished += game_starttime - time;
                        self.pauserothealth_finished += game_starttime - time;
@@ -968,7 +968,7 @@ void PutClientInServer (void)
                self.nextthink = 0;
                self.hook_time = 0;
                self.dmg_team = 0;
-               self.ballistics_density = cvar("g_ballistics_density_player");
+               self.ballistics_density = autocvar_g_ballistics_density_player;
 
                self.metertime = 0;
 
@@ -1034,16 +1034,16 @@ void PutClientInServer (void)
 
                CL_SpawnWeaponentity();
                self.alpha = default_player_alpha;
-               self.colormod = '1 1 1' * cvar("g_player_brightness");
+               self.colormod = '1 1 1' * autocvar_g_player_brightness;
                self.exteriorweaponentity.alpha = default_weapon_alpha;
 
-               self.lms_nextcheck = time + cvar("g_lms_campcheck_interval")*2;
+               self.lms_nextcheck = time + autocvar_g_lms_campcheck_interval*2;
                self.lms_traveled_distance = 0;
                self.speedrunning = FALSE;
 
                race_PostSpawn(spot);
 
-               if(cvar("spawn_debug"))
+               if(autocvar_spawn_debug)
                {
                        sprint(self, strcat("spawnpoint origin:  ", vtos(spot.origin), "\n"));
                        remove(spot);   // usefull for checking if there are spawnpoints, that let drop through the floor
@@ -1052,7 +1052,7 @@ void PutClientInServer (void)
                //stuffcmd(self, "chase_active 0");
                //stuffcmd(self, "set viewsize $tmpviewsize \n");
 
-               if (cvar("g_spawnsound"))
+               if (autocvar_g_spawnsound)
                        sound (self, CHAN_TRIGGER, "misc/spawn.wav", VOL_BASE, ATTN_NORM);
 
                if(g_assault) {
@@ -1120,8 +1120,8 @@ float ClientInit_SendEntity(entity to, float sf)
        WriteCoord(MSG_ENTITY, self.bouncestop); // g_balance_grenadelauncher_bouncestop
        WriteCoord(MSG_ENTITY, self.ebouncefactor); // g_balance_grenadelauncher_bouncefactor
        WriteCoord(MSG_ENTITY, self.ebouncestop); // g_balance_grenadelauncher_bouncestop
-       WriteByte(MSG_ENTITY, cvar("g_balance_nex_secondary")); // client has to know if it should zoom or not
-       WriteByte(MSG_ENTITY, cvar("g_balance_campingrifle_secondary")); // client has to know if it should zoom or not
+       WriteByte(MSG_ENTITY, autocvar_g_balance_nex_secondary); // client has to know if it should zoom or not
+       WriteByte(MSG_ENTITY, autocvar_g_balance_campingrifle_secondary); // client has to know if it should zoom or not
        WriteByte(MSG_ENTITY, serverflags); // client has to know if it should zoom or not
        return TRUE;
 }
@@ -1129,34 +1129,34 @@ float ClientInit_SendEntity(entity to, float sf)
 void ClientInit_CheckUpdate()
 {
        self.nextthink = time;
-       if(self.count != cvar("g_balance_armor_blockpercent"))
+       if(self.count != autocvar_g_balance_armor_blockpercent)
        {
-               self.count = cvar("g_balance_armor_blockpercent");
+               self.count = autocvar_g_balance_armor_blockpercent;
                self.SendFlags |= 1;
        }
-       if(self.cnt != cvar("g_balance_weaponswitchdelay"))
+       if(self.cnt != autocvar_g_balance_weaponswitchdelay)
        {
-               self.cnt = cvar("g_balance_weaponswitchdelay");
+               self.cnt = autocvar_g_balance_weaponswitchdelay;
                self.SendFlags |= 1;
        }
-       if(self.bouncefactor != cvar("g_balance_grenadelauncher_bouncefactor"))
+       if(self.bouncefactor != autocvar_g_balance_grenadelauncher_bouncefactor)
        {
-               self.bouncefactor = cvar("g_balance_grenadelauncher_bouncefactor");
+               self.bouncefactor = autocvar_g_balance_grenadelauncher_bouncefactor;
                self.SendFlags |= 1;
        }
-       if(self.bouncestop != cvar("g_balance_grenadelauncher_bouncestop"))
+       if(self.bouncestop != autocvar_g_balance_grenadelauncher_bouncestop)
        {
-               self.bouncestop = cvar("g_balance_grenadelauncher_bouncestop");
+               self.bouncestop = autocvar_g_balance_grenadelauncher_bouncestop;
                self.SendFlags |= 1;
        }
-       if(self.ebouncefactor != cvar("g_balance_electro_secondary_bouncefactor"))
+       if(self.ebouncefactor != autocvar_g_balance_electro_secondary_bouncefactor)
        {
-               self.ebouncefactor = cvar("g_balance_electro_secondary_bouncefactor");
+               self.ebouncefactor = autocvar_g_balance_electro_secondary_bouncefactor;
                self.SendFlags |= 1;
        }
-       if(self.ebouncestop != cvar("g_balance_electro_secondary_bouncestop"))
+       if(self.ebouncestop != autocvar_g_balance_electro_secondary_bouncestop)
        {
-               self.ebouncestop = cvar("g_balance_electro_secondary_bouncestop");
+               self.ebouncestop = autocvar_g_balance_electro_secondary_bouncestop;
                self.SendFlags |= 1;
        }
 }
@@ -1290,7 +1290,7 @@ void ClientKill_TeamChange (float targetteam) // 0 = don't change, -1 = auto
 {
        float killtime;
        entity e;
-       killtime = cvar("g_balance_kill_delay");
+       killtime = autocvar_g_balance_kill_delay;
 
        if(g_race_qualifying)
                killtime = 0;
@@ -1426,25 +1426,25 @@ void FixClientCvars(entity e)
        stuffcmd(e, "\nin_bindmap 0 0\n");
        if(g_race || g_cts)
                stuffcmd(e, "cl_cmd settemp cl_movecliptokeyboard 2\n");
-       if(cvar("g_antilag") == 3) // client side hitscan
+       if(autocvar_g_antilag == 3) // client side hitscan
                stuffcmd(e, "cl_cmd settemp cl_prydoncursor_notrace 0\n");
        if(sv_gentle)
                stuffcmd(e, "cl_cmd settemp cl_gentle 1\n");
        /*
         * we no longer need to stuff this. Remove this comment block if you feel
         * 2.3 and higher (or was it 2.2.3?) don't need these any more
-       stuffcmd(e, strcat("cl_gravity ", ftos(cvar("sv_gravity")), "\n"));
-       stuffcmd(e, strcat("cl_movement_accelerate ", ftos(cvar("sv_accelerate")), "\n"));
-       stuffcmd(e, strcat("cl_movement_friction ", ftos(cvar("sv_friction")), "\n"));
-       stuffcmd(e, strcat("cl_movement_maxspeed ", ftos(cvar("sv_maxspeed")), "\n"));
-       stuffcmd(e, strcat("cl_movement_airaccelerate ", ftos(cvar("sv_airaccelerate")), "\n"));
-       stuffcmd(e, strcat("cl_movement_maxairspeed ", ftos(cvar("sv_maxairspeed")), "\n"));
-       stuffcmd(e, strcat("cl_movement_stopspeed ", ftos(cvar("sv_stopspeed")), "\n"));
-       stuffcmd(e, strcat("cl_movement_jumpvelocity ", ftos(cvar("sv_jumpvelocity")), "\n"));
-       stuffcmd(e, strcat("cl_movement_stepheight ", ftos(cvar("sv_stepheight")), "\n"));
-       stuffcmd(e, strcat("set cl_movement_friction_on_land ", ftos(cvar("sv_friction_on_land")), "\n"));
-       stuffcmd(e, strcat("set cl_movement_airaccel_qw ", ftos(cvar("sv_airaccel_qw")), "\n"));
-       stuffcmd(e, strcat("set cl_movement_airaccel_sideways_friction ", ftos(cvar("sv_airaccel_sideways_friction")), "\n"));
+       stuffcmd(e, strcat("cl_gravity ", ftos(autocvar_sv_gravity), "\n"));
+       stuffcmd(e, strcat("cl_movement_accelerate ", ftos(autocvar_sv_accelerate), "\n"));
+       stuffcmd(e, strcat("cl_movement_friction ", ftos(autocvar_sv_friction), "\n"));
+       stuffcmd(e, strcat("cl_movement_maxspeed ", ftos(autocvar_sv_maxspeed), "\n"));
+       stuffcmd(e, strcat("cl_movement_airaccelerate ", ftos(autocvar_sv_airaccelerate), "\n"));
+       stuffcmd(e, strcat("cl_movement_maxairspeed ", ftos(autocvar_sv_maxairspeed), "\n"));
+       stuffcmd(e, strcat("cl_movement_stopspeed ", ftos(autocvar_sv_stopspeed), "\n"));
+       stuffcmd(e, strcat("cl_movement_jumpvelocity ", ftos(autocvar_sv_jumpvelocity), "\n"));
+       stuffcmd(e, strcat("cl_movement_stepheight ", ftos(autocvar_sv_stepheight), "\n"));
+       stuffcmd(e, strcat("set cl_movement_friction_on_land ", ftos(autocvar_sv_friction_on_land), "\n"));
+       stuffcmd(e, strcat("set cl_movement_airaccel_qw ", ftos(autocvar_sv_airaccel_qw), "\n"));
+       stuffcmd(e, strcat("set cl_movement_airaccel_sideways_friction ", ftos(autocvar_sv_airaccel_sideways_friction), "\n"));
        stuffcmd(e, "cl_movement_edgefriction 1\n");
         */
 }
@@ -1527,25 +1527,25 @@ void ClientConnect (void)
        //      dom_player_join_team(self);
 
        // identify the right forced team
-       if(PlayerInIDList(self, cvar_string("g_forced_team_red")))
+       if(PlayerInIDList(self, autocvar_g_forced_team_red))
                self.team_forced = COLOR_TEAM1;
-       else if(PlayerInIDList(self, cvar_string("g_forced_team_blue")))
+       else if(PlayerInIDList(self, autocvar_g_forced_team_blue))
                self.team_forced = COLOR_TEAM2;
-       else if(PlayerInIDList(self, cvar_string("g_forced_team_yellow")))
+       else if(PlayerInIDList(self, autocvar_g_forced_team_yellow))
                self.team_forced = COLOR_TEAM3;
-       else if(PlayerInIDList(self, cvar_string("g_forced_team_pink")))
+       else if(PlayerInIDList(self, autocvar_g_forced_team_pink))
                self.team_forced = COLOR_TEAM4;
-       else if(cvar_string("g_forced_team_otherwise") == "red")
+       else if(autocvar_g_forced_team_otherwise == "red")
                self.team_forced = COLOR_TEAM1;
-       else if(cvar_string("g_forced_team_otherwise") == "blue")
+       else if(autocvar_g_forced_team_otherwise == "blue")
                self.team_forced = COLOR_TEAM2;
-       else if(cvar_string("g_forced_team_otherwise") == "yellow")
+       else if(autocvar_g_forced_team_otherwise == "yellow")
                self.team_forced = COLOR_TEAM3;
-       else if(cvar_string("g_forced_team_otherwise") == "pink")
+       else if(autocvar_g_forced_team_otherwise == "pink")
                self.team_forced = COLOR_TEAM4;
-       else if(cvar_string("g_forced_team_otherwise") == "spectate")
+       else if(autocvar_g_forced_team_otherwise == "spectate")
                self.team_forced = -1;
-       else if(cvar_string("g_forced_team_otherwise") == "spectator")
+       else if(autocvar_g_forced_team_otherwise == "spectator")
                self.team_forced = -1;
        else
                self.team_forced = 0;
@@ -1556,12 +1556,12 @@ void ClientConnect (void)
 
        JoinBestTeam(self, FALSE, FALSE); // if the team number is valid, keep it
 
-       if((cvar("sv_spectate") == 1 && !g_lms) || cvar("g_campaign") || self.team_forced < 0) {
+       if((autocvar_sv_spectate == 1 && !g_lms) || autocvar_g_campaign || self.team_forced < 0) {
                self.classname = "observer";
        } else {
                if(teams_matter)
                {
-                       if(cvar("g_balance_teams") || cvar("g_balance_teams_force"))
+                       if(autocvar_g_balance_teams || autocvar_g_balance_teams_force)
                        {
                                self.classname = "player";
                                campaign_bots_may_start = 1;
@@ -1580,7 +1580,7 @@ void ClientConnect (void)
 
        self.playerid = (playerid_last = playerid_last + 1);
 
-       if(cvar("sv_eventlog"))
+       if(autocvar_sv_eventlog)
                GameLogEcho(strcat(":join:", ftos(self.playerid), ":", ftos(num_for_edict(self)), ":", ((clienttype(self) == CLIENTTYPE_REAL) ? self.netaddress : "bot"), ":", self.netname));
 
        LogTeamchange(self.playerid, self.team, 1);
@@ -1650,15 +1650,15 @@ void ClientConnect (void)
        self.spectatortime = time;
        if(blockSpectators)
        {
-               sprint(self, strcat("^7You have to become a player within the next ", ftos(cvar("g_maxplayers_spectator_blocktime")), " seconds, otherwise you will be kicked, because spectators aren't allowed at this time!\n"));
+               sprint(self, strcat("^7You have to become a player within the next ", ftos(autocvar_g_maxplayers_spectator_blocktime), " seconds, otherwise you will be kicked, because spectators aren't allowed at this time!\n"));
        }
 
        self.jointime = time;
-       self.allowedTimeouts = cvar("sv_timeout_number");
+       self.allowedTimeouts = autocvar_sv_timeout_number;
 
        if(clienttype(self) == CLIENTTYPE_REAL)
        {
-               if(cvar("g_bugrigs") || g_weaponarena == WEPBIT_TUBA)
+               if(autocvar_g_bugrigs || g_weaponarena == WEPBIT_TUBA)
                        stuffcmd(self, "cl_cmd settemp chase_active 1\n");
        }
 
@@ -1676,7 +1676,7 @@ void ClientConnect (void)
 
        SoundEntity_Attach(self);
 
-       if(cvar("g_hitplots") || strstrofs(strcat(" ", cvar_string("g_hitplots_individuals"), " "), strcat(" ", self.netaddress, " "), 0) >= 0)
+       if(autocvar_g_hitplots || strstrofs(strcat(" ", autocvar_g_hitplots_individuals, " "), strcat(" ", self.netaddress, " "), 0) >= 0)
        {
                self.hitplotfh = fopen(strcat("hits-", matchid, "-", self.netaddress, "-", ftos(self.playerid), ".plot"), FILE_WRITE);
                fputs(self.hitplotfh, strcat("#name ", self.netname, "\n"));
@@ -1705,7 +1705,7 @@ void ClientConnect (void)
                        race_SendRankings(i, 0, 0, MSG_ONE);
                }
        }
-       else if(cvar("sv_teamnagger") && !(cvar("bot_vs_human") && (c3==-1 && c4==-1)) && !g_ca) // teamnagger is currently bad for ca
+       else if(autocvar_sv_teamnagger && !(autocvar_bot_vs_human && (c3==-1 && c4==-1)) && !g_ca) // teamnagger is currently bad for ca
                send_CSQC_teamnagger();
 
        send_CSQC_cr_maxbullets(self);
@@ -1753,7 +1753,7 @@ void ClientDisconnect (void)
        if(self.entcs)
                detach_entcs();
 
-       if(cvar("sv_eventlog"))
+       if(autocvar_sv_eventlog)
                GameLogEcho(strcat(":part:", ftos(self.playerid)));
        bprint ("^4",self.netname);
        bprint ("^4 disconnected\n");
@@ -1925,19 +1925,19 @@ void UpdateTeamBubble()
 .float oldcolormap;
 void respawn(void)
 {
-       if(self.modelindex != 0 && cvar("g_respawn_ghosts"))
+       if(self.modelindex != 0 && autocvar_g_respawn_ghosts)
        {
                self.solid = SOLID_NOT;
                self.takedamage = DAMAGE_NO;
                self.movetype = MOVETYPE_FLY;
-               self.velocity = '0 0 1' * cvar("g_respawn_ghosts_speed");
-               self.avelocity = randomvec() * cvar("g_respawn_ghosts_speed") * 3 - randomvec() * cvar("g_respawn_ghosts_speed") * 3;
+               self.velocity = '0 0 1' * autocvar_g_respawn_ghosts_speed;
+               self.avelocity = randomvec() * autocvar_g_respawn_ghosts_speed * 3 - randomvec() * autocvar_g_respawn_ghosts_speed * 3;
                self.effects |= EF_ADDITIVE;
                self.oldcolormap = self.colormap;
                self.colormap = 512;
                pointparticles(particleeffectnum("respawn_ghost"), self.origin, '0 0 0', 1);
-               if(cvar("g_respawn_ghosts_maxtime"))
-                       SUB_SetFade (self, time + cvar("g_respawn_ghosts_maxtime") / 2 + random () * (cvar("g_respawn_ghosts_maxtime") - cvar("g_respawn_ghosts_maxtime") / 2), 1.5);
+               if(autocvar_g_respawn_ghosts_maxtime)
+                       SUB_SetFade (self, time + autocvar_g_respawn_ghosts_maxtime / 2 + random () * (autocvar_g_respawn_ghosts_maxtime - autocvar_g_respawn_ghosts_maxtime / 2), 1.5);
        }
 
        CopyBody(1);
@@ -1965,7 +1965,7 @@ void play_countdown(float finished, string samp)
  * @param addOneSecond boolean, set to 1 if the welcome-message centerprint asks for the text
  */
 string getTimeoutText(float addOneSecond) {
-       if (!cvar("sv_timeout") || !timeoutStatus)
+       if (!autocvar_sv_timeout || !timeoutStatus)
                return "";
 
        local string retStr;
@@ -2006,7 +2006,7 @@ void player_powerups (void)
        
        if((self.items & IT_USING_JETPACK) && !self.deadflag)
        {
-               SoundEntity_StartSound(self, CHAN_PLAYER, "misc/jetpack_fly.wav", VOL_BASE, cvar("g_jetpack_attenuation"));
+               SoundEntity_StartSound(self, CHAN_PLAYER, "misc/jetpack_fly.wav", VOL_BASE, autocvar_g_jetpack_attenuation);
                self.modelflags |= MF_ROCKET;
        }
        else
@@ -2052,7 +2052,7 @@ void player_powerups (void)
                if (self.items & IT_INVINCIBLE)
                {
                        play_countdown(self.invincible_finished, "misc/poweroff.wav");
-                       if (time > self.invincible_finished && cvar("g_balance_powerup_timer"))
+                       if (time > self.invincible_finished && autocvar_g_balance_powerup_timer)
                        {
                                self.items = self.items - (self.items & IT_INVINCIBLE);
                                sprint(self, "^3Speed has worn off\n");
@@ -2073,7 +2073,7 @@ void player_powerups (void)
                {
                        play_countdown(self.strength_finished, "misc/poweroff.wav");
                        self.effects = self.effects | (EF_BLUE | EF_ADDITIVE | EF_FULLBRIGHT);
-                       if (time > self.strength_finished && cvar("g_balance_powerup_timer"))
+                       if (time > self.strength_finished && autocvar_g_balance_powerup_timer)
                        {
                                self.items = self.items - (self.items & IT_STRENGTH);
                                sprint(self, "^3Strength has worn off\n");
@@ -2091,7 +2091,7 @@ void player_powerups (void)
                {
                        play_countdown(self.invincible_finished, "misc/poweroff.wav");
                        self.effects = self.effects | (EF_RED | EF_ADDITIVE | EF_FULLBRIGHT);
-                       if (time > self.invincible_finished && cvar("g_balance_powerup_timer"))
+                       if (time > self.invincible_finished && autocvar_g_balance_powerup_timer)
                        {
                                self.items = self.items - (self.items & IT_INVINCIBLE);
                                sprint(self, "^3Shield has worn off\n");
@@ -2106,10 +2106,10 @@ void player_powerups (void)
                        }
                }
 
-               if(cvar("g_nodepthtestplayers"))
+               if(autocvar_g_nodepthtestplayers)
                        self.effects = self.effects | EF_NODEPTHTEST;
 
-               if(cvar("g_fullbrightplayers"))
+               if(autocvar_g_fullbrightplayers)
                        self.effects = self.effects | EF_FULLBRIGHT;
 
                // midair gamemode: damage only while in the air
@@ -2119,7 +2119,7 @@ void player_powerups (void)
                // remaining hits in the same frame)
                if (self.flags & FL_ONGROUND)
                if (g_midair)
-                       self.spawnshieldtime = max(self.spawnshieldtime, time + cvar("g_midair_shieldtime"));
+                       self.spawnshieldtime = max(self.spawnshieldtime, time + autocvar_g_midair_shieldtime);
 
                if (time >= game_starttime)
                if (time < self.spawnshieldtime)
@@ -2177,15 +2177,15 @@ float CalcRotRegen(float current, float regenstable, float regenfactor, float re
 void player_regen (void)
 {
        float minh, mina, minf, maxh, maxa, maxf, limith, limita, limitf, max_mod, regen_mod, rot_mod, limit_mod;
-       maxh = cvar("g_balance_health_rotstable");
-       maxa = cvar("g_balance_armor_rotstable");
-       maxf = cvar("g_balance_fuel_rotstable");
-       minh = cvar("g_balance_health_regenstable");
-       mina = cvar("g_balance_armor_regenstable");
-       minf = cvar("g_balance_fuel_regenstable");
-       limith = cvar("g_balance_health_limit");
-       limita = cvar("g_balance_armor_limit");
-       limitf = cvar("g_balance_fuel_limit");
+       maxh = autocvar_g_balance_health_rotstable;
+       maxa = autocvar_g_balance_armor_rotstable;
+       maxf = autocvar_g_balance_fuel_rotstable;
+       minh = autocvar_g_balance_health_regenstable;
+       mina = autocvar_g_balance_armor_regenstable;
+       minf = autocvar_g_balance_fuel_regenstable;
+       limith = autocvar_g_balance_health_limit;
+       limita = autocvar_g_balance_armor_limit;
+       limitf = autocvar_g_balance_fuel_limit;
 
        max_mod = regen_mod = rot_mod = limit_mod = 1;
 
@@ -2193,27 +2193,27 @@ void player_regen (void)
        {
                if (self.runes & CURSE_VENOM) // do we have both rune/curse?
                {
-                       regen_mod = cvar("g_balance_rune_regen_combo_regenrate");
-                       max_mod = cvar("g_balance_rune_regen_combo_hpmod");
-                       limit_mod = cvar("g_balance_rune_regen_combo_limitmod");
+                       regen_mod = autocvar_g_balance_rune_regen_combo_regenrate;
+                       max_mod = autocvar_g_balance_rune_regen_combo_hpmod;
+                       limit_mod = autocvar_g_balance_rune_regen_combo_limitmod;
                }
                else
                {
-                       regen_mod = cvar("g_balance_rune_regen_regenrate");
-                       max_mod = cvar("g_balance_rune_regen_hpmod");
-                       limit_mod = cvar("g_balance_rune_regen_limitmod");
+                       regen_mod = autocvar_g_balance_rune_regen_regenrate;
+                       max_mod = autocvar_g_balance_rune_regen_hpmod;
+                       limit_mod = autocvar_g_balance_rune_regen_limitmod;
                }
        }
        else if (self.runes & CURSE_VENOM)
        {
-               max_mod = cvar("g_balance_curse_venom_hpmod");
+               max_mod = autocvar_g_balance_curse_venom_hpmod;
                if (self.runes & RUNE_REGEN) // do we have both rune/curse?
-                       rot_mod = cvar("g_balance_rune_regen_combo_rotrate");
+                       rot_mod = autocvar_g_balance_rune_regen_combo_rotrate;
                else
-                       rot_mod = cvar("g_balance_curse_venom_rotrate");
-               limit_mod = cvar("g_balance_curse_venom_limitmod");
+                       rot_mod = autocvar_g_balance_curse_venom_rotrate;
+               limit_mod = autocvar_g_balance_curse_venom_limitmod;
                //if (!self.runes & RUNE_REGEN)
-               //      rot_mod = cvar("g_balance_curse_venom_rotrate");
+               //      rot_mod = autocvar_g_balance_curse_venom_rotrate;
        }
        maxh = maxh * max_mod;
        //maxa = maxa * max_mod;
@@ -2228,10 +2228,10 @@ void player_regen (void)
        if(g_lms && g_ca)
                rot_mod = 0;
 
-       if (!g_minstagib && !g_ca && (!g_lms || cvar("g_lms_regenerate")))
+       if (!g_minstagib && !g_ca && (!g_lms || autocvar_g_lms_regenerate))
        {
-               self.armorvalue = CalcRotRegen(self.armorvalue, mina, cvar("g_balance_armor_regen"), cvar("g_balance_armor_regenlinear"), regen_mod * frametime * (time > self.pauseregen_finished), maxa, cvar("g_balance_armor_rot"), cvar("g_balance_armor_rotlinear"), rot_mod * frametime * (time > self.pauserotarmor_finished), limita);
-               self.health = CalcRotRegen(self.health, minh, cvar("g_balance_health_regen"), cvar("g_balance_health_regenlinear"), regen_mod * frametime * (time > self.pauseregen_finished), maxh, cvar("g_balance_health_rot"), cvar("g_balance_health_rotlinear"), rot_mod * frametime * (time > self.pauserothealth_finished), limith);
+               self.armorvalue = CalcRotRegen(self.armorvalue, mina, autocvar_g_balance_armor_regen, autocvar_g_balance_armor_regenlinear, regen_mod * frametime * (time > self.pauseregen_finished), maxa, autocvar_g_balance_armor_rot, autocvar_g_balance_armor_rotlinear, rot_mod * frametime * (time > self.pauserotarmor_finished), limita);
+               self.health = CalcRotRegen(self.health, minh, autocvar_g_balance_health_regen, autocvar_g_balance_health_regenlinear, regen_mod * frametime * (time > self.pauseregen_finished), maxh, autocvar_g_balance_health_rot, autocvar_g_balance_health_rotlinear, rot_mod * frametime * (time > self.pauserothealth_finished), limith);
 
                // if player rotted to death...  die!
                if(self.health < 1)
@@ -2239,7 +2239,7 @@ void player_regen (void)
        }
 
        if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
-               self.ammo_fuel = CalcRotRegen(self.ammo_fuel, minf, cvar("g_balance_fuel_regen"), cvar("g_balance_fuel_regenlinear"), regen_mod * frametime * (time > self.pauseregen_finished) * (self.items & IT_FUEL_REGEN != 0), maxf, cvar("g_balance_fuel_rot"), cvar("g_balance_fuel_rotlinear"), rot_mod * frametime * (time > self.pauserotfuel_finished), limitf);
+               self.ammo_fuel = CalcRotRegen(self.ammo_fuel, minf, autocvar_g_balance_fuel_regen, autocvar_g_balance_fuel_regenlinear, regen_mod * frametime * (time > self.pauseregen_finished) * (self.items & IT_FUEL_REGEN != 0), maxf, autocvar_g_balance_fuel_rot, autocvar_g_balance_fuel_rotlinear, rot_mod * frametime * (time > self.pauserotfuel_finished), limitf);
 }
 
 float zoomstate_set;
@@ -2411,13 +2411,13 @@ void ShowRespawnCountdown()
 void LeaveSpectatorMode()
 {
        if(isJoinAllowed()) {
-               if(!teams_matter || cvar("g_campaign") || cvar("g_balance_teams") || (self.wasplayer && cvar("g_changeteam_banned")) || self.team_forced > 0) {
+               if(!teams_matter || autocvar_g_campaign || autocvar_g_balance_teams || (self.wasplayer && autocvar_g_changeteam_banned) || self.team_forced > 0) {
                        self.classname = "player";
 
-                       if(cvar("g_campaign") || cvar("g_balance_teams") || cvar("g_balance_teams_force"))
+                       if(autocvar_g_campaign || autocvar_g_balance_teams || autocvar_g_balance_teams_force)
                                JoinBestTeam(self, FALSE, TRUE);
 
-                       if(cvar("g_campaign"))
+                       if(autocvar_g_campaign)
                                campaign_bots_may_start = 1;
 
                        PutClientInServer();
@@ -2425,7 +2425,7 @@ void LeaveSpectatorMode()
                        if(self.classname == "player")
                                bprint ("^4", self.netname, "^4 is playing now\n");
 
-                       if(!cvar("g_campaign"))
+                       if(!autocvar_g_campaign)
                                centerprint(self,""); // clear MOTD
 
                        return;
@@ -2453,7 +2453,7 @@ float isJoinAllowed() {
        if(self.team_forced < 0)
                return FALSE; // forced spectators can never join
 
-       if (!cvar("g_maxplayers"))
+       if (!autocvar_g_maxplayers)
                return TRUE;
 
        local entity e;
@@ -2462,7 +2462,7 @@ float isJoinAllowed() {
                if(e.classname == "player")
                        currentlyPlaying += 1;
        }
-       if(currentlyPlaying < cvar("g_maxplayers"))
+       if(currentlyPlaying < autocvar_g_maxplayers)
                return TRUE;
 
        return FALSE;
@@ -2474,7 +2474,7 @@ float isJoinAllowed() {
  */
 void checkSpectatorBlock() {
        if(self.classname == "spectator" || self.classname == "observer") {
-               if( time > (self.spectatortime + cvar("g_maxplayers_spectator_blocktime")) ) {
+               if( time > (self.spectatortime + autocvar_g_maxplayers_spectator_blocktime) ) {
                        sprint(self, "^7You were kicked from the server because you are spectator and spectators aren't allowed at the moment.\n");
                        dropclient(self);
                }
@@ -2565,8 +2565,8 @@ void() nexball_setstatus;
 void PlayerPreThink (void)
 {
        self.stat_game_starttime = game_starttime;
-       self.stat_allow_oldnexbeam = cvar("g_allow_oldnexbeam");
-       self.stat_leadlimit = cvar("leadlimit");
+       self.stat_allow_oldnexbeam = autocvar_g_allow_oldnexbeam;
+       self.stat_leadlimit = autocvar_leadlimit;
 
        if(frametime)
        {
@@ -2582,7 +2582,7 @@ void PlayerPreThink (void)
 
        if(self.netname_previous != self.netname)
        {
-               if(cvar("sv_eventlog"))
+               if(autocvar_sv_eventlog)
                        GameLogEcho(strcat(":name:", ftos(self.playerid), ":", self.netname));
                if(self.netname_previous)
                        strunzone(self.netname_previous);
@@ -2596,24 +2596,24 @@ void PlayerPreThink (void)
                        {
                                if(strstr(self.cvar_g_xonoticversion, "git", 0) < 0)
                                {
-                                       if(strstr(cvar_string("g_xonoticversion"), "git", 0) >= 0)
+                                       if(strstr(autocvar_g_xonoticversion, "git", 0) >= 0)
                                        {
-                                               dprint("^1NOTE^7 to ", self.netname, "^7 - the server is running ^3Xonotic ", cvar_string("g_xonoticversion"), " (beta)^7, you have ^3Xonotic ", self.cvar_g_xonoticversion, "^1\n");
-                                               sprint(self, strcat("\{1}^1NOTE: ^7the server is running ^3Xonotic ", cvar_string("g_xonoticversion"), " (beta)^7, you have ^3Xonotic ", self.cvar_g_xonoticversion, "^1\n"));
+                                               dprint("^1NOTE^7 to ", self.netname, "^7 - the server is running ^3Xonotic ", autocvar_g_xonoticversion, " (beta)^7, you have ^3Xonotic ", self.cvar_g_xonoticversion, "^1\n");
+                                               sprint(self, strcat("\{1}^1NOTE: ^7the server is running ^3Xonotic ", autocvar_g_xonoticversion, " (beta)^7, you have ^3Xonotic ", self.cvar_g_xonoticversion, "^1\n"));
                                        }
                                        else
                                        {
                                                float r;
-                                               r = vercmp(self.cvar_g_xonoticversion, cvar_string("g_xonoticversion"));
+                                               r = vercmp(self.cvar_g_xonoticversion, autocvar_g_xonoticversion);
                                                if(r < 0)
                                                {
-                                                       dprint("^1NOTE^7 to ", self.netname, "^7 - ^3Xonotic ", cvar_string("g_xonoticversion"), "^7 is out, and you still have ^3Xonotic ", self.cvar_g_xonoticversion, "^1 - get the update from ^4http://www.xonotic.com/^1!\n");
-                                                       sprint(self, strcat("\{1}^1NOTE: ^3Xonotic ", cvar_string("g_xonoticversion"), "^7 is out, and you still have ^3Xonotic ", self.cvar_g_xonoticversion, "^1 - get the update from ^4http://www.xonotic.com/^1!\n"));
+                                                       dprint("^1NOTE^7 to ", self.netname, "^7 - ^3Xonotic ", autocvar_g_xonoticversion, "^7 is out, and you still have ^3Xonotic ", self.cvar_g_xonoticversion, "^1 - get the update from ^4http://www.xonotic.com/^1!\n");
+                                                       sprint(self, strcat("\{1}^1NOTE: ^3Xonotic ", autocvar_g_xonoticversion, "^7 is out, and you still have ^3Xonotic ", self.cvar_g_xonoticversion, "^1 - get the update from ^4http://www.xonotic.com/^1!\n"));
                                                }
                                                else if(r > 0)
                                                {
-                                                       dprint("^1NOTE^7 to ", self.netname, "^7 - the server is running ^3Xonotic ", cvar_string("g_xonoticversion"), "^7, you have ^3Xonotic ", self.cvar_g_xonoticversion, "^1\n");
-                                                       sprint(self, strcat("\{1}^1NOTE: ^7the server is running ^3Xonotic ", cvar_string("g_xonoticversion"), "^7, you have ^3Xonotic ", self.cvar_g_xonoticversion, "^1\n"));
+                                                       dprint("^1NOTE^7 to ", self.netname, "^7 - the server is running ^3Xonotic ", autocvar_g_xonoticversion, "^7, you have ^3Xonotic ", self.cvar_g_xonoticversion, "^1\n");
+                                                       sprint(self, strcat("\{1}^1NOTE: ^7the server is running ^3Xonotic ", autocvar_g_xonoticversion, "^7, you have ^3Xonotic ", self.cvar_g_xonoticversion, "^1\n"));
                                                }
                                        }
                                }
@@ -2667,18 +2667,18 @@ void PlayerPreThink (void)
 
                if(frametime)
                {
-                       if(self.health <= 0 && cvar("g_deathglow"))
+                       if(self.health <= 0 && autocvar_g_deathglow)
                        {
                                if(self.glowmod_x > 0)
-                                       self.glowmod_x -= cvar("g_deathglow") * frametime;
+                                       self.glowmod_x -= autocvar_g_deathglow * frametime;
                                else
                                        self.glowmod_x = -1;
                                if(self.glowmod_y > 0)
-                                       self.glowmod_y -= cvar("g_deathglow") * frametime;
+                                       self.glowmod_y -= autocvar_g_deathglow * frametime;
                                else
                                        self.glowmod_y = -1;
                                if(self.glowmod_z > 0)
-                                       self.glowmod_z -= cvar("g_deathglow") * frametime;
+                                       self.glowmod_z -= autocvar_g_deathglow * frametime;
                                else
                                        self.glowmod_z = -1;
                        }
@@ -2704,7 +2704,7 @@ void PlayerPreThink (void)
                                if(frametime)
                                        player_anim();
                                button_pressed = (self.BUTTON_ATCK || self.BUTTON_JUMP || self.BUTTON_ATCK2 || self.BUTTON_HOOK || self.BUTTON_USE);
-                               force_respawn = (g_lms || (g_ca) || cvar("g_forced_respawn"));
+                               force_respawn = (g_lms || (g_ca) || autocvar_g_forced_respawn);
                                if (self.deadflag == DEAD_DYING)
                                {
                                        if(force_respawn)
@@ -2752,7 +2752,7 @@ void PlayerPreThink (void)
                        }
                }
 
-               if(g_lms && !self.deadflag && cvar("g_lms_campcheck_interval"))
+               if(g_lms && !self.deadflag && autocvar_g_lms_campcheck_interval)
                {
                        vector dist;
 
@@ -2761,23 +2761,23 @@ void PlayerPreThink (void)
                        dist_z = 0;
                        self.lms_traveled_distance += fabs(vlen(dist));
 
-                       if((cvar("g_campaign") && !campaign_bots_may_start) || (time < game_starttime))
+                       if((autocvar_g_campaign && !campaign_bots_may_start) || (time < game_starttime))
                        {
-                               self.lms_nextcheck = time + cvar("g_lms_campcheck_interval")*2;
+                               self.lms_nextcheck = time + autocvar_g_lms_campcheck_interval*2;
                                self.lms_traveled_distance = 0;
                        }
 
                        if(time > self.lms_nextcheck)
                        {
                                //sprint(self, "distance: ", ftos(self.lms_traveled_distance), "\n");
-                               if(self.lms_traveled_distance < cvar("g_lms_campcheck_distance"))
+                               if(self.lms_traveled_distance < autocvar_g_lms_campcheck_distance)
                                {
-                                       centerprint(self, cvar_string("g_lms_campcheck_message"));
+                                       centerprint(self, autocvar_g_lms_campcheck_message);
                                        // FIXME KadaverJack: gibbing player here causes playermodel to bounce around, instead of eye.md3
                                        // I wasn't able to find out WHY that happens, so I put a workaround in place that shall prevent players from being gibbed :(
-                                       Damage(self, self, self, bound(0, cvar("g_lms_campcheck_damage"), self.health + self.armorvalue * cvar("g_balance_armor_blockpercent") + 5), DEATH_CAMP, self.origin, '0 0 0');
+                                       Damage(self, self, self, bound(0, autocvar_g_lms_campcheck_damage, self.health + self.armorvalue * autocvar_g_balance_armor_blockpercent + 5), DEATH_CAMP, self.origin, '0 0 0');
                                }
-                               self.lms_nextcheck = time + cvar("g_lms_campcheck_interval");
+                               self.lms_nextcheck = time + autocvar_g_lms_campcheck_interval;
                                self.lms_traveled_distance = 0;
                        }
                }
@@ -2839,8 +2839,8 @@ void PlayerPreThink (void)
                player_regen();
 
                // rot nex charge to the charge limit
-               if(cvar("g_balance_nex_charge_rot_rate") && self.nex_charge > cvar("g_balance_nex_charge_limit") && self.nex_charge_rottime < time)
-                       self.nex_charge = bound(cvar("g_balance_nex_charge_limit"), self.nex_charge - cvar("g_balance_nex_charge_rot_rate") * frametime / W_TICSPERFRAME, 1);
+               if(autocvar_g_balance_nex_charge_rot_rate && self.nex_charge > autocvar_g_balance_nex_charge_limit && self.nex_charge_rottime < time)
+                       self.nex_charge = bound(autocvar_g_balance_nex_charge_limit, self.nex_charge - autocvar_g_balance_nex_charge_rot_rate * frametime / W_TICSPERFRAME, 1);
 
                if(frametime)
                        player_anim();
@@ -2854,7 +2854,7 @@ void PlayerPreThink (void)
                if(g_nexball)
                        nexball_setstatus();
 
-               self.dmg_team = max(0, self.dmg_team - cvar("g_teamdamage_resetspeed") * frametime);
+               self.dmg_team = max(0, self.dmg_team - autocvar_g_teamdamage_resetspeed * frametime);
 
                //self.angles_y=self.v_angle_y + 90;   // temp
        } else if(gameover) {
@@ -2868,7 +2868,7 @@ void PlayerPreThink (void)
        }
 
        if(!zoomstate_set)
-               SetZoomState(self.BUTTON_ZOOM || (self.BUTTON_ATCK2 && self.weapon == WEP_NEX) || (self.BUTTON_ATCK2 && self.weapon == WEP_CAMPINGRIFLE && cvar("g_balance_campingrifle_secondary") == 0));
+               SetZoomState(self.BUTTON_ZOOM || (self.BUTTON_ATCK2 && self.weapon == WEP_NEX) || (self.BUTTON_ATCK2 && self.weapon == WEP_CAMPINGRIFLE && autocvar_g_balance_campingrifle_secondary == 0));
 
        float oldspectatee_status;
        oldspectatee_status = self.spectatee_status;
@@ -2924,12 +2924,12 @@ float isInvisibleString(string s)
                        case 32: // space
                                break;
                        case 192: // charmap space
-                               if (!cvar("utf8_enable"))
+                               if (!autocvar_utf8_enable)
                                        break;
                                return FALSE;
                        case 160: // space in unicode fonts
                        case 0xE000 + 192: // utf8 charmap space
-                               if (cvar("utf8_enable"))
+                               if (autocvar_utf8_enable)
                                        break;
                        default:
                                return FALSE;
@@ -3038,9 +3038,9 @@ void PlayerPostThink (void)
        //pointparticles(particleeffectnum("machinegun_impact"), self.origin + self.view_ofs + '0 0 7', '0 0 0', 1);
 
        if(self.waypointsprite_attachedforcarrier)
-               WaypointSprite_UpdateHealth(self.waypointsprite_attachedforcarrier, '1 0 0' * healtharmor_maxdamage(self.health, self.armorvalue, cvar("g_balance_armor_blockpercent")));
+               WaypointSprite_UpdateHealth(self.waypointsprite_attachedforcarrier, '1 0 0' * healtharmor_maxdamage(self.health, self.armorvalue, autocvar_g_balance_armor_blockpercent));
        
-       if(self.classname == "player" && self.deadflag == DEAD_NO && cvar("r_showbboxes"))
+       if(self.classname == "player" && self.deadflag == DEAD_NO && autocvar_r_showbboxes)
        {
                if(!self.showheadshotbbox)
                {
index 491d8a26cdc81e1e553e68960612ddef826e26d1..ff3903cbad4f9d8e29f5c1c5e55d39c32b2b75a2 100644 (file)
@@ -258,7 +258,7 @@ void ImpulseCommands (void)
        }
        else if(imp >= 103 && imp <= 107)
        {
-               if(cvar("g_waypointeditor"))
+               if(autocvar_g_waypointeditor)
                {
                        switch(imp)
                        {
index 56c5191081ed9aa57e916bb06fb65b7fc4da914d..ed459ae5eba762dac4d693feeb4456802855e081 100644 (file)
@@ -37,7 +37,7 @@ void PlayerJump (void)
                        doublejump = TRUE;
        }
 
-       mjumpheight = cvar("sv_jumpvelocity");
+       mjumpheight = autocvar_sv_jumpvelocity;
        if (self.waterlevel >= WATERLEVEL_SWIMMING)
        {
                if (self.watertype == CONTENT_WATER)
@@ -50,7 +50,7 @@ void PlayerJump (void)
                return;
        }
 
-       if (cvar("g_multijump"))
+       if (autocvar_g_multijump)
        {
                if (self.prevjumpbutton == FALSE && !(self.flags & FL_ONGROUND)) // jump button pressed this frame and we are in midair
                        self.multijump_ready = TRUE;  // this is necessary to check that we released the jump button and pressed it again
@@ -58,12 +58,12 @@ void PlayerJump (void)
                        self.multijump_ready = FALSE;
        }
 
-       if(!doublejump && self.multijump_ready && self.multijump_count < cvar("g_multijump") && self.velocity_z > cvar("g_multijump_speed"))
+       if(!doublejump && self.multijump_ready && self.multijump_count < autocvar_g_multijump && self.velocity_z > autocvar_g_multijump_speed)
        {
                // doublejump = FALSE; // checked above in the if
-               if (cvar("g_multijump") > 0)
+               if (autocvar_g_multijump > 0)
                {
-                       if (cvar("g_multijump_add") == 0) // in this case we make the z velocity == jumpvelocity
+                       if (autocvar_g_multijump_add == 0) // in this case we make the z velocity == jumpvelocity
                        {
                                if (self.velocity_z < mjumpheight)
                                {
@@ -114,26 +114,26 @@ void PlayerJump (void)
        // velocity bounds.  Final velocity is bound between (jumpheight *
        // min + jumpheight) and (jumpheight * max + jumpheight);
 
-       if(cvar_string("sv_jumpspeedcap_min") != "")
+       if(autocvar_sv_jumpspeedcap_min != "")
        {
                float minjumpspeed;
 
-               minjumpspeed = mjumpheight * cvar("sv_jumpspeedcap_min");
+               minjumpspeed = mjumpheight * stof(autocvar_sv_jumpspeedcap_min);
 
                if (self.velocity_z < minjumpspeed)
                        mjumpheight += minjumpspeed - self.velocity_z;
        }
 
-       if(cvar_string("sv_jumpspeedcap_max") != "")
+       if(autocvar_sv_jumpspeedcap_max != "")
        {
                // don't do jump speedcaps on ramps to preserve old xonotic ramjump style
                tracebox(self.origin + '0 0 0.01', self.mins, self.maxs, self.origin - '0 0 0.01', MOVE_NORMAL, self);
 
-               if(!(trace_fraction < 1 && trace_plane_normal_z < 0.98 && cvar("sv_jumpspeedcap_max_disable_on_ramps")))
+               if(!(trace_fraction < 1 && trace_plane_normal_z < 0.98 && autocvar_sv_jumpspeedcap_max_disable_on_ramps))
                {
                        float maxjumpspeed;
 
-                       maxjumpspeed = mjumpheight * cvar("sv_jumpspeedcap_max");
+                       maxjumpspeed = mjumpheight * stof(autocvar_sv_jumpspeedcap_max);
 
                        if (self.velocity_z > maxjumpspeed)
                                mjumpheight -= self.velocity_z - maxjumpspeed;
@@ -142,12 +142,12 @@ void PlayerJump (void)
 
        if(!(self.lastflags & FL_ONGROUND))
        {
-               if(cvar("speedmeter"))
+               if(autocvar_speedmeter)
                        dprint(strcat("landing velocity: ", vtos(self.velocity), " (abs: ", ftos(vlen(self.velocity)), ")\n"));
                if(self.lastground < time - 0.3)
                {
-                       self.velocity_x *= (1 - cvar("sv_friction_on_land"));
-                       self.velocity_y *= (1 - cvar("sv_friction_on_land"));
+                       self.velocity_x *= (1 - autocvar_sv_friction_on_land);
+                       self.velocity_y *= (1 - autocvar_sv_friction_on_land);
                }
                if(self.jumppadcount > 1)
                        dprint(strcat(ftos(self.jumppadcount), "x jumppad combo\n"));
@@ -519,7 +519,7 @@ void PM_Accelerate(vector wishdir, float wishspeed, float wishspeed0, float acce
        if(speedclamp)
                accelqw = -accelqw;
 
-       if(cvar("sv_gameplayfix_q2airaccelerate"))
+       if(autocvar_sv_gameplayfix_q2airaccelerate)
                wishspeed0 = wishspeed;
 
        vel_straight = self.velocity * wishdir;
@@ -669,25 +669,25 @@ void SV_PlayerPhysics()
        
        maxspd_mod = 1;
        if(g_minstagib && (self.items & IT_INVINCIBLE))
-               maxspd_mod *= cvar("g_minstagib_speed_highspeed");
+               maxspd_mod *= autocvar_g_minstagib_speed_highspeed;
        if(self.ballcarried)
                if(g_nexball)
-                       maxspd_mod *= cvar("g_nexball_basketball_carrier_highspeed");
+                       maxspd_mod *= autocvar_g_nexball_basketball_carrier_highspeed;
                else if(g_keepaway)
-                       maxspd_mod *= cvar("g_keepaway_ballcarrier_highspeed");
+                       maxspd_mod *= autocvar_g_keepaway_ballcarrier_highspeed;
 
        if(g_runematch)
        {
                if(self.runes & RUNE_SPEED)
                {
                        if(self.runes & CURSE_SLOW)
-                               maxspd_mod *= cvar("g_balance_rune_speed_combo_highspeed");
+                               maxspd_mod *= autocvar_g_balance_rune_speed_combo_highspeed;
                        else
-                               maxspd_mod *= cvar("g_balance_rune_speed_highspeed");
+                               maxspd_mod *= autocvar_g_balance_rune_speed_highspeed;
                }
                else if(self.runes & CURSE_SLOW)
                {
-                       maxspd_mod *= cvar("g_balance_curse_slow_highspeed");
+                       maxspd_mod *= autocvar_g_balance_curse_slow_highspeed;
                }
        }
        maxspd_mod *= autocvar_g_movement_highspeed;
@@ -756,13 +756,13 @@ void SV_PlayerPhysics()
        self.v_angle_old = self.v_angle;
 
        if(time < self.nickspamtime)
-       if(self.nickspamcount >= cvar("g_nick_flood_penalty_yellow"))
+       if(self.nickspamcount >= autocvar_g_nick_flood_penalty_yellow)
        {
                // slight annoyance for nick change scripts
                self.movement = -1 * self.movement;
                self.BUTTON_ATCK = self.BUTTON_JUMP = self.BUTTON_ATCK2 = self.BUTTON_ZOOM = self.BUTTON_CROUCH = self.BUTTON_HOOK = self.BUTTON_USE = 0;
 
-               if(self.nickspamcount >= cvar("g_nick_flood_penalty_red")) // if you are persistent and the slight annoyance above does not stop you, I'll show you!
+               if(self.nickspamcount >= autocvar_g_nick_flood_penalty_red) // if you are persistent and the slight annoyance above does not stop you, I'll show you!
                {
                        self.angles_x = random() * 360;
                        self.angles_y = random() * 360;
@@ -809,7 +809,7 @@ void SV_PlayerPhysics()
                not_allowed_to_move = 0;
                if(self.race_penalty)
                        not_allowed_to_move = 1;
-               if(!cvar("sv_ready_restart_after_countdown"))
+               if(!autocvar_sv_ready_restart_after_countdown)
                if(time < game_starttime)
                        not_allowed_to_move = 1;
 
@@ -839,7 +839,7 @@ void SV_PlayerPhysics()
 
        if(self.classname != "player")
        {
-               maxspd_mod = cvar("sv_spectator_speed_multiplier");
+               maxspd_mod = autocvar_sv_spectator_speed_multiplier;
                if(!self.spectatorspeed)
                        self.spectatorspeed = maxspd_mod;
                if(self.impulse && self.impulse <= 19)
@@ -914,7 +914,7 @@ void SV_PlayerPhysics()
        {
                if(self.flags & FL_ONGROUND)
                {
-                       if (cvar("g_multijump") > 0)
+                       if (autocvar_g_multijump > 0)
                                self.multijump_count = 0;
                        else
                                self.multijump_count = -2; // the cvar value for infinite jumps is -1, so this needs to be smaller
@@ -1028,7 +1028,7 @@ void SV_PlayerPhysics()
                        PM_Accelerate(wishdir, wishspeed, wishspeed, autocvar_sv_accelerate*maxspd_mod, 1, 0, 0);
                }
        }
-       else if ((self.items & IT_JETPACK) && self.BUTTON_HOOK && (!cvar("g_jetpack_fuel") || self.ammo_fuel >= 0.01 || self.items & IT_UNLIMITED_WEAPON_AMMO))
+       else if ((self.items & IT_JETPACK) && self.BUTTON_HOOK && (!autocvar_g_jetpack_fuel || self.ammo_fuel >= 0.01 || self.items & IT_UNLIMITED_WEAPON_AMMO))
        {
                //makevectors(self.v_angle_y * '0 1 0');
                makevectors(self.v_angle);
@@ -1045,9 +1045,9 @@ void SV_PlayerPhysics()
 
                // it is now normalized, so...
                float a_side, a_up, a_add, a_diff;
-               a_side = cvar("g_jetpack_acceleration_side");
-               a_up = cvar("g_jetpack_acceleration_up");
-               a_add = cvar("g_jetpack_antigravity") * autocvar_sv_gravity;
+               a_side = autocvar_g_jetpack_acceleration_side;
+               a_up = autocvar_g_jetpack_acceleration_up;
+               a_add = autocvar_g_jetpack_antigravity * autocvar_sv_gravity;
 
                wishvel_x *= a_side;
                wishvel_y *= a_side;
@@ -1095,11 +1095,11 @@ void SV_PlayerPhysics()
                //print("best possible acceleration: ", ftos(best), "\n");
 
                float fxy, fz;
-               fxy = bound(0, 1 - (self.velocity * normalize(wishvel_x * '1 0 0' + wishvel_y * '0 1 0')) / cvar("g_jetpack_maxspeed_side"), 1);
+               fxy = bound(0, 1 - (self.velocity * normalize(wishvel_x * '1 0 0' + wishvel_y * '0 1 0')) / autocvar_g_jetpack_maxspeed_side, 1);
                if(wishvel_z - autocvar_sv_gravity > 0)
-                       fz = bound(0, 1 - self.velocity_z / cvar("g_jetpack_maxspeed_up"), 1);
+                       fz = bound(0, 1 - self.velocity_z / autocvar_g_jetpack_maxspeed_up, 1);
                else
-                       fz = bound(0, 1 + self.velocity_z / cvar("g_jetpack_maxspeed_up"), 1);
+                       fz = bound(0, 1 + self.velocity_z / autocvar_g_jetpack_maxspeed_up, 1);
 
                float fvel;
                fvel = vlen(wishvel);
@@ -1108,8 +1108,8 @@ void SV_PlayerPhysics()
                wishvel_z = (wishvel_z - autocvar_sv_gravity) * fz + autocvar_sv_gravity;
 
                fvel = min(1, vlen(wishvel) / best);
-               if(cvar("g_jetpack_fuel") && !(self.items & IT_UNLIMITED_WEAPON_AMMO))
-                       f = min(1, self.ammo_fuel / (cvar("g_jetpack_fuel") * frametime * fvel));
+               if(autocvar_g_jetpack_fuel && !(self.items & IT_UNLIMITED_WEAPON_AMMO))
+                       f = min(1, self.ammo_fuel / (autocvar_g_jetpack_fuel * frametime * fvel));
                else
                        f = 1;
 
@@ -1119,12 +1119,12 @@ void SV_PlayerPhysics()
                {
                        self.velocity = self.velocity + wishvel * f * frametime;
                        if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
-                               self.ammo_fuel -= cvar("g_jetpack_fuel") * frametime * fvel * f;
+                               self.ammo_fuel -= autocvar_g_jetpack_fuel * frametime * fvel * f;
                        self.flags &~= FL_ONGROUND;
                        self.items |= IT_USING_JETPACK;
 
                        // jetpack also inhibits health regeneration, but only for 1 second
-                       self.pauseregen_finished = max(self.pauseregen_finished, time + cvar("g_balance_pause_fuel_regen"));
+                       self.pauseregen_finished = max(self.pauseregen_finished, time + autocvar_g_balance_pause_fuel_regen);
                }
        }
        else if (self.flags & FL_ONGROUND)
@@ -1139,10 +1139,10 @@ void SV_PlayerPhysics()
 
                if(!(self.lastflags & FL_ONGROUND))
                {
-                       if(cvar("speedmeter"))
+                       if(autocvar_speedmeter)
                                dprint(strcat("landing velocity: ", vtos(self.velocity), " (abs: ", ftos(vlen(self.velocity)), ")\n"));
                        if(self.lastground < time - 0.3)
-                               self.velocity = self.velocity * (1 - cvar("sv_friction_on_land"));
+                               self.velocity = self.velocity * (1 - autocvar_sv_friction_on_land);
                        if(self.jumppadcount > 1)
                                dprint(strcat(ftos(self.jumppadcount), "x jumppad combo\n"));
                        self.jumppadcount = 0;
@@ -1291,13 +1291,13 @@ void SV_PlayerPhysics()
 
        float xyspeed;
        xyspeed = vlen('1 0 0' * self.velocity_x + '0 1 0' * self.velocity_y);
-       if(self.weapon == WEP_NEX && cvar("g_balance_nex_charge") && cvar("g_balance_nex_charge_velocity_rate") && xyspeed > cvar("g_balance_nex_charge_minspeed"))
+       if(self.weapon == WEP_NEX && autocvar_g_balance_nex_charge && autocvar_g_balance_nex_charge_velocity_rate && xyspeed > autocvar_g_balance_nex_charge_minspeed)
        {
                // add a maximum of charge_velocity_rate when going fast (f = 1), gradually increasing from minspeed (f = 0) to maxspeed
-               xyspeed = min(xyspeed, cvar("g_balance_nex_charge_maxspeed"));
-               f = (xyspeed - cvar("g_balance_nex_charge_minspeed")) / (cvar("g_balance_nex_charge_maxspeed") - cvar("g_balance_nex_charge_minspeed"));
+               xyspeed = min(xyspeed, autocvar_g_balance_nex_charge_maxspeed);
+               f = (xyspeed - autocvar_g_balance_nex_charge_minspeed) / (autocvar_g_balance_nex_charge_maxspeed - autocvar_g_balance_nex_charge_minspeed);
                // add the extra charge
-               self.nex_charge = min(1, self.nex_charge + cvar("g_balance_nex_charge_velocity_rate") * f * frametime);
+               self.nex_charge = min(1, self.nex_charge + autocvar_g_balance_nex_charge_velocity_rate * f * frametime);
        }
 :end
        if(self.flags & FL_ONGROUND)
index f8acd05036ae9d7acb3982fed0502a7017598061..79206585cb085df1fb8a18b2eccd811e2dd09733 100644 (file)
@@ -2,7 +2,7 @@ float weaponstats_buffer;
 
 void WeaponStats_Init()
 {
-       if(cvar_string("sv_weaponstats_killfile") != "" || cvar_string("sv_weaponstats_damagefile") != "")
+       if(autocvar_sv_weaponstats_killfile != "" || autocvar_sv_weaponstats_damagefile != "")
                weaponstats_buffer = buf_create();
        else
                weaponstats_buffer = -1;
@@ -17,10 +17,10 @@ void WeaponStats_Shutdown()
        string prefix;
        if(weaponstats_buffer < 0)
                return;
-       prefix = strcat(cvar_string("hostname"), "\t", GetGametype(), "_", GetMapname(), "\t");
-       if(cvar_string("sv_weaponstats_killfile") != "")
+       prefix = strcat(autocvar_hostname, "\t", GetGametype(), "_", GetMapname(), "\t");
+       if(autocvar_sv_weaponstats_killfile != "")
        {
-               fh = fopen(cvar_string("sv_weaponstats_killfile"), FILE_APPEND);
+               fh = fopen(autocvar_sv_weaponstats_killfile, FILE_APPEND);
                if(fh >= 0)
                {
                        fputs(fh, "#begin killfile\n");
@@ -39,9 +39,9 @@ void WeaponStats_Shutdown()
                        print("Weapon kill stats written\n");
                }
        }
-       if(cvar_string("sv_weaponstats_damagefile") != "")
+       if(autocvar_sv_weaponstats_damagefile != "")
        {
-               fh = fopen(cvar_string("sv_weaponstats_damagefile"), FILE_APPEND);
+               fh = fopen(autocvar_sv_weaponstats_damagefile, FILE_APPEND);
                if(fh >= 0)
                {
                        fputs(fh, "#begin damagefile\n");
@@ -341,7 +341,7 @@ void PlayerCorpseDamage (entity inflictor, entity attacker, float damage, float
        // damage resistance (ignore most of the damage from a bullet or similar)
        damage = max(damage - 5, 1);
 
-       v = healtharmor_applydamage(self.armorvalue, cvar("g_balance_armor_blockpercent"), damage);
+       v = healtharmor_applydamage(self.armorvalue, autocvar_g_balance_armor_blockpercent, damage);
        take = v_x;
        save = v_y;
 
@@ -365,7 +365,7 @@ void PlayerCorpseDamage (entity inflictor, entity attacker, float damage, float
                self.armorvalue = self.armorvalue - save;
                self.health = self.health - take;
                // pause regeneration for 5 seconds
-               self.pauseregen_finished = max(self.pauseregen_finished, time + cvar("g_balance_pause_health_regen"));
+               self.pauseregen_finished = max(self.pauseregen_finished, time + autocvar_g_balance_pause_health_regen);
        }
        self.dmg_save = self.dmg_save + save;//max(save - 10, 0);
        self.dmg_take = self.dmg_take + take;//max(take - 10, 0);
@@ -441,7 +441,7 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht
 
        if (!g_minstagib)
        {
-               v = healtharmor_applydamage(self.armorvalue, cvar("g_balance_armor_blockpercent"), damage);
+               v = healtharmor_applydamage(self.armorvalue, autocvar_g_balance_armor_blockpercent, damage);
                take = v_x;
                save = v_y;
        }
@@ -483,7 +483,7 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht
                        self.armorvalue = self.armorvalue - save;
                        self.health = self.health - take;
                        // pause regeneration for 5 seconds
-                       self.pauseregen_finished = max(self.pauseregen_finished, time + cvar("g_balance_pause_health_regen"));
+                       self.pauseregen_finished = max(self.pauseregen_finished, time + autocvar_g_balance_pause_health_regen);
 
                        if (time > self.pain_finished)          //Don't switch pain sequences like crazy
                        {
@@ -499,7 +499,7 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht
                                        }
 
                                        if(sound_allowed(MSG_BROADCAST, attacker))
-                                       if(!DEATH_ISWEAPON(deathtype, WEP_LASER) || attacker != self || self.health < 2 * cvar("g_balance_laser_primary_damage") * cvar("g_balance_selfdamagepercent") + 1)
+                                       if(!DEATH_ISWEAPON(deathtype, WEP_LASER) || attacker != self || self.health < 2 * autocvar_g_balance_laser_primary_damage * autocvar_g_balance_selfdamagepercent + 1)
                                        if(self.health > 1)
                                        // exclude pain sounds for laserjumps as long as you aren't REALLY low on health and would die of the next two
                                        {
@@ -539,7 +539,7 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht
        else if(attacker.classname == "player" || attacker.classname == "gib")
        {
                self.pusher = attacker;
-               self.pushltime = time + cvar("g_maxpushtime");
+               self.pushltime = time + autocvar_g_maxpushtime;
        }
        else if(time < self.pushltime)
        {
@@ -659,7 +659,7 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht
                self.movetype = MOVETYPE_TOSS;
                // shootable corpse
                self.solid = SOLID_CORPSE;
-               self.ballistics_density = cvar("g_ballistics_density_corpse");
+               self.ballistics_density = autocvar_g_ballistics_density_corpse;
                // don't stick to the floor
                self.flags &~= FL_ONGROUND;
                // dying animation
@@ -669,10 +669,10 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht
                waves = 0;
                sdelay = cvar(strcat("g_", GetGametype(), "_respawn_delay"));
                if(!sdelay)
-                       sdelay = cvar("g_respawn_delay");
+                       sdelay = autocvar_g_respawn_delay;
                waves = cvar(strcat("g_", GetGametype(), "_respawn_waves"));
                if(!waves)
-                       waves = cvar("g_respawn_waves");
+                       waves = autocvar_g_respawn_waves;
                if(waves)
                        self.death_time = ceil((time + sdelay) / waves) * waves;
                else
@@ -714,7 +714,7 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht
                if(defer_ClientKill_Now_TeamChange)
                        ClientKill_Now_TeamChange();
 
-               if(sv_gentle > 0 || cvar("ekg")) {
+               if(sv_gentle > 0 || autocvar_ekg) {
                        // remove corpse
                        PlayerCorpseDamage (inflictor, attacker, 100.0, deathtype, hitloc, force);
                }
@@ -787,7 +787,7 @@ void UpdateSelectedPlayer()
        selected = world;
        selected_score = 0.95; // 18 degrees
 
-       if(!cvar("sv_allow_shownames"))
+       if(!autocvar_sv_allow_shownames)
                return;
 
        if(clienttype(self) != CLIENTTYPE_REAL)
@@ -923,7 +923,7 @@ float Say(entity source, float teamsay, entity privatesay, string msgin, float f
        }
        */
 
-       if(cvar("g_chat_teamcolors"))
+       if(autocvar_g_chat_teamcolors)
                namestr = playername(source);
        else
                namestr = source.netname;
@@ -936,7 +936,7 @@ float Say(entity source, float teamsay, entity privatesay, string msgin, float f
                        privatemsgprefixlen = strlen(msgstr);
                        msgstr = strcat(msgstr, msgin);
                        cmsgstr = strcat(colorstr, "^3", namestr, "^3 tells you:\n^7", msgin);
-                       if(cvar("g_chat_teamcolors"))
+                       if(autocvar_g_chat_teamcolors)
                                privatemsgprefix = strcat("\{1}\{13}* ^3You tell ", playername(privatesay), ": ^7");
                        else
                                privatemsgprefix = strcat("\{1}\{13}* ^3You tell ", privatesay.netname, ": ^7");
@@ -971,23 +971,23 @@ float Say(entity source, float teamsay, entity privatesay, string msgin, float f
                float lines;
                if(privatesay)
                {
-                       flood_spl = cvar("g_chat_flood_spl_tell");
-                       flood_burst = cvar("g_chat_flood_burst_tell");
-                       flood_lmax = cvar("g_chat_flood_lmax_tell");
+                       flood_spl = autocvar_g_chat_flood_spl_tell;
+                       flood_burst = autocvar_g_chat_flood_burst_tell;
+                       flood_lmax = autocvar_g_chat_flood_lmax_tell;
                        flood_field = floodcontrol_chattell;
                }
                else if(teamsay)
                {
-                       flood_spl = cvar("g_chat_flood_spl_team");
-                       flood_burst = cvar("g_chat_flood_burst_team");
-                       flood_lmax = cvar("g_chat_flood_lmax_team");
+                       flood_spl = autocvar_g_chat_flood_spl_team;
+                       flood_burst = autocvar_g_chat_flood_burst_team;
+                       flood_lmax = autocvar_g_chat_flood_lmax_team;
                        flood_field = floodcontrol_chatteam;
                }
                else
                {
-                       flood_spl = cvar("g_chat_flood_spl");
-                       flood_burst = cvar("g_chat_flood_burst");
-                       flood_lmax = cvar("g_chat_flood_lmax");
+                       flood_spl = autocvar_g_chat_flood_spl;
+                       flood_burst = autocvar_g_chat_flood_burst;
+                       flood_lmax = autocvar_g_chat_flood_lmax;
                        flood_field = floodcontrol_chat;
                }
                flood_burst = max(0, flood_burst - 1);
@@ -1036,7 +1036,7 @@ float Say(entity source, float teamsay, entity privatesay, string msgin, float f
 
        if(flood == 2) // cannot happen for empty msgstr
        {
-               if(cvar("g_chat_flood_notify_flooder"))
+               if(autocvar_g_chat_flood_notify_flooder)
                {
                        sourcemsgstr = strcat(msgstr, "\n^3FLOOD CONTROL: ^7message too long, trimmed\n");
                        sourcecmsgstr = "";
@@ -1057,7 +1057,7 @@ float Say(entity source, float teamsay, entity privatesay, string msgin, float f
        if(!privatesay)
        if(source.classname != "player")
        {
-               if(teamsay || (cvar("g_chat_nospectators") == 1) || (cvar("g_chat_nospectators") == 2 && !inWarmupStage))
+               if(teamsay || (autocvar_g_chat_nospectators == 1) || (autocvar_g_chat_nospectators == 2 && !inWarmupStage))
                        teamsay = -1; // spectators
        }
 
@@ -1075,7 +1075,7 @@ float Say(entity source, float teamsay, entity privatesay, string msgin, float f
        }
        else if(flood == 1)
        {
-               if(cvar("g_chat_flood_notify_flooder"))
+               if(autocvar_g_chat_flood_notify_flooder)
                {
                        sprint(source, strcat("^3FLOOD CONTROL: ^7wait ^1", ftos(source.flood_field - time), "^3 seconds\n"));
                        ret = 0;
index 5b765396c4641aa847b5aacd2c20f3dc395d726f..c0097ee561b99fc99895d64af0e317451e67fe0d 100644 (file)
@@ -271,13 +271,13 @@ void W_ThrowWeapon(vector velo, vector delta, float doreduce)
                return;
        if (g_nexball && w == WEP_GRENADE_LAUNCHER)
                return;
-       if (!cvar("g_pickup_items"))
+       if (!autocvar_g_pickup_items)
                return;
        if (g_ca)
                return;
-       if(!cvar("g_weapon_throwable"))
+       if(!autocvar_g_weapon_throwable)
                return;
-       if(cvar("g_weapon_stay") == 1)
+       if(autocvar_g_weapon_stay == 1)
                return;
        if(!W_IsWeaponThrowable(w))
                return;
@@ -310,7 +310,7 @@ void W_WeaponFrame()
        if (frametime)
                self.weapon_frametime = frametime;
 
-       if(((arena_roundbased || g_ca || g_freezetag) && time < warmup) || ((time < game_starttime) && !cvar("sv_ready_restart_after_countdown")))
+       if(((arena_roundbased || g_ca || g_freezetag) && time < warmup) || ((time < game_starttime) && !autocvar_sv_ready_restart_after_countdown))
                return;
 
        if(g_freezetag && self.freezetag_frozen == 1)
@@ -343,7 +343,7 @@ void W_WeaponFrame()
                        weapon_action(self.switchweapon, WR_SETUP);
                        // VorteX: add player model weapon select frame here
                        // setcustomframe(PlayerWeaponRaise);
-                       weapon_thinkf(WFRAME_IDLE, cvar("g_balance_weaponswitchdelay"), w_ready);
+                       weapon_thinkf(WFRAME_IDLE, autocvar_g_balance_weaponswitchdelay, w_ready);
                        weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, '0 0 0');
                }
                else if (self.weaponentity.state == WS_READY)
@@ -356,7 +356,7 @@ void W_WeaponFrame()
                        sound (self, CHAN_WEAPON2, "weapons/weapon_switch.wav", VOL_BASE, ATTN_NORM);
                        self.weaponentity.state = WS_DROP;
                        // set up weapon switch think in the future, and start drop anim
-                       weapon_thinkf(WFRAME_DONTCHANGE, cvar("g_balance_weaponswitchdelay"), w_clear);
+                       weapon_thinkf(WFRAME_DONTCHANGE, autocvar_g_balance_weaponswitchdelay, w_clear);
                        weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, PLAYER_WEAPONSELECTION_RANGE);
 #ifndef INDEPENDENT_ATTACK_FINISHED
                        }
index 5bfad53530b8b7446c14c33ef4fdaca68510f41c..bb71d5965af2f2be6bb548f0aa11bca000d613ff 100644 (file)
@@ -19,13 +19,13 @@ float W_WeaponRateFactor()
                if(self.runes & RUNE_SPEED)
                {
                        if(self.runes & CURSE_SLOW)
-                               t = t * cvar("g_balance_rune_speed_combo_atkrate");
+                               t = t * autocvar_g_balance_rune_speed_combo_atkrate;
                        else
-                               t = t * cvar("g_balance_rune_speed_atkrate");
+                               t = t * autocvar_g_balance_rune_speed_atkrate;
                }
                else if(self.runes & CURSE_SLOW)
                {
-                       t = t * cvar("g_balance_curse_slow_atkrate");
+                       t = t * autocvar_g_balance_curse_slow_atkrate;
                }
        }
 
@@ -191,7 +191,7 @@ void W_SetupShot_Dir_ProjectileSize_Range(entity ent, vector s_forward, vector m
        if (antilag)
        if (!ent.cvar_cl_noantilag)
        {
-               if (cvar("g_antilag") == 1) // switch to "ghost" if not hitting original
+               if (autocvar_g_antilag == 1) // switch to "ghost" if not hitting original
                {
                        traceline(w_shotorg, w_shotorg + w_shotdir * range, MOVE_NORMAL, ent);
                        if (!trace_ent.takedamage)
@@ -207,7 +207,7 @@ void W_SetupShot_Dir_ProjectileSize_Range(entity ent, vector s_forward, vector m
                                }
                        }
                }
-               else if(cvar("g_antilag") == 3) // client side hitscan
+               else if(autocvar_g_antilag == 3) // client side hitscan
                {
                        // this part MUST use prydon cursor
                        if (ent.cursor_trace_ent)                 // client was aiming at someone
@@ -242,9 +242,9 @@ void W_SetupShot_Dir_ProjectileSize_Range(entity ent, vector s_forward, vector m
        if(ent.items & IT_STRENGTH)
        if(!g_minstagib)
        if(
-               (time > ent.prevstrengthsound + cvar("sv_strengthsound_antispam_time"))
+               (time > ent.prevstrengthsound + autocvar_sv_strengthsound_antispam_time)
                ||
-               (time > ent.prevstrengthsoundattempt + cvar("sv_strengthsound_antispam_refire_threshold"))
+               (time > ent.prevstrengthsoundattempt + autocvar_sv_strengthsound_antispam_refire_threshold)
        ) // prevent insane sound spam
        {
                sound(ent, CHAN_AUTO, "weapons/strength_fire.wav", VOL_BASE, ATTN_NORM);
@@ -616,7 +616,7 @@ void CL_Weaponentity_Think()
        f = 0;
        if (self.state == WS_RAISE && !intermission_running)
        {
-               f = (self.owner.weapon_nextthink - time) * g_weaponratefactor / cvar("g_balance_weaponswitchdelay");
+               f = (self.owner.weapon_nextthink - time) * g_weaponratefactor / autocvar_g_balance_weaponswitchdelay;
                self.angles_x = -90 * f * f;
                if (qcweaponanimation)
                {
@@ -626,7 +626,7 @@ void CL_Weaponentity_Think()
        }
        else if (self.state == WS_DROP && !intermission_running)
        {
-               f = 1 - (self.owner.weapon_nextthink - time) * g_weaponratefactor / cvar("g_balance_weaponswitchdelay");
+               f = 1 - (self.owner.weapon_nextthink - time) * g_weaponratefactor / autocvar_g_balance_weaponswitchdelay;
                self.angles_x = -90 * f * f;
                if (qcweaponanimation)
                {
@@ -952,7 +952,7 @@ float client_hasweapon(entity cl, float wpn, float andammo, float complain)
                        sprint(cl, strcat("You do not have the ^2", W_Name(wpn), "\n") );
                        Send_WeaponComplain (cl, wpn, W_Name(wpn), 1);
 
-                       if(cvar("g_showweaponspawns"))
+                       if(autocvar_g_showweaponspawns)
                        {
                                entity e;
                                string s;
@@ -1011,7 +1011,7 @@ void w_ready()
 void weapon_setup(float windex)
 {
        entity e;
-       qcweaponanimation = cvar("sv_qcweaponanimation");
+       qcweaponanimation = autocvar_sv_qcweaponanimation;
        e = get_weaponinfo(windex);
        self.items &~= IT_AMMO;
        self.items = self.items | e.items;
@@ -1275,7 +1275,7 @@ vector W_CalculateProjectileVelocity(vector pvelocity, vector mvelocity, float f
        mdirection = normalize(mvelocity);
        mspeed = vlen(mvelocity);
 
-       nstyle = cvar("g_projectiles_newton_style");
+       nstyle = autocvar_g_projectiles_newton_style;
        if(nstyle == 0 || forceAbsolute)
        {
                // absolute velocity
@@ -1312,7 +1312,7 @@ vector W_CalculateProjectileVelocity(vector pvelocity, vector mvelocity, float f
                        //dprint("impossible shot, adjusting\n");
                }
 
-               outspeed = bound(mspeed * cvar("g_projectiles_newton_style_2_minfactor"), outspeed, mspeed * cvar("g_projectiles_newton_style_2_maxfactor"));
+               outspeed = bound(mspeed * autocvar_g_projectiles_newton_style_2_minfactor, outspeed, mspeed * autocvar_g_projectiles_newton_style_2_maxfactor);
                outvelocity = mdirection * outspeed;
        }
        else if(nstyle == 3)
@@ -1455,7 +1455,7 @@ vector W_CalculateProjectileSpread(vector forward, float spread)
        spread *= g_weaponspreadfactor;
        if(spread <= 0)
                return forward;
-       sstyle = cvar("g_projectiles_spread_style");
+       sstyle = autocvar_g_projectiles_spread_style;
        
        if(sstyle == 0)
        {
@@ -1580,10 +1580,10 @@ void W_SetupProjectileVelocityEx(entity missile, vector dir, vector upDir, float
        dir = normalize(dir);
 
 #if 0
-       if(cvar("g_projectiles_spread_style") != mspercallsstyle)
+       if(autocvar_g_projectiles_spread_style != mspercallsstyle)
        {
                mspercallsum = mspercallcount = 0;
-               mspercallsstyle = cvar("g_projectiles_spread_style");
+               mspercallsstyle = autocvar_g_projectiles_spread_style;
        }
        mspercallsum -= gettime(GETTIME_HIRES);
 #endif
index 1a46ed8b51deccbc0925641996bfa6da6bfbc553..92e4b8ac18ac0a0c4c264fd311fc5297a7ac987f 100644 (file)
@@ -164,14 +164,14 @@ void SV_ParseClientCommand(string s) {
                } else {
                        self.version = stof(argv(1));
                }
-               if(self.version != cvar("gameversion"))
+               if(self.version != autocvar_gameversion)
                {
                        self.classname = "observer";
                        self.version_mismatch = 1;
                        PutClientInServer();
-               } else if(cvar("g_campaign") || cvar("g_balance_teams") || cvar("g_balance_teams_force")) {
+               } else if(autocvar_g_campaign || autocvar_g_balance_teams || autocvar_g_balance_teams_force) {
                        //JoinBestTeam(self, FALSE, TRUE);
-               } else if(teams_matter && !cvar("sv_spectate") && !(self.team_forced > 0)) {
+               } else if(teams_matter && !autocvar_sv_spectate && !(self.team_forced > 0)) {
                        self.classname = "observer";
                        stuffcmd(self,"menu_showteamselect\n");
                }
@@ -210,7 +210,7 @@ void SV_ParseClientCommand(string s) {
                                return;
                        }
                }
-               if(self.classname == "player" && cvar("sv_spectate") == 1) {
+               if(self.classname == "player" && autocvar_sv_spectate == 1) {
                        if(self.flagcarried)
                                DropFlag(self.flagcarried, world, world);
                        if(self.ballcarried && g_nexball)
@@ -220,7 +220,7 @@ void SV_ParseClientCommand(string s) {
                        if(g_ca)
                                self.caplayer = 0;
                        if(blockSpectators)
-                               sprint(self, strcat("^7You have to become a player within the next ", ftos(cvar("g_maxplayers_spectator_blocktime")), " seconds, otherwise you will be kicked, because spectators aren't allowed at this time!\n"));
+                               sprint(self, strcat("^7You have to become a player within the next ", ftos(autocvar_g_maxplayers_spectator_blocktime), " seconds, otherwise you will be kicked, because spectators aren't allowed at this time!\n"));
                        PutClientInServer();
                }
        } else if(cmd == "join") {
@@ -236,7 +236,7 @@ void SV_ParseClientCommand(string s) {
                                PlayerScore_Clear(self);
                                bprint ("^4", self.netname, "^4 is playing now\n");
                                PutClientInServer();
-                               if(cvar("g_campaign"))
+                               if(autocvar_g_campaign)
                                        campaign_bots_may_start = 1;
                        }
                        else {
@@ -249,7 +249,7 @@ void SV_ParseClientCommand(string s) {
                        return;
                if( !teams_matter ) {
                        sprint( self, "selectteam can only be used in teamgames\n");
-               } else if(cvar("g_campaign")) {
+               } else if(autocvar_g_campaign) {
                        //JoinBestTeam(self, 0);
                } else if(self.team_forced > 0) {
                        sprint( self, "selectteam can not be used as your team is forced\n");
@@ -273,9 +273,9 @@ void SV_ParseClientCommand(string s) {
                        return;
 
                if((inWarmupStage && 0 >= g_warmup_limit) // with unlimited warmup players have to be able to restart
-                  || cvar("sv_ready_restart") || g_race_qualifying == 2)
+                  || autocvar_sv_ready_restart || g_race_qualifying == 2)
                {
-                       if(!readyrestart_happened || cvar("sv_ready_restart_repeatable"))
+                       if(!readyrestart_happened || autocvar_sv_ready_restart_repeatable)
                        {
                                if (self.ready) // toggle
                                {
@@ -345,7 +345,7 @@ void SV_ParseClientCommand(string s) {
        } else if(cmd == "timeout") {
                if not(self.flags & FL_CLIENT)
                        return;
-               if(cvar("sv_timeout")) {
+               if(autocvar_sv_timeout) {
                        if(self.classname == "player") {
                                if(votecalled)
                                        sprint(self, "^7Error: you can not call a timeout while a vote is active!\n");
@@ -358,7 +358,7 @@ void SV_ParseClientCommand(string s) {
        } else if(cmd == "timein") {
                if not(self.flags & FL_CLIENT)
                        return;
-               if(cvar("sv_timeout")) {
+               if(autocvar_sv_timeout) {
                        evaluateTimein();
                }
        } else if(cmd == "teamstatus") {
@@ -398,12 +398,12 @@ void SV_ParseClientCommand(string s) {
                if(self.jointime > 0 && time > self.jointime + 10 && time > self.nickspamtime) // allow any changes in the first 10 seconds since joining
                if(cmd == "name" || cmd == "playermodel") // TODO also playerskin and color?
                {
-                       if(self.nickspamtime == 0 || time > self.nickspamtime + cvar("g_nick_flood_timeout"))
+                       if(self.nickspamtime == 0 || time > self.nickspamtime + autocvar_g_nick_flood_timeout)
                                // good, no serious flood
                                self.nickspamcount = 1;
                        else
                                self.nickspamcount += 1;
-                       self.nickspamtime = time + cvar("g_nick_flood_penalty");
+                       self.nickspamtime = time + autocvar_g_nick_flood_penalty;
 
                        if (timeoutStatus == 2) //when game is paused, no flood protection
                                self.nickspamcount = self.nickspamtime = 0;
@@ -425,8 +425,8 @@ void ReadyRestartForce()
        if (checkrules_overtimesadded > 0 && g_race_qualifying != 2) {
                //we have to decrease timelimit to its original value again!!
                float newTL;
-               newTL = cvar("timelimit");
-               newTL -= checkrules_overtimesadded * cvar("timelimit_overtime");
+               newTL = autocvar_timelimit;
+               newTL -= checkrules_overtimesadded * autocvar_timelimit_overtime;
                cvar_set("timelimit", ftos(newTL));
        }
 
@@ -447,13 +447,13 @@ void ReadyRestartForce()
        readycount = 0;
        Nagger_ReadyCounted(); // NOTE: this causes a resend of that entity, and will also turn off warmup state on the client
 
-       if(cvar("teamplay_lockonrestart") && teams_matter) {
+       if(autocvar_teamplay_lockonrestart && teams_matter) {
                lockteams = 1;
                bprint("^1The teams are now locked.\n");
        }
 
        //initiate the restart-countdown-announcer entity
-       if(cvar("sv_ready_restart_after_countdown") && !g_ca && !g_arena)
+       if(autocvar_sv_ready_restart_after_countdown && !g_ca && !g_arena)
        {
                restartTimer = spawn();
                restartTimer.think = restartTimer_Think;
@@ -461,17 +461,17 @@ void ReadyRestartForce()
        }
 
        //after a restart every players number of allowed timeouts gets reset, too
-       if(cvar("sv_timeout"))
+       if(autocvar_sv_timeout)
        {
                FOR_EACH_REALPLAYER(e)
-                       e.allowedTimeouts = cvar("sv_timeout_number");
+                       e.allowedTimeouts = autocvar_sv_timeout_number;
        }
 
        //reset map immediately if this cvar is not set
-       if (!cvar("sv_ready_restart_after_countdown"))
+       if (!autocvar_sv_ready_restart_after_countdown)
                reset_map(TRUE);
 
-       if(cvar("sv_eventlog"))
+       if(autocvar_sv_eventlog)
                GameLogEcho(":restart");
 }
 
@@ -488,7 +488,7 @@ void ReadyRestart()
        // reset ALL scores, but only do that at the beginning
        //of the countdown if sv_ready_restart_after_countdown is off!
        //Otherwise scores could be manipulated during the countdown!
-       if (!cvar("sv_ready_restart_after_countdown"))
+       if (!autocvar_sv_ready_restart_after_countdown)
                Score_ClearAll();
 }
 
@@ -553,13 +553,13 @@ void evaluateTimeout() {
                return sprint(self, "^7Error: You can not call a timeout while the map is being restarted!\n");
        if (timeoutStatus != 2) {
                //if the map uses a timelimit make sure that timeout cannot be called right before the map ends
-               if (cvar("timelimit")) {
+               if (autocvar_timelimit) {
                        //a timelimit was used
                        local float myTl;
-                       myTl = cvar("timelimit");
+                       myTl = autocvar_timelimit;
 
                        local float lastPossibleTimeout;
-                       lastPossibleTimeout = (myTl*60) - cvar("sv_timeout_leadtime") - 1;
+                       lastPossibleTimeout = (myTl*60) - autocvar_sv_timeout_leadtime - 1;
 
                        if (lastPossibleTimeout < time - game_starttime)
                                return sprint(self, "^7Error: It is too late to call a timeout now!\n");
@@ -571,8 +571,8 @@ void evaluateTimeout() {
        //now all required checks are passed
        self.allowedTimeouts -= 1;
        bprint(self.netname, " ^7called a timeout (", ftos(self.allowedTimeouts), " timeouts left)!\n"); //write a bprint who started the timeout (and how many he has left)
-       remainingTimeoutTime = cvar("sv_timeout_length");
-       remainingLeadTime = cvar("sv_timeout_leadtime");
+       remainingTimeoutTime = autocvar_sv_timeout_length;
+       remainingLeadTime = autocvar_sv_timeout_leadtime;
        timeoutInitiator = self;
        if (timeoutStatus == 0) { //if another timeout was already active, don't change its status (which was 1 or 2) to 1, only change it to 1 if no timeout was active yet
                timeoutStatus = 1;
@@ -606,9 +606,9 @@ void evaluateTimein() {
        }
        else if (timeoutStatus == 2) {
                //only shorten the remainingTimeoutTime if it makes sense
-               if( remainingTimeoutTime > (cvar("sv_timeout_resumetime") + 1) ) {
+               if( remainingTimeoutTime > (autocvar_sv_timeout_resumetime + 1) ) {
                        bprint(strcat("^1Attention: ^7", self.netname, " resumed the game! Prepare for battle!\n"));
-                       remainingTimeoutTime = cvar("sv_timeout_resumetime");
+                       remainingTimeoutTime = autocvar_sv_timeout_resumetime;
                        timeoutHandler.nextthink = time; //timeoutHandler has to take care of it immediately
                }
                else
index 4bc47b9a2dfd5f1477c986f3e7be19fc1192e3f5..23cdae9fbb61d034c575ae4de3dbae29cb5bf19d 100644 (file)
@@ -150,7 +150,7 @@ void FakeTimeLimit(entity e, float t)
        WriteByte(MSG_ONE, 3); // svc_updatestat
        WriteByte(MSG_ONE, 236); // STAT_TIMELIMIT
        if(t < 0)
-               WriteCoord(MSG_ONE, cvar("timelimit"));
+               WriteCoord(MSG_ONE, autocvar_timelimit);
        else
                WriteCoord(MSG_ONE, (t + 1) / 60);
 }
@@ -201,7 +201,7 @@ void place_flag()
 void LogCTF(string mode, float flagteam, entity actor)
 {
        string s;
-       if(!cvar("sv_eventlog"))
+       if(!autocvar_sv_eventlog)
                return;
        s = strcat(":ctf:", mode);
        s = strcat(s, ":", ftos(flagteam));
@@ -312,7 +312,7 @@ void DropFlag(entity e, entity penalty_receiver, entity attacker)
        sound (self, CHAN_TRIGGER, self.noise4, VOL_BASE, ATTN_NONE);
 
        setattachment(e, world, "");
-       e.damageforcescale = cvar("g_balance_ctf_damageforcescale");
+       e.damageforcescale = autocvar_g_balance_ctf_damageforcescale;
        e.takedamage = DAMAGE_YES;
 
        if (p.flagcarried == e)
@@ -326,7 +326,7 @@ void DropFlag(entity e, entity penalty_receiver, entity attacker)
        setorigin(e, p.origin - '0 0 24' + '0 0 37');
        e.cnt = FLAG_DROPPED;
        e.velocity = '0 0 300';
-       e.pain_finished = time + cvar("g_ctf_flag_returntime");//30;
+       e.pain_finished = time + autocvar_g_ctf_flag_returntime;//30;
 
        trace_startsolid = FALSE;
        tracebox(e.origin, e.mins, e.maxs, e.origin, TRUE, e);
@@ -406,7 +406,7 @@ void FlagThink()
                return;
        }
 
-       if(cvar("g_ctf_allow_drop"))
+       if(autocvar_g_ctf_allow_drop)
        if(e.BUTTON_USE)
                DropFlag(self, e, world);
 };
@@ -440,7 +440,7 @@ void FlagTouch()
                {
                        return;
                }
-               if(cvar("g_ctf_captimerecord_always") || player_count - currentbots <= 1) // at most one human
+               if(autocvar_g_ctf_captimerecord_always || player_count - currentbots <= 1) // at most one human
                {
                        t = time - other.flagcarried.flagpickuptime;
                        s = ftos_decimals(t, 2);
@@ -482,7 +482,7 @@ void FlagTouch()
                // give credit to the individual player
                UpdateFrags(other, ctf_score_value("score_capture"));
 
-               if (cvar("g_ctf_flag_capture_effects")) {
+               if (autocvar_g_ctf_flag_capture_effects) {
                        if (other.team == COLOR_TEAM1) { // red team scores effect
                                pointparticles(particleeffectnum("red_ground_quake"), self.origin, '0 0 0', 1);
                                flag_cap_ring_spawn(self.origin);
@@ -510,7 +510,7 @@ void FlagTouch()
                if (other.next_take_time > time)
                        return;
                        
-               if (cvar("g_ctf_flag_pickup_effects")) // pickup effect
+               if (autocvar_g_ctf_flag_pickup_effects) // pickup effect
                        pointparticles(particleeffectnum("smoke_ring"), 0.5 * (self.absmin + self.absmax), '0 0 0', 1);
                        
                // pick up
@@ -590,12 +590,12 @@ void FlagTouch()
                        sound (other, CHAN_AUTO, self.noise1, VOL_BASE, ATTN_NONE);
                        ReturnFlag(self);
                }
-               else if (!other.flagcarried && (other.playerid != self.dropperid || time > self.ctf_droptime + cvar("g_balance_ctf_delay_collect")))
+               else if (!other.flagcarried && (other.playerid != self.dropperid || time > self.ctf_droptime + autocvar_g_balance_ctf_delay_collect))
                {
                        if(self.waypointsprite_attachedforcarrier)
                                WaypointSprite_DetachCarrier(self);
 
-                       if (cvar("g_ctf_flag_pickup_effects")) // field pickup effect
+                       if (autocvar_g_ctf_flag_pickup_effects) // field pickup effect
                                pointparticles(particleeffectnum("smoke_ring"), 0.5 * (self.absmin + self.absmax), '0 0 0', 1);
                        
                        // pick up
@@ -608,7 +608,7 @@ void FlagTouch()
                        //bprint(other.netname, "^7 picked up the ", self.netname, "\n");
 
                        float f;
-                       f = bound(0, (self.pain_finished - time) / cvar("g_ctf_flag_returntime"), 1);
+                       f = bound(0, (self.pain_finished - time) / autocvar_g_ctf_flag_returntime, 1);
                        //print("factor is ", ftos(f), "\n");
                        f = ctf_score_value("score_pickup_dropped_late") * (1-f)
                          + ctf_score_value("score_pickup_dropped_early") * f;
@@ -727,7 +727,7 @@ void item_flag_postspawn()
 { // Check CTF Item Flag Post Spawn
 
        // Flag Glow Trail Support
-       if(cvar("g_ctf_flag_glowtrails"))
+       if(autocvar_g_ctf_flag_glowtrails)
        { // Provide Flag Glow Trail
                if(self.team == COLOR_TEAM1)
                        // Red
@@ -792,11 +792,11 @@ void spawnfunc_item_flag_team1()
        }
        self.netname = "^1RED^7 flag";
        self.target = "###item###";
-       self.skin = cvar("g_ctf_flag_red_skin");
+       self.skin = autocvar_g_ctf_flag_red_skin;
        if(self.spawnflags & 1)
                self.noalign = 1;
        if (!self.model)
-               self.model = cvar_string("g_ctf_flag_red_model");
+               self.model = autocvar_g_ctf_flag_red_model;
        if (!self.noise)
                self.noise = "ctf/red_taken.wav";
        if (!self.noise1)
@@ -826,9 +826,9 @@ void spawnfunc_item_flag_team1()
        //      self.glow_size = 50;
 
        self.effects = self.effects | EF_LOWPRECISION;
-       if(cvar("g_ctf_fullbrightflags"))
+       if(autocvar_g_ctf_fullbrightflags)
                self.effects |= EF_FULLBRIGHT;
-       if(cvar("g_ctf_dynamiclights"))
+       if(autocvar_g_ctf_dynamiclights)
                self.effects |= EF_RED;
 
        // From Spidflisk
@@ -890,11 +890,11 @@ void spawnfunc_item_flag_team2()
        }
        self.netname = "^4BLUE^7 flag";
        self.target = "###item###";
-       self.skin = cvar("g_ctf_flag_blue_skin");
+       self.skin = autocvar_g_ctf_flag_blue_skin;
        if(self.spawnflags & 1)
                self.noalign = 1;
        if (!self.model)
-               self.model = cvar_string("g_ctf_flag_blue_model");
+               self.model = autocvar_g_ctf_flag_blue_model;
        if (!self.noise)
                self.noise = "ctf/blue_taken.wav";
        if (!self.noise1)
@@ -924,9 +924,9 @@ void spawnfunc_item_flag_team2()
        //      self.glow_size = 50;
 
        self.effects = self.effects | EF_LOWPRECISION;
-       if(cvar("g_ctf_fullbrightflags"))
+       if(autocvar_g_ctf_fullbrightflags)
                self.effects |= EF_FULLBRIGHT;
-       if(cvar("g_ctf_dynamiclights"))
+       if(autocvar_g_ctf_dynamiclights)
                self.effects |= EF_BLUE;
 
        // From Spidflisk
@@ -1005,9 +1005,9 @@ void ctf_init()
        InitializeEntity(world, ctf_delayedinit, INITPRIO_GAMETYPE);
        flagcaptimerecord = stof(db_get(ServerProgsDB, strcat(GetMapname(), "/captimerecord/time")));
 
-       captureshield_min_negscore = cvar("g_ctf_shield_min_negscore");
-       captureshield_max_ratio = cvar("g_ctf_shield_max_ratio");
-       captureshield_force = cvar("g_ctf_shield_force");
+       captureshield_min_negscore = autocvar_g_ctf_shield_min_negscore;
+       captureshield_max_ratio = autocvar_g_ctf_shield_max_ratio;
+       captureshield_force = autocvar_g_ctf_shield_force;
 };
 
 void ctf_setstatus2(entity flag, float shift)
index dec2988e3b15b4aab1056f38f94bc74203123a64..cd2f8912ef2b2a908417f8074c60aa01d17e8c54 100644 (file)
@@ -271,13 +271,13 @@ float isJoinAllowed();
 
 //sv_timeout: pauses the game by setting the gamespeed to a really low value (see TIMEOUT_SLOWMO_VALUE)
 #define TIMEOUT_SLOWMO_VALUE 0.0001
-float sys_frametime; // gets initialised in worlspawn, saves the value from cvar("sys_ticrate")
+float sys_frametime; // gets initialised in worlspawn, saves the value from autocvar_sys_ticrate
 float remainingTimeoutTime; // contains the time in seconds that the active timeout has left
 float remainingLeadTime; // contains the number of seconds left of the leadtime (before the timeout starts)
 float timeoutStatus; // (values: 0, 1, 2) contains whether a timeout is not active (0), was called but still at leadtime (1) or is active (2)
 .float allowedTimeouts; // contains the number of allowed timeouts for each player
 entity timeoutInitiator; // contains the entity of the player who started the last timeout
-float orig_slowmo; // contains the value of cvar("slowmo") so that, after timeout finished, it isn't set to slowmo 1 necessarily
+float orig_slowmo; // contains the value of autocvar_slowmo so that, after timeout finished, it isn't set to slowmo 1 necessarily
 .vector lastV_angle; //used when pausing the game in order to force the player to keep his old view angle fixed
 entity timeoutHandler; //responsible for centerprinting the timeout countdowns and playing sounds
 void timeoutHandler_Think();
index 10fc2a1ab4aa190bbfa09c83ed37b75c51e650f5..891863f97a3a32daa771675391405563ad4675ca 100644 (file)
@@ -26,7 +26,7 @@ void() dom_controlpoint_setup;
 void LogDom(string mode, float team_before, entity actor)
 {
        string s;
-       if(!cvar("sv_eventlog"))
+       if(!autocvar_sv_eventlog)
                return;
        s = strcat(":dom:", mode);
        s = strcat(s, ":", ftos(team_before));
@@ -64,12 +64,12 @@ void dompoint_captured ()
        //bprint("\n");
 
        float points, wait_time;
-       if (cvar("g_domination_point_amt"))
-               points = cvar("g_domination_point_amt");
+       if (autocvar_g_domination_point_amt)
+               points = autocvar_g_domination_point_amt;
        else
                points = self.frags;
-       if (cvar("g_domination_point_rate"))
-               wait_time = cvar("g_domination_point_rate");
+       if (autocvar_g_domination_point_rate)
+               wait_time = autocvar_g_domination_point_rate;
        else
                wait_time = self.wait;
 
@@ -92,7 +92,7 @@ void dompoint_captured ()
        if (head.noise1 != "")
                play2all(head.noise1);
 
-       //self.nextthink = time + cvar("g_domination_point_rate");
+       //self.nextthink = time + autocvar_g_domination_point_rate;
        //self.think = dompointthink;
 
        self.delay = time + wait_time;
@@ -157,8 +157,8 @@ void dompointthink()
        if (gameover || self.delay > time || time < game_starttime)     // game has ended, don't keep giving points
                return;
 
-       if(cvar("g_domination_point_rate"))
-               self.delay = time + cvar("g_domination_point_rate");
+       if(autocvar_g_domination_point_rate)
+               self.delay = time + autocvar_g_domination_point_rate;
        else
                self.delay = time + self.wait;
 
@@ -166,8 +166,8 @@ void dompointthink()
        // NOTE: this defaults to 0
        if (self.goalentity.netname != "")
        {
-               if(cvar("g_domination_point_amt"))
-                       fragamt = cvar("g_domination_point_amt");
+               if(autocvar_g_domination_point_amt)
+                       fragamt = autocvar_g_domination_point_amt;
                else
                        fragamt = self.DOMPOINTFRAGS;
                TeamScore_AddToTeam(self.goalentity.team, ST_SCORE, fragamt);
@@ -264,7 +264,7 @@ Keys:
 
 void spawnfunc_dom_team()
 {
-       if(!g_domination || cvar("g_domination_teams_override") >= 2)
+       if(!g_domination || autocvar_g_domination_teams_override >= 2)
        {
                remove(self);
                return;
@@ -339,8 +339,8 @@ void dom_controlpoint_setup()
        float c1, c2, c3, c4, totalteams, smallestteam, smallestteam_count, selectedteam;
        float balance_teams, force_balance, balance_type;
 
-       balance_teams = cvar("g_balance_teams");
-       balance_teams = cvar("g_balance_teams_force");
+       balance_teams = autocvar_g_balance_teams;
+       balance_teams = autocvar_g_balance_teams_force;
 
        c1 = c2 = c3 = c4 = -1;
        totalteams = 0;
@@ -541,7 +541,7 @@ void spawnfunc_dom_controlpoint()
        //if(!self.glow_size)
        //      self.glow_size = cvar("g_domination_point_glow");
        self.effects = self.effects | EF_LOWPRECISION;
-       if (cvar("g_domination_point_fullbright"))
+       if (autocvar_g_domination_point_fullbright)
                self.effects |= EF_FULLBRIGHT;
 };
 
@@ -590,10 +590,10 @@ void dom_spawnpoint(vector org)
 void dom_spawnteams()
 {
        float numteams;
-       if(cvar("g_domination_teams_override") < 2)
-               numteams = cvar("g_domination_default_teams");
+       if(autocvar_g_domination_teams_override < 2)
+               numteams = autocvar_g_domination_default_teams;
        else
-               numteams = cvar("g_domination_teams_override");
+               numteams = autocvar_g_domination_teams_override;
        // LordHavoc: edit this if you want to change defaults
        dom_spawnteam("Red", COLOR_TEAM1-1, "models/domination/dom_red.md3", 0, "domination/claim.wav", "", "Red team has captured a control point");
        dom_spawnteam("Blue", COLOR_TEAM2-1, "models/domination/dom_blue.md3", 0, "domination/claim.wav", "", "Blue team has captured a control point");
@@ -609,7 +609,7 @@ void dom_delayedinit()
        local entity head;
 
        // if no teams are found, spawn defaults, if custom teams are set, use them
-       if (find(world, classname, "dom_team") == world || cvar("g_domination_teams_override") >= 2)
+       if (find(world, classname, "dom_team") == world || autocvar_g_domination_teams_override >= 2)
                dom_spawnteams();
        // if no control points are found, spawn defaults
        if (find(world, classname, "dom_controlpoint") == world)
index 8998c6afbc16c9771c894a30f776e35e8a6bc3b9..f064e53593fbb65ef03a7e62b180c68499d88ab8 100644 (file)
@@ -133,7 +133,7 @@ void GiveFrags (entity attacker, entity targ, float f)
        PlayerScore_Add(targ, SP_DEATHS, 1);
 
        if(g_arena || g_ca)
-               if(cvar("g_arena_roundbased"))
+               if(autocvar_g_arena_roundbased)
                        return;
 
        if(targ != attacker) // not for suicides
@@ -231,7 +231,7 @@ string AppendItemcodes(string s, entity player)
 void LogDeath(string mode, float deathtype, entity killer, entity killed)
 {
        string s;
-       if(!cvar("sv_eventlog"))
+       if(!autocvar_sv_eventlog)
                return;
        s = strcat(":kill:", mode);
        s = strcat(s, ":", ftos(killer.playerid));
@@ -353,7 +353,7 @@ void Obituary (entity attacker, entity inflictor, entity targ, float deathtype)
                                        Send_CSQC_Centerprint(targ, "", "", KILL_FIRST_VICTIM, MSG_KILL);
                                }
 
-                               if((cvar("sv_fragmessage_information_typefrag")) && (targ.BUTTON_CHAT)) {
+                               if((autocvar_sv_fragmessage_information_typefrag) && (targ.BUTTON_CHAT)) {
                                        Send_CSQC_Centerprint(attacker, s, GetAdvancedDeathReports(targ), KILL_TYPEFRAG, MSG_KILL);
                                        Send_CSQC_Centerprint(targ, a, GetAdvancedDeathReports(attacker), KILL_TYPEFRAGGED, MSG_KILL);
                                } else {
@@ -549,20 +549,20 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float
                                        {
                                                if(targ.classname == "player" && targ.deadflag == DEAD_NO)
                                                {
-                                                       teamdamage0 = max(attacker.dmg_team, cvar("g_teamdamage_threshold"));
+                                                       teamdamage0 = max(attacker.dmg_team, autocvar_g_teamdamage_threshold);
                                                        attacker.dmg_team = attacker.dmg_team + damage;
                                                        if(attacker.dmg_team > teamdamage0 && !g_ca)
-                                                               mirrordamage = cvar("g_mirrordamage") * (attacker.dmg_team - teamdamage0);
-                                                       mirrorforce = cvar("g_mirrordamage") * vlen(force);
+                                                               mirrordamage = autocvar_g_mirrordamage * (attacker.dmg_team - teamdamage0);
+                                                       mirrorforce = autocvar_g_mirrordamage * vlen(force);
                                                        if(g_minstagib)
                                                        {
-                                                               if(cvar("g_friendlyfire") == 0)
+                                                               if(autocvar_g_friendlyfire == 0)
                                                                        damage = 0;
                                                        }
                                                        else if(g_ca)
                                                                damage = 0;
                                                        else
-                                                               damage = cvar("g_friendlyfire") * damage;
+                                                               damage = autocvar_g_friendlyfire * damage;
                                                        // mirrordamage will be used LATER
                                                }
                                                else
@@ -576,8 +576,8 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float
                if(attacker.classname == "player")
                if(attacker != targ)
                {
-                       targ.lms_traveled_distance = cvar("g_lms_campcheck_distance");
-                       attacker.lms_traveled_distance = cvar("g_lms_campcheck_distance");
+                       targ.lms_traveled_distance = autocvar_g_lms_campcheck_distance;
+                       attacker.lms_traveled_distance = autocvar_g_lms_campcheck_distance;
                }
 
                if(targ.classname == "player")
@@ -641,26 +641,26 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float
                {
                        if(targ == attacker)
                        {
-                               damage = damage * cvar("g_balance_powerup_strength_selfdamage");
-                               force = force * cvar("g_balance_powerup_strength_selfforce");
+                               damage = damage * autocvar_g_balance_powerup_strength_selfdamage;
+                               force = force * autocvar_g_balance_powerup_strength_selfforce;
                        }
                        else
                        {
-                               damage = damage * cvar("g_balance_powerup_strength_damage");
-                               force = force * cvar("g_balance_powerup_strength_force");
+                               damage = damage * autocvar_g_balance_powerup_strength_damage;
+                               force = force * autocvar_g_balance_powerup_strength_force;
                        }
                }
 
                // apply invincibility multiplier
                if (targ.items & IT_INVINCIBLE && !g_minstagib)
-                       damage = damage * cvar("g_balance_powerup_invincible_takedamage");
+                       damage = damage * autocvar_g_balance_powerup_invincible_takedamage;
 
                if (targ == attacker)
                {
-                       if(g_ca || (g_cts && !cvar("g_cts_selfdamage")))
+                       if(g_ca || (g_cts && !autocvar_g_cts_selfdamage))
                                damage = 0;
                        else
-                               damage = damage * cvar("g_balance_selfdamagepercent");  // Partial damage if the attacker hits himself
+                               damage = damage * autocvar_g_balance_selfdamagepercent; // Partial damage if the attacker hits himself
                }
 
                // CTF: reduce damage/force
@@ -668,8 +668,8 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float
                if(targ == attacker)
                if(targ.flagcarried)
                {
-                       damage = damage * cvar("g_ctf_flagcarrier_selfdamage");
-                       force = force * cvar("g_ctf_flagcarrier_selfforce");
+                       damage = damage * autocvar_g_ctf_flagcarrier_selfdamage;
+                       force = force * autocvar_g_ctf_flagcarrier_selfforce;
                }
 
                if(g_runematch)
@@ -679,31 +679,31 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float
                        {
                                if(attacker.runes & CURSE_WEAK) // have both curse & rune
                                {
-                                       damage = damage * cvar("g_balance_rune_strength_combo_damage");
-                                       force = force * cvar("g_balance_rune_strength_combo_force");
+                                       damage = damage * autocvar_g_balance_rune_strength_combo_damage;
+                                       force = force * autocvar_g_balance_rune_strength_combo_force;
                                }
                                else
                                {
-                                       damage = damage * cvar("g_balance_rune_strength_damage");
-                                       force = force * cvar("g_balance_rune_strength_force");
+                                       damage = damage * autocvar_g_balance_rune_strength_damage;
+                                       force = force * autocvar_g_balance_rune_strength_force;
                                }
                        }
                        else if (attacker.runes & CURSE_WEAK)
                        {
-                               damage = damage * cvar("g_balance_curse_weak_damage");
-                               force = force * cvar("g_balance_curse_weak_force");
+                               damage = damage * autocvar_g_balance_curse_weak_damage;
+                               force = force * autocvar_g_balance_curse_weak_force;
                        }
 
                        // apply defense rune
                        if (targ.runes & RUNE_DEFENSE)
                        {
                                if (targ.runes & CURSE_VULNER) // have both curse & rune
-                                       damage = damage * cvar("g_balance_rune_defense_combo_takedamage");
+                                       damage = damage * autocvar_g_balance_rune_defense_combo_takedamage;
                                else
-                                       damage = damage * cvar("g_balance_rune_defense_takedamage");
+                                       damage = damage * autocvar_g_balance_rune_defense_takedamage;
                        }
                        else if (targ.runes & CURSE_VULNER)
-                               damage = damage * cvar("g_balance_curse_vulner_takedamage");
+                               damage = damage * autocvar_g_balance_curse_vulner_takedamage;
                }
 
                // count the damage
@@ -739,7 +739,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float
                                {
                                        if(damage > 0)
                                        {
-                                               if(attacker.weapon != WEP_ELECTRO && attacker.weapon != WEP_LASER || ((attacker.weapon == WEP_ELECTRO && cvar("g_balance_electro_lightning") || attacker.weapon == WEP_LASER) && attacker.prevhitsound + cvar("sv_hitsound_antispam_time") < time))
+                                               if(attacker.weapon != WEP_ELECTRO && attacker.weapon != WEP_LASER || ((attacker.weapon == WEP_ELECTRO && autocvar_g_balance_electro_lightning || attacker.weapon == WEP_LASER) && attacker.prevhitsound + autocvar_sv_hitsound_antispam_time < time))
                                                {
                                                        if(targ.BUTTON_CHAT)
                                                                attacker.typehitsound += 1;
@@ -765,7 +765,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float
                                                                headshot = 1;
                                                }
                                                if(g_ca)
-                                                       PlayerScore_Add(attacker, SP_SCORE, damage * cvar("g_ca_damage2score_multiplier"));
+                                                       PlayerScore_Add(attacker, SP_SCORE, damage * autocvar_g_ca_damage2score_multiplier);
                                        }
                                }
                                else
@@ -808,28 +808,28 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float
                        // apply vampire rune
                                if (attacker.runes & CURSE_EMPATHY) // have the curse too
                                {
-                                       //attacker.health = attacker.health + damage * cvar("g_balance_rune_vampire_combo_absorb");
+                                       //attacker.health = attacker.health + damage * autocvar_g_balance_rune_vampire_combo_absorb;
                                        attacker.health = bound(
-                                               cvar("g_balance_curse_empathy_minhealth"), // LA: was 3, now 40
-                                               attacker.health + damage * cvar("g_balance_rune_vampire_combo_absorb"),
-                                               cvar("g_balance_rune_vampire_maxhealth"));      // LA: was 1000, now 500
+                                               autocvar_g_balance_curse_empathy_minhealth, // LA: was 3, now 40
+                                               attacker.health + damage * autocvar_g_balance_rune_vampire_combo_absorb,
+                                               autocvar_g_balance_rune_vampire_maxhealth);     // LA: was 1000, now 500
                                }
                                else
                                {
-                                       //attacker.health = attacker.health + damage * cvar("g_balance_rune_vampire_absorb");
+                                       //attacker.health = attacker.health + damage * autocvar_g_balance_rune_vampire_absorb;
                                        attacker.health = bound(
                                                attacker.health,        // LA: was 3, but changed so that you can't lose health
                                                                                        // empathy won't let you gain health in the same way...
-                                               attacker.health + damage * cvar("g_balance_rune_vampire_absorb"),
-                                               cvar("g_balance_rune_vampire_maxhealth"));      // LA: was 1000, now 500
+                                               attacker.health + damage * autocvar_g_balance_rune_vampire_absorb,
+                                               autocvar_g_balance_rune_vampire_maxhealth);     // LA: was 1000, now 500
                                        }
                        }
                        // apply empathy curse
                        else if (attacker.runes & CURSE_EMPATHY)
                        {
                                attacker.health = bound(
-                                       cvar("g_balance_curse_empathy_minhealth"), // LA: was 3, now 20
-                                       attacker.health + damage * cvar("g_balance_curse_empathy_takedamage"),
+                                       autocvar_g_balance_curse_empathy_minhealth, // LA: was 3, now 20
+                                       attacker.health + damage * autocvar_g_balance_curse_empathy_takedamage,
                                        attacker.health);
                        }
                }
@@ -883,8 +883,8 @@ float RadiusDamage (entity inflictor, entity attacker, float coredamage, float e
 
        RadiusDamage_running = 1;
 
-       tfloordmg = cvar("g_throughfloor_damage");
-       tfloorforce = cvar("g_throughfloor_force");
+       tfloordmg = autocvar_g_throughfloor_damage;
+       tfloorforce = autocvar_g_throughfloor_force;
 
        blastorigin = (inflictor.origin + (inflictor.mins + inflictor.maxs) * 0.5);
        total_damage_to_creatures = 0;
@@ -986,16 +986,16 @@ float RadiusDamage (entity inflictor, entity attacker, float coredamage, float e
                                                        float force_velocitybiasramp;
                                                        float force_velocitybias;
 
-                                                       force_velocitybiasramp = cvar("sv_maxspeed");
+                                                       force_velocitybiasramp = autocvar_sv_maxspeed;
                                                        if(deathtype & HITTYPE_SECONDARY)
                                                        {
-                                                               force_zscale = cvar("g_balance_laser_secondary_force_zscale");
-                                                               force_velocitybias = cvar("g_balance_laser_secondary_force_velocitybias");
+                                                               force_zscale = autocvar_g_balance_laser_secondary_force_zscale;
+                                                               force_velocitybias = autocvar_g_balance_laser_secondary_force_velocitybias;
                                                        }
                                                        else
                                                        {
-                                                               force_zscale = cvar("g_balance_laser_primary_force_zscale");
-                                                               force_velocitybias = cvar("g_balance_laser_primary_force_velocitybias");
+                                                               force_zscale = autocvar_g_balance_laser_primary_force_zscale;
+                                                               force_velocitybias = autocvar_g_balance_laser_primary_force_velocitybias;
                                                        }
 
                                                        vel = targ.velocity;
@@ -1200,8 +1200,8 @@ void Fire_ApplyDamage(entity e)
                if not(IS_INDEPENDENT_PLAYER(other))
                if(boxesoverlap(e.absmin, e.absmax, other.absmin, other.absmax))
                {
-                       t = cvar("g_balance_firetransfer_time") * (e.fire_endtime - time);
-                       d = cvar("g_balance_firetransfer_damage") * e.fire_damagepersec * t;
+                       t = autocvar_g_balance_firetransfer_time * (e.fire_endtime - time);
+                       d = autocvar_g_balance_firetransfer_damage * e.fire_damagepersec * t;
                        Fire_AddDamage(other, o, d, t, DEATH_FIRE);
                }
        }
index 08cb128abd0eb220b5f9fc6d26462c32ba0c6369..ef379b9bc53bc0048d76bd335c4307c28f1b9735 100644 (file)
@@ -175,24 +175,24 @@ void GrapplingHookThink()
 
        if(self.state == 1)
        {
-               pullspeed = cvar("g_balance_grapplehook_speed_pull");//2000;
+               pullspeed = autocvar_g_balance_grapplehook_speed_pull;//2000;
                // speed the rope is pulled with
 
-               rubberforce = cvar("g_balance_grapplehook_force_rubber");//2000;
+               rubberforce = autocvar_g_balance_grapplehook_force_rubber;//2000;
                // force the rope will use if it is stretched
 
-               rubberforce_overstretch = cvar("g_balance_grapplehook_force_rubber_overstretch");//1000;
+               rubberforce_overstretch = autocvar_g_balance_grapplehook_force_rubber_overstretch;//1000;
                // force the rope will use if it is stretched
 
-               minlength = cvar("g_balance_grapplehook_length_min");//100;
+               minlength = autocvar_g_balance_grapplehook_length_min;//100;
                // minimal rope length
                // if the rope goes below this length, it isn't pulled any more
 
-               ropestretch = cvar("g_balance_grapplehook_stretch");//400;
+               ropestretch = autocvar_g_balance_grapplehook_stretch;//400;
                // if the rope is stretched by more than this amount, more rope is
                // given to you again
 
-               ropeairfriction = cvar("g_balance_grapplehook_airfriction");//0.2
+               ropeairfriction = autocvar_g_balance_grapplehook_airfriction;//0.2
                // while hanging on the rope, this friction component will help you a
                // bit to control the rope
 
@@ -200,7 +200,7 @@ void GrapplingHookThink()
                dist = vlen(dir);
                dir = normalize(dir);
 
-               if(cvar("g_grappling_hook_tarzan"))
+               if(autocvar_g_grappling_hook_tarzan)
                {
                        v = v0 = WarpZone_RefSys_TransformVelocity(self.owner, self, self.owner.velocity);
 
@@ -233,7 +233,7 @@ void GrapplingHookThink()
                                v = v + frametime * dir * spd * rubberforce;
 
                                dv = ((v - v0) * dir) * dir;
-                               if(cvar("g_grappling_hook_tarzan") >= 2)
+                               if(autocvar_g_grappling_hook_tarzan >= 2)
                                {
                                        if(self.aiment.movetype == MOVETYPE_WALK)
                                        {
@@ -241,7 +241,7 @@ void GrapplingHookThink()
                                                self.aiment.velocity = self.aiment.velocity - dv * 0.5;
                                                self.aiment.flags &~= FL_ONGROUND;
                                                self.aiment.pusher = self.owner;
-                                               self.aiment.pushltime = time + cvar("g_maxpushtime");
+                                               self.aiment.pushltime = time + autocvar_g_maxpushtime;
                                        }
                                }
 
@@ -315,7 +315,7 @@ void GrapplingHook_Damage (entity inflictor, entity attacker, float damage, floa
                        if(attacker != self.owner)
                        {
                                self.owner.pusher = attacker;
-                               self.owner.pushltime = time + cvar("g_maxpushtime");
+                               self.owner.pushltime = time + autocvar_g_maxpushtime;
                        }
                        RemoveGrapplingHook(self.owner);
                }
@@ -363,7 +363,7 @@ void FireGrapplingHook (void)
 
        missile.state = 0; // not latched onto anything
 
-       W_SetupProjectileVelocityEx(missile, v_forward, v_up, cvar("g_balance_grapplehook_speed_fly"), 0, 0, 0, FALSE);
+       W_SetupProjectileVelocityEx(missile, v_forward, v_up, autocvar_g_balance_grapplehook_speed_fly, 0, 0, 0, FALSE);
 
        missile.angles = vectoangles (missile.velocity);
        //missile.glow_color = 250; // 244, 250
@@ -374,7 +374,7 @@ void FireGrapplingHook (void)
 
        missile.effects = /*EF_FULLBRIGHT | EF_ADDITIVE |*/ EF_LOWPRECISION;
 
-       missile.health = cvar("g_balance_grapplehook_health");//120
+       missile.health = autocvar_g_balance_grapplehook_health;//120
        missile.event_damage = GrapplingHook_Damage;
        missile.takedamage = DAMAGE_AIM;
        missile.damageforcescale = 0;
index 5d8401df98e934d637822e419582270db3484c14..500240d6ce4aee4c96220ee9dc9d4bec52ebf5e2 100644 (file)
@@ -364,13 +364,13 @@ void traceline_antilag_force (entity source, vector v1, vector v2, float nomonst
 }
 void traceline_antilag (entity source, vector v1, vector v2, float nomonst, entity forent, float lag)
 {
-       if (cvar("g_antilag") != 2 || source.cvar_cl_noantilag)
+       if (autocvar_g_antilag != 2 || source.cvar_cl_noantilag)
                lag = 0;
        traceline_antilag_force(source, v1, v2, nomonst, forent, lag);
 }
 void tracebox_antilag (entity source, vector v1, vector mi, vector ma, vector v2, float nomonst, entity forent, float lag)
 {
-       if (cvar("g_antilag") != 2 || source.cvar_cl_noantilag)
+       if (autocvar_g_antilag != 2 || source.cvar_cl_noantilag)
                lag = 0;
        tracebox_antilag_force_wz(source, v1, mi, ma, v2, nomonst, forent, lag, FALSE);
 }
@@ -380,13 +380,13 @@ void WarpZone_traceline_antilag_force (entity source, vector v1, vector v2, floa
 }
 void WarpZone_traceline_antilag (entity source, vector v1, vector v2, float nomonst, entity forent, float lag)
 {
-       if (cvar("g_antilag") != 2 || source.cvar_cl_noantilag)
+       if (autocvar_g_antilag != 2 || source.cvar_cl_noantilag)
                lag = 0;
        WarpZone_traceline_antilag_force(source, v1, v2, nomonst, forent, lag);
 }
 void WarpZone_tracebox_antilag (entity source, vector v1, vector mi, vector ma, vector v2, float nomonst, entity forent, float lag)
 {
-       if (cvar("g_antilag") != 2 || source.cvar_cl_noantilag)
+       if (autocvar_g_antilag != 2 || source.cvar_cl_noantilag)
                lag = 0;
        tracebox_antilag_force_wz(source, v1, mi, ma, v2, nomonst, forent, lag, TRUE);
 }
@@ -609,9 +609,9 @@ float LOD_customize()
 {
        float d;
 
-       if(cvar("loddebug"))
+       if(autocvar_loddebug)
        {
-               d = cvar("loddebug");
+               d = autocvar_loddebug;
                if(d == 1)
                        self.modelindex = self.lodmodelindex0;
                else if(d == 2 || !self.lodmodelindex2)
@@ -667,7 +667,7 @@ void LODmodel_attach()
                }
        }
 
-       if(cvar("loddebug") < 0)
+       if(autocvar_loddebug < 0)
        {
                self.lodmodel1 = self.lodmodel2 = ""; // don't even initialize
        }
index 4a66f229380ea9c505962ae4e5aa0abe9674d171..79e1b5f4610dbb83fd98c1c63029e37065e05d90 100644 (file)
@@ -516,7 +516,7 @@ void trigger_heal_touch()
                        if (other.health < self.max_health)
                        {
                                other.health = min(other.health + self.health, self.max_health);
-                               other.pauserothealth_finished = max(other.pauserothealth_finished, time + cvar("g_balance_pause_health_rot"));
+                               other.pauserothealth_finished = max(other.pauserothealth_finished, time + autocvar_g_balance_pause_health_rot);
                                sound (other, CHAN_AUTO, self.noise, VOL_BASE, ATTN_NORM);
                        }
                }
@@ -1400,7 +1400,7 @@ void spawnfunc_trigger_impulse()
        EXACTTRIGGER_INIT;
     if(self.radius)
     {
-        if(!self.strength) self.strength = 2000 * cvar("g_triggerimpulse_radial_multiplier");
+        if(!self.strength) self.strength = 2000 * autocvar_g_triggerimpulse_radial_multiplier;
         setorigin(self, self.origin);
         setsize(self, '-1 -1 -1' * self.radius,'1 1 1' * self.radius);
         self.touch = trigger_impulse_touch3;
@@ -1409,13 +1409,13 @@ void spawnfunc_trigger_impulse()
     {
         if(self.target)
         {
-            if(!self.strength) self.strength = 950 * cvar("g_triggerimpulse_directional_multiplier");
+            if(!self.strength) self.strength = 950 * autocvar_g_triggerimpulse_directional_multiplier;
             self.touch = trigger_impulse_touch1;
         }
         else
         {
             if(!self.strength) self.strength = 0.9;
-                       self.strength = pow(self.strength, cvar("g_triggerimpulse_accel_power")) * cvar("g_triggerimpulse_accel_multiplier");
+                       self.strength = pow(self.strength, autocvar_g_triggerimpulse_accel_power) * autocvar_g_triggerimpulse_accel_multiplier;
             self.touch = trigger_impulse_touch2;
         }
     }
index b898e147b9441d560211dabe48ef38efcee47993..18ddcdae85bc66c778c0217dacba93b2d3c08b4e 100644 (file)
@@ -50,19 +50,19 @@ float() DoNextMapOverride;
 
 void SetDefaultAlpha()
 {
-       if(cvar("g_running_guns"))
+       if(autocvar_g_running_guns)
        {
                default_player_alpha = -1;
                default_weapon_alpha = +1;
        }
        else if(g_cloaked)
        {
-               default_player_alpha = cvar("g_balance_cloaked_alpha");
+               default_player_alpha = autocvar_g_balance_cloaked_alpha;
                default_weapon_alpha = default_player_alpha;
        }
        else
        {
-               default_player_alpha = cvar("g_player_alpha");
+               default_player_alpha = autocvar_g_player_alpha;
                if(default_player_alpha == 0)
                        default_player_alpha = 1;
                default_weapon_alpha = default_player_alpha;
@@ -73,7 +73,7 @@ void fteqcc_testbugs()
 {
        float a, b;
 
-       if(!cvar("developer_fteqccbugs"))
+       if(!autocvar_developer_fteqccbugs)
                return;
 
        dprint("*** fteqcc test: checking for bugs...\n");
@@ -139,7 +139,7 @@ void timeoutHandler_Think() {
                                        centerprint_atprio(plr, CENTERPRIO_SPAM, timeStr);
                                }
                        }
-                       if(remainingTimeoutTime == cvar("sv_timeout_resumetime")) { //play a warning sound when only <sv_timeout_resumetime> seconds are left
+                       if(remainingTimeoutTime == autocvar_sv_timeout_resumetime) { //play a warning sound when only <sv_timeout_resumetime> seconds are left
                                Announce("prepareforbattle");
                        }
                        remainingTimeoutTime -= 1;
@@ -178,15 +178,15 @@ void timeoutHandler_Think() {
 void GotoFirstMap()
 {
        float n;
-       if(cvar("_sv_init"))
+       if(autocvar__sv_init)
        {
                // cvar_set("_sv_init", "0");
                // we do NOT set this to 0 any more, so someone "accidentally" changing
                // to this "init" map on a dedicated server will cause no permanent
                // harm
-               if(cvar("g_maplist_shuffle"))
+               if(autocvar_g_maplist_shuffle)
                        ShuffleMaplist();
-               n = tokenizebyseparator(cvar_string("g_maplist"), " ");
+               n = tokenizebyseparator(autocvar_g_maplist, " ");
                cvar_set("g_maplist_index", ftos(n - 1)); // jump to map 0 in GotoNextMap
 
                MapInfo_Enumerate();
@@ -446,7 +446,7 @@ void cvar_changes_init()
                BADCVAR("sv_vote_simple_majority_factor");
                BADCVAR("timelimit_override");
 
-               if(cvar("g_minstagib"))
+               if(autocvar_g_minstagib)
                {
                        BADCVAR("g_grappling_hook");
                        BADCVAR("g_jetpack");
@@ -655,7 +655,7 @@ void spawnfunc_worldspawn (void)
        // 63 testing
        lightstyle(63, "a");
 
-       if(cvar("g_campaign"))
+       if(autocvar_g_campaign)
                CampaignPreInit();
 
        Map_MarkAsRecent(mapname);
@@ -668,13 +668,13 @@ void spawnfunc_worldspawn (void)
        LaserInit();
 
        player_count = 0;
-       bot_waypoints_for_items = cvar("g_waypoints_for_items");
+       bot_waypoints_for_items = autocvar_g_waypoints_for_items;
        if(bot_waypoints_for_items == 1)
                if(self.spawnflags & SPAWNFLAG_NO_WAYPOINTS_FOR_ITEMS)
                        bot_waypoints_for_items = 0;
 
        // for setting by mapinfo
-       q3acompat_machineshotgunswap = cvar("sv_q3acompat_machineshotgunswap");
+       q3acompat_machineshotgunswap = autocvar_sv_q3acompat_machineshotgunswap;
        cvar_set("sv_q3acompat_machineshotgunswap", "0");
 
        precache();
@@ -685,9 +685,9 @@ void spawnfunc_worldspawn (void)
        //      dom_init();
 
        GameLogInit(); // prepare everything
-       if(cvar("sv_eventlog"))
+       if(autocvar_sv_eventlog)
        {
-               s = strcat(ftos(cvar("sv_eventlog_files_counter")), ".");
+               s = strcat(ftos(autocvar_sv_eventlog_files_counter), ".");
                s = strcat(s, ftos(random()));
                matchid = strzone(s);
 
@@ -699,31 +699,31 @@ void spawnfunc_worldspawn (void)
                s = ret_string;
 
                // simple, probably not good in the mutator system
-               if(cvar("g_grappling_hook"))
+               if(autocvar_g_grappling_hook)
                        s = strcat(s, ":grappling_hook");
 
                // initialiation stuff, not good in the mutator system
-               if(!cvar("g_use_ammunition"))
+               if(!autocvar_g_use_ammunition)
                        s = strcat(s, ":no_use_ammunition");
 
                // initialiation stuff, not good in the mutator system
-               if(!cvar("g_pickup_items"))
+               if(!autocvar_g_pickup_items)
                        s = strcat(s, ":no_pickup_items");
 
                // initialiation stuff, not good in the mutator system
-               if(cvar_string("g_weaponarena") != "0")
-                       s = strcat(s, ":", cvar_string("g_weaponarena"), " arena");
+               if(autocvar_g_weaponarena != "0")
+                       s = strcat(s, ":", autocvar_g_weaponarena, " arena");
 
                // TODO to mutator system
-               if(cvar("g_norecoil"))
+               if(autocvar_g_norecoil)
                        s = strcat(s, ":norecoil");
 
                // TODO to mutator system
-               if(cvar("g_midair"))
+               if(autocvar_g_midair)
                        s = strcat(s, ":midair");
 
                // TODO to mutator system
-               if(cvar("g_minstagib"))
+               if(autocvar_g_minstagib)
                        s = strcat(s, ":minstagib");
 
                GameLogEcho(s);
@@ -736,7 +736,7 @@ void spawnfunc_worldspawn (void)
 
        SetDefaultAlpha();
 
-       if(cvar("g_campaign"))
+       if(autocvar_g_campaign)
                CampaignPostInit();
 
        fteqcc_testbugs();
@@ -849,7 +849,7 @@ void spawnfunc_worldspawn (void)
        lsnewmaps_reply = strzone(strcat(lsnewmaps_reply, "\n"));
 
        maplist_reply = "^7Maps in list: ";
-       n = tokenize_console(cvar_string("g_maplist"));
+       n = tokenize_console(autocvar_g_maplist);
        for(i = 0, j = 0; i < n; ++i)
        {
                if(MapInfo_CheckMap(argv(i)))
@@ -883,7 +883,7 @@ void spawnfunc_worldspawn (void)
        localcmd("\n_sv_hook_gamestart ", GetGametype(), "\n");
 
        // fill sv_curl_serverpackages from .serverpackage files
-       if(cvar("sv_curl_serverpackages_auto"))
+       if(autocvar_sv_curl_serverpackages_auto)
        {
                fd = search_begin("*.serverpackage", TRUE, FALSE);
                s = "";
@@ -942,7 +942,7 @@ float GetMaplistPosition()
        string map;
 
        map = GetMapname();
-       idx = cvar("g_maplist_index");
+       idx = autocvar_g_maplist_index;
 
        if(idx >= 0)
                if(idx < Map_Count)
@@ -960,8 +960,8 @@ float GetMaplistPosition()
 float MapHasRightSize(string map)
 {
        float fh;
-       if(currentbots || cvar("bot_number") || player_count < cvar("minplayers"))
-       if(cvar("g_maplist_check_waypoints"))
+       if(currentbots || autocvar_bot_number || player_count < autocvar_minplayers)
+       if(autocvar_g_maplist_check_waypoints)
        {
                dprint("checkwp "); dprint(map);
                fh = fopen(strcat("maps/", map, ".waypoints"), FILE_READ);
@@ -1024,12 +1024,12 @@ float strhasword(string s, string w)
 
 void Map_MarkAsRecent(string m)
 {
-       cvar_set("g_maplist_mostrecent", strwords(strcat(m, " ", cvar_string("g_maplist_mostrecent")), max(0, cvar("g_maplist_mostrecent_count"))));
+       cvar_set("g_maplist_mostrecent", strwords(strcat(m, " ", autocvar_g_maplist_mostrecent), max(0, autocvar_g_maplist_mostrecent_count)));
 }
 
 float Map_IsRecent(string m)
 {
-       return strhasword(cvar_string("g_maplist_mostrecent"), m);
+       return strhasword(autocvar_g_maplist_mostrecent, m);
 }
 
 float Map_Check(float position, float pass)
@@ -1155,7 +1155,7 @@ float(float exponent) MaplistMethod_Shuffle = // more clever shuffling
                        newlist = strcat(newlist, " ", argv(j));
                newlist = substring(newlist, 1, strlen(newlist) - 1);
                cvar_set("g_maplist", newlist);
-               Map_Count = tokenizebyseparator(cvar_string("g_maplist"), " ");
+               Map_Count = tokenizebyseparator(autocvar_g_maplist, " ");
 
                // NOTE: the selected map has just been inserted at (insertpos-1)th position
                Map_Current = insertpos - 1; // this is not really valid, but this way the fallback has a chance of working
@@ -1167,15 +1167,15 @@ float(float exponent) MaplistMethod_Shuffle = // more clever shuffling
 
 void Maplist_Init()
 {
-       Map_Count = tokenizebyseparator(cvar_string("g_maplist"), " ");
+       Map_Count = tokenizebyseparator(autocvar_g_maplist, " ");
        if(Map_Count == 0)
        {
                bprint( "Maplist is empty!  Resetting it to default map list.\n" );
                cvar_set("g_maplist", MapInfo_ListAllowedMaps(MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags()));
-               if(cvar("g_maplist_shuffle"))
+               if(autocvar_g_maplist_shuffle)
                        ShuffleMaplist();
                localcmd("\nmenu_cmd sync\n");
-               Map_Count = tokenizebyseparator(cvar_string("g_maplist"), " ");
+               Map_Count = tokenizebyseparator(autocvar_g_maplist, " ");
        }
        if(Map_Count == 0)
                error("empty maplist, cannot select a new map");
@@ -1196,11 +1196,11 @@ string GetNextMap()
        nextMap = -1;
 
        if(nextMap == -1)
-               if(cvar("g_maplist_shuffle") > 0)
-                       nextMap = MaplistMethod_Shuffle(cvar("g_maplist_shuffle") + 1);
+               if(autocvar_g_maplist_shuffle > 0)
+                       nextMap = MaplistMethod_Shuffle(autocvar_g_maplist_shuffle + 1);
 
        if(nextMap == -1)
-               if(cvar("g_maplist_selectrandom"))
+               if(autocvar_g_maplist_selectrandom)
                        nextMap = MaplistMethod_Random();
 
        if(nextMap == -1)
@@ -1220,13 +1220,13 @@ string GetNextMap()
 
 float DoNextMapOverride()
 {
-       if(cvar("g_campaign"))
+       if(autocvar_g_campaign)
        {
                CampaignPostIntermission();
                alreadychangedlevel = TRUE;
                return TRUE;
        }
-       if(cvar("quit_when_empty"))
+       if(autocvar_quit_when_empty)
        {
                if(player_count <= currentbots)
                {
@@ -1235,13 +1235,13 @@ float DoNextMapOverride()
                        return TRUE;
                }
        }
-       if(cvar_string("quit_and_redirect") != "")
+       if(autocvar_quit_and_redirect != "")
        {
-               redirection_target = strzone(cvar_string("quit_and_redirect"));
+               redirection_target = strzone(autocvar_quit_and_redirect);
                alreadychangedlevel = TRUE;
                return TRUE;
        }
-       if (cvar("samelevel")) // if samelevel is set, stay on same level
+       if (autocvar_samelevel) // if samelevel is set, stay on same level
        {
                // this does not work because it tries to exec maps/nexdm01.mapcfg (which doesn't exist, it should be trying maps/dm_nexdm01.mapcfg for example)
                //localcmd(strcat("exec \"maps/", mapname, ".mapcfg\"\n"));
@@ -1251,15 +1251,15 @@ float DoNextMapOverride()
                alreadychangedlevel = TRUE;
                return TRUE;
        }
-       if(cvar_string("nextmap") != "")
-               if(MapInfo_CheckMap(cvar_string("nextmap")))
+       if(autocvar_nextmap != "")
+               if(MapInfo_CheckMap(autocvar_nextmap))
                {
-                       Map_Goto_SetStr(cvar_string("nextmap"));
+                       Map_Goto_SetStr(autocvar_nextmap);
                        Map_Goto();
                        alreadychangedlevel = TRUE;
                        return TRUE;
                }
-       if(cvar("lastlevel"))
+       if(autocvar_lastlevel)
        {
                GameResetCfg();
                localcmd("set lastlevel 0\ntogglemenu\n");
@@ -1292,7 +1292,7 @@ void GotoNextMap()
                        {
                                bprint( "Maplist contains no single playable map!  Resetting it to default map list.\n" );
                                cvar_set("g_maplist", MapInfo_ListAllowedMaps(MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags()));
-                               if(cvar("g_maplist_shuffle"))
+                               if(autocvar_g_maplist_shuffle)
                                        ShuffleMaplist();
                                localcmd("\nmenu_cmd sync\n");
                        }
@@ -1321,7 +1321,7 @@ void IntermissionThink()
 {
        FixIntermissionClient(self);
 
-       if(cvar("sv_autoscreenshot"))
+       if(autocvar_sv_autoscreenshot)
        if(self.autoscreenshot > 0)
        if(time > self.autoscreenshot)
        {
@@ -1407,9 +1407,9 @@ void DumpStats(float final)
        float i;
        entity e;
 
-       to_console = cvar("sv_logscores_console");
-       to_eventlog = cvar("sv_eventlog");
-       to_file = cvar("sv_logscores_file");
+       to_console = autocvar_sv_logscores_console;
+       to_eventlog = autocvar_sv_eventlog;
+       to_file = autocvar_sv_logscores_file;
 
        if(!final)
        {
@@ -1418,7 +1418,7 @@ void DumpStats(float final)
        }
 
        if(to_eventlog)
-               if(cvar("sv_eventlog_console"))
+               if(autocvar_sv_eventlog_console)
                        to_console = FALSE; // otherwise we get the output twice
 
        if(final)
@@ -1433,7 +1433,7 @@ void DumpStats(float final)
                GameLogEcho(s);
        if(to_file)
        {
-               file = fopen(cvar_string("sv_logscores_filename"), FILE_APPEND);
+               file = fopen(autocvar_sv_logscores_filename, FILE_APPEND);
                if(file == -1)
                        to_file = FALSE;
                else
@@ -1450,7 +1450,7 @@ void DumpStats(float final)
 
        FOR_EACH_CLIENT(other)
        {
-               if ((clienttype(other) == CLIENTTYPE_REAL) || (clienttype(other) == CLIENTTYPE_BOT && cvar("sv_logscores_bots")))
+               if ((clienttype(other) == CLIENTTYPE_REAL) || (clienttype(other) == CLIENTTYPE_BOT && autocvar_sv_logscores_bots))
                {
                        s = strcat(":player:see-labels:", GetPlayerScoreString(other, 0), ":");
                        s = strcat(s, ftos(rint(time - other.jointime)), ":");
@@ -1529,7 +1529,7 @@ void FixIntermissionClient(entity e)
                if(clienttype(e) == CLIENTTYPE_REAL)
                {
                        stuffcmd(e, "\nscr_printspeed 1000000\n");
-                       s = cvar_string("sv_intermission_cdtrack");
+                       s = autocvar_sv_intermission_cdtrack;
                        if(s != "")
                                stuffcmd(e, strcat("\ncd loop ", s, "\n"));
                        msg_entity = e;
@@ -1556,7 +1556,7 @@ void NextLevel()
 
 // enforce a wait time before allowing changelevel
        if(player_count > 0)
-               intermission_exittime = time + cvar("sv_mapchange_delay");
+               intermission_exittime = time + autocvar_sv_mapchange_delay;
        else
                intermission_exittime = -1;
 
@@ -1573,7 +1573,7 @@ void NextLevel()
 
        DumpStats(TRUE);
 
-       if(cvar("sv_eventlog"))
+       if(autocvar_sv_eventlog)
                GameLogEcho(":gameover");
 
        GameLogClose();
@@ -1584,7 +1584,7 @@ void NextLevel()
                        bprint(other.netname, " ^7wins.\n");
        }
 
-       if(cvar("g_campaign"))
+       if(autocvar_g_campaign)
                CampaignPreIntermission();
 
        localcmd("\nsv_hook_gameend\n");
@@ -1625,7 +1625,7 @@ float InitiateSuddenDeath()
        // - for this timelimit_overtime needs to be >0 of course
        // - also check the winning condition calculated in the previous frame and only add normal overtime
        //   again, if at the point at which timelimit would be extended again, still no winner was found
-       if ((checkrules_overtimesadded >= 0) && (checkrules_overtimesadded < cvar("timelimit_overtimes")) && cvar("timelimit_overtime") && !(g_race && !g_race_qualifying))
+       if ((checkrules_overtimesadded >= 0) && (checkrules_overtimesadded < autocvar_timelimit_overtimes) && autocvar_timelimit_overtime && !(g_race && !g_race_qualifying))
        {
                return 1; // need to call InitiateOvertime later
        }
@@ -1633,7 +1633,7 @@ float InitiateSuddenDeath()
        {
                if(!checkrules_suddendeathend)
                {
-                       checkrules_suddendeathend = time + 60 * cvar("timelimit_suddendeath");
+                       checkrules_suddendeathend = time + 60 * autocvar_timelimit_suddendeath;
                        if(g_race && !g_race_qualifying)
                                race_StartCompleting();
                }
@@ -1646,11 +1646,11 @@ void InitiateOvertime() // ONLY call this if InitiateSuddenDeath returned true
        ++checkrules_overtimesadded;
        //add one more overtime by simply extending the timelimit
        float tl;
-       tl = cvar("timelimit");
-       tl += cvar("timelimit_overtime");
+       tl = autocvar_timelimit;
+       tl += autocvar_timelimit_overtime;
        cvar_set("timelimit", ftos(tl));
        string minutesPlural;
-       if (cvar("timelimit_overtime") == 1)
+       if (autocvar_timelimit_overtime == 1)
                minutesPlural = " ^3minute";
        else
                minutesPlural = " ^3minutes";
@@ -1658,7 +1658,7 @@ void InitiateOvertime() // ONLY call this if InitiateSuddenDeath returned true
        bcenterprint(
                strcat(
                        "^3Now playing ^1OVERTIME^3!\n\n^3Added ^1",
-                       ftos(cvar("timelimit_overtime")),
+                       ftos(autocvar_timelimit_overtime),
                        minutesPlural,
                        " to the game!"
                )
@@ -1667,7 +1667,7 @@ void InitiateOvertime() // ONLY call this if InitiateSuddenDeath returned true
 
 float GetWinningCode(float fraglimitreached, float equality)
 {
-       if(cvar("g_campaign") == 1)
+       if(autocvar_g_campaign == 1)
                if(fraglimitreached)
                        return WINNING_YES;
                else
@@ -1756,7 +1756,7 @@ float WinningCondition_Onslaught()
 float LMS_NewPlayerLives()
 {
        float fl;
-       fl = cvar("fraglimit");
+       fl = autocvar_fraglimit;
        if(fl == 0)
                fl = 999;
 
@@ -1764,8 +1764,8 @@ float LMS_NewPlayerLives()
        if(lms_lowest_lives < 1)
                return 0;
 
-       if(!cvar("g_lms_join_anytime"))
-               if(lms_lowest_lives < fl - cvar("g_lms_last_join"))
+       if(!autocvar_g_lms_join_anytime)
+               if(lms_lowest_lives < fl - autocvar_g_lms_last_join)
                        return 0;
 
        return bound(1, lms_lowest_lives, fl);
@@ -1802,7 +1802,7 @@ float WinningCondition_Assault()
 
                        TeamScore_AddToTeam(assault_attacker_team, ST_ASSAULT_OBJECTIVES, 666 - TeamScore_AddToTeam(assault_attacker_team, ST_ASSAULT_OBJECTIVES, 0));
 
-                       if(ent.cnt == 1 || cvar("g_campaign")) // this was the second round
+                       if(ent.cnt == 1 || autocvar_g_campaign) // this was the second round
                        {
                                status = WINNING_YES;
                        }
@@ -1901,7 +1901,7 @@ float WinningCondition_LMS()
 
 void ShuffleMaplist()
 {
-       cvar_set("g_maplist", shufflewords(cvar_string("g_maplist")));
+       cvar_set("g_maplist", shufflewords(autocvar_g_maplist));
 }
 
 float leaderfrags;
@@ -1961,7 +1961,7 @@ float WinningCondition_Scores(float limit, float leadlimit)
        {
                float leadlimitreached;
                leadlimitreached = (WinningConditionHelper_topscore - WinningConditionHelper_secondscore >= leadlimit);
-               if(cvar("leadlimit_and_fraglimit"))
+               if(autocvar_leadlimit_and_fraglimit)
                        limitreached = (limitreached && leadlimitreached);
                else
                        limitreached = (limitreached || leadlimitreached);
@@ -2118,9 +2118,9 @@ void CheckRules_World()
                return;
        }
 
-       timelimit = cvar("timelimit") * 60;
-       fraglimit = cvar("fraglimit");
-       leadlimit = cvar("leadlimit");
+       timelimit = autocvar_timelimit * 60;
+       fraglimit = autocvar_fraglimit;
+       leadlimit = autocvar_leadlimit;
 
        if(inWarmupStage || time <= game_starttime) // NOTE: this is <= to prevent problems in the very tic where the game starts
        {
@@ -2301,14 +2301,14 @@ string MapVote_Suggest(string m)
        float i;
        if(m == "")
                return "That's not how to use this command.";
-       if(!cvar("g_maplist_votable_suggestions"))
+       if(!autocvar_g_maplist_votable_suggestions)
                return "Suggestions are not accepted on this server.";
        if(mapvote_initialized)
                return "Can't suggest - voting is already in progress!";
        m = MapInfo_FixName(m);
        if(!m)
                return "The map you suggested is not available on this server.";
-       if(!cvar("g_maplist_votable_suggestions_override_mostrecent"))
+       if(!autocvar_g_maplist_votable_suggestions_override_mostrecent)
                if(Map_IsRecent(m))
                        return "This server does not allow for recent maps to be played again. Please be patient for some rounds.";
 
@@ -2329,7 +2329,7 @@ string MapVote_Suggest(string m)
        if(mapvote_suggestions[i] != "")
                strunzone(mapvote_suggestions[i]);
        mapvote_suggestions[i] = strzone(m);
-       if(cvar("sv_eventlog"))
+       if(autocvar_sv_eventlog)
                GameLogEcho(strcat(":vote:suggested:", m, ":", ftos(self.playerid)));
        return strcat("Suggestion of ", m, " accepted.");
 }
@@ -2380,17 +2380,17 @@ void MapVote_Init()
        MapVote_ClearAllVotes();
 
        mapvote_count = 0;
-       mapvote_detail = !cvar("g_maplist_votable_nodetail");
-       mapvote_abstain = cvar("g_maplist_votable_abstain");
+       mapvote_detail = !autocvar_g_maplist_votable_nodetail;
+       mapvote_abstain = autocvar_g_maplist_votable_abstain;
 
        if(mapvote_abstain)
-               nmax = min(MAPVOTE_COUNT - 1, cvar("g_maplist_votable"));
+               nmax = min(MAPVOTE_COUNT - 1, autocvar_g_maplist_votable);
        else
-               nmax = min(MAPVOTE_COUNT, cvar("g_maplist_votable"));
-       smax = min3(nmax, cvar("g_maplist_votable_suggestions"), mapvote_suggestion_ptr);
+               nmax = min(MAPVOTE_COUNT, autocvar_g_maplist_votable);
+       smax = min3(nmax, autocvar_g_maplist_votable_suggestions, mapvote_suggestion_ptr);
 
        // we need this for AddVotable, as that cycles through the screenshot dirs
-       mapvote_screenshot_dirs_count = tokenize_console(cvar_string("g_maplist_votable_screenshot_dir"));
+       mapvote_screenshot_dirs_count = tokenize_console(autocvar_g_maplist_votable_screenshot_dir);
        if(mapvote_screenshot_dirs_count == 0)
                mapvote_screenshot_dirs_count = tokenize_console("maps levelshots");
        mapvote_screenshot_dirs_count = min(mapvote_screenshot_dirs_count, MAPVOTE_SCREENSHOT_DIRS_COUNT);
@@ -2408,7 +2408,7 @@ void MapVote_Init()
        {
                bprint( "Maplist contains no single playable map!  Resetting it to default map list.\n" );
                cvar_set("g_maplist", MapInfo_ListAllowedMaps(MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags()));
-               if(cvar("g_maplist_shuffle"))
+               if(autocvar_g_maplist_shuffle)
                        ShuffleMaplist();
                localcmd("\nmenu_cmd sync\n");
                for(i = 0; i < 100 && mapvote_count < nmax; ++i)
@@ -2421,8 +2421,8 @@ void MapVote_Init()
 
        //dprint("mapvote count is ", ftos(mapvote_count), "\n");
 
-       mapvote_keeptwotime = time + cvar("g_maplist_votable_keeptwotime");
-       mapvote_timeout = time + cvar("g_maplist_votable_timeout");
+       mapvote_keeptwotime = time + autocvar_g_maplist_votable_keeptwotime;
+       mapvote_timeout = time + autocvar_g_maplist_votable_timeout;
        if(mapvote_count_real < 3 || mapvote_keeptwotime <= time)
                mapvote_keeptwotime = 0;
        mapvote_message = "Choose a map and press its key!";
@@ -2549,7 +2549,7 @@ float MapVote_Finished(float mappos)
        float i;
        float didntvote;
 
-       if(cvar("sv_eventlog"))
+       if(autocvar_sv_eventlog)
        {
                result = strcat(":vote:finished:", mapvote_maps[mappos]);
                result = strcat(result, ":", ftos(mapvote_votes[mappos]), "::");
@@ -2671,7 +2671,7 @@ float MapVote_CheckRules_2()
                                                }
                                }
                        result = strcat(result, ":didn't vote:", ftos(didntvote));
-                       if(cvar("sv_eventlog"))
+                       if(autocvar_sv_eventlog)
                                GameLogEcho(result);
                }
 
@@ -2750,17 +2750,17 @@ void MapVote_Think()
 
        if(!mapvote_initialized)
        {
-               if(cvar("rescan_pending") == 1)
+               if(autocvar_rescan_pending == 1)
                {
                        cvar_set("rescan_pending", "2");
                        localcmd("fs_rescan\nrescan_pending 3\n");
                        return;
                }
-               else if(cvar("rescan_pending") == 2)
+               else if(autocvar_rescan_pending == 2)
                {
                        return;
                }
-               else if(cvar("rescan_pending") == 3)
+               else if(autocvar_rescan_pending == 3)
                {
                        // now build missing mapinfo files
                        if(!MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags(), 1))
@@ -2773,7 +2773,7 @@ void MapVote_Think()
                mapvote_initialized = TRUE;
                if(DoNextMapOverride())
                        return;
-               if(!cvar("g_maplist_votable") || player_count <= 0)
+               if(!autocvar_g_maplist_votable || player_count <= 0)
                {
                        GotoNextMap();
                        return;
@@ -2822,7 +2822,7 @@ void EndFrame()
                                play2(self, "misc/hit.wav");
                }
        }
-       altime = time + frametime * (1 + cvar("g_antilag_nudge"));
+       altime = time + frametime * (1 + autocvar_g_antilag_nudge);
        // add 1 frametime because after this, engine SV_Physics
        // increases time by a frametime and then networks the frame
        // add another frametime because client shows everything with
@@ -2923,14 +2923,14 @@ void SV_Shutdown()
 
                if(!cheatcount_total)
                {
-                       if(cvar("sv_db_saveasdump"))
+                       if(autocvar_sv_db_saveasdump)
                                db_dump(ServerProgsDB, "server.db");
                        else
                                db_save(ServerProgsDB, "server.db");
                }
-               if(cvar("developer"))
+               if(autocvar_developer)
                {
-                       if(cvar("sv_db_saveasdump"))
+                       if(autocvar_sv_db_saveasdump)
                                db_dump(TemporaryDB, "server-temp.db");
                        else
                                db_save(TemporaryDB, "server-temp.db");
index 8e63beecc33793b7c3611434f609953b76988a98..5957e82bc1177fe761c086178e87222c7079c817 100644 (file)
@@ -771,10 +771,10 @@ void GameCommand(string command)
                        if(plr.classname == "spectator" || plr.classname == "observer")
                        {
                                plr.spectatortime = time;
-                               sprint(plr, strcat("^7You have to become a player within the next ", ftos(cvar("g_maxplayers_spectator_blocktime")), " seconds, otherwise you will be kicked, because spectators aren't allowed at this time!\n"));
+                               sprint(plr, strcat("^7You have to become a player within the next ", ftos(autocvar_g_maxplayers_spectator_blocktime), " seconds, otherwise you will be kicked, because spectators aren't allowed at this time!\n"));
                        }
                }
-               bprint(strcat("^7All spectators will be automatically kicked when not joining the game after ", ftos(cvar("g_maxplayers_spectator_blocktime")), " seconds!\n"));
+               bprint(strcat("^7All spectators will be automatically kicked when not joining the game after ", ftos(autocvar_g_maxplayers_spectator_blocktime), " seconds!\n"));
                return;
        }
 
index 293a9b4e40497cf4a2302ecf3da74bd1e11c500d..66e5a97e5e817670566c84846573debf29d6dbbe 100644 (file)
@@ -26,12 +26,12 @@ void OnlineBanList_SendBan(string ip, float bantime, string reason)
        string uri;
        float i, n;
 
-       uri = strcat(     "action=ban&hostname=", uri_escape(cvar_string("hostname")));
+       uri = strcat(     "action=ban&hostname=", uri_escape(autocvar_hostname));
        uri = strcat(uri, "&ip=", uri_escape(ip));
        uri = strcat(uri, "&duration=", ftos(bantime));
        uri = strcat(uri, "&reason=", uri_escape(reason));
 
-       n = tokenize_console(cvar_string("g_ban_sync_uri"));
+       n = tokenize_console(autocvar_g_ban_sync_uri);
        if(n >= MAX_IPBAN_URIS)
                n = MAX_IPBAN_URIS;
        for(i = 0; i < n; ++i)
@@ -48,10 +48,10 @@ void OnlineBanList_SendUnban(string ip)
        string uri;
        float i, n;
 
-       uri = strcat(     "action=unban&hostname=", uri_escape(cvar_string("hostname")));
+       uri = strcat(     "action=unban&hostname=", uri_escape(autocvar_hostname));
        uri = strcat(uri, "&ip=", uri_escape(ip));
 
-       n = tokenize_console(cvar_string("g_ban_sync_uri"));
+       n = tokenize_console(autocvar_g_ban_sync_uri);
        if(n >= MAX_IPBAN_URIS)
                n = MAX_IPBAN_URIS;
        for(i = 0; i < n; ++i)
@@ -85,7 +85,7 @@ void OnlineBanList_URI_Get_Callback(float id, float status, string data)
                return;
        }
 
-       tokenize_console(cvar_string("g_ban_sync_uri"));
+       tokenize_console(autocvar_g_ban_sync_uri);
        uri = argv(id);
 
        print("Received ban list from ", uri, ": ");
@@ -104,7 +104,7 @@ void OnlineBanList_URI_Get_Callback(float id, float status, string data)
                return;
        }
 
-       syncinterval = cvar("g_ban_sync_interval");
+       syncinterval = autocvar_g_ban_sync_interval;
        if(syncinterval == 0)
        {
                print("rejected (syncing disabled)\n");
@@ -155,7 +155,7 @@ void OnlineBanList_URI_Get_Callback(float id, float status, string data)
                dprint(" timeleft=", ftos(timeleft), " reason=", reason);
                dprint(" serverip=", serverip, "\n");
 
-               timeleft -= 1.5 * cvar("g_ban_sync_timeout");
+               timeleft -= 1.5 * autocvar_g_ban_sync_timeout;
                if(timeleft < 0)
                        continue;
 
@@ -170,7 +170,7 @@ void OnlineBanList_URI_Get_Callback(float id, float status, string data)
                                }
                }
 
-               if(cvar("g_ban_sync_trusted_servers_verify"))
+               if(autocvar_g_ban_sync_trusted_servers_verify)
                        if((strstrofs(strcat(";", OnlineBanList_Servers, ";"), strcat(";", serverip, ";"), 0) == -1))
                                continue;
 
@@ -192,11 +192,11 @@ void OnlineBanList_Think()
        string uri;
        float i, n;
        
-       if(cvar_string("g_ban_sync_uri") == "")
+       if(autocvar_g_ban_sync_uri == "")
                goto killme;
-       if(cvar("g_ban_sync_interval") == 0) // < 0 is okay, it means "sync on level start only"
+       if(autocvar_g_ban_sync_interval == 0) // < 0 is okay, it means "sync on level start only"
                goto killme;
-       argc = tokenize_console(cvar_string("g_ban_sync_trusted_servers"));
+       argc = tokenize_console(autocvar_g_ban_sync_trusted_servers);
        if(argc == 0)
                goto killme;
 
@@ -207,12 +207,12 @@ void OnlineBanList_Think()
                OnlineBanList_Servers = strcat(OnlineBanList_Servers, ";", argv(i));
        OnlineBanList_Servers = strzone(OnlineBanList_Servers);
        
-       uri = strcat(     "action=list&hostname=", uri_escape(cvar_string("hostname")));
+       uri = strcat(     "action=list&hostname=", uri_escape(autocvar_hostname));
        uri = strcat(uri, "&servers=", uri_escape(OnlineBanList_Servers));
 
-       OnlineBanList_Timeout = time + cvar("g_ban_sync_timeout");
+       OnlineBanList_Timeout = time + autocvar_g_ban_sync_timeout;
 
-       n = tokenize_console(cvar_string("g_ban_sync_uri"));
+       n = tokenize_console(autocvar_g_ban_sync_uri);
        if(n >= MAX_IPBAN_URIS)
                n = MAX_IPBAN_URIS;
        for(i = 0; i < n; ++i)
@@ -226,8 +226,8 @@ void OnlineBanList_Think()
                        uri_get(strcat(argv(i), "?", uri), URI_GET_IPBAN + i); // 1000 = "banlist" callback target
        }
        
-       if(cvar("g_ban_sync_interval") > 0)
-               self.nextthink = time + max(60, cvar("g_ban_sync_interval") * 60);
+       if(autocvar_g_ban_sync_interval > 0)
+               self.nextthink = time + max(60, autocvar_g_ban_sync_interval * 60);
        else
                goto killme;
        return;
@@ -297,7 +297,7 @@ void Ban_LoadBans()
                Ban_Delete(i);
        ban_count = 0;
        ban_loaded = TRUE;
-       n = tokenize_console(cvar_string("g_banned_list"));
+       n = tokenize_console(autocvar_g_banned_list);
        if(stof(argv(0)) == 1)
        {
                ban_count = (n - 1) / 2;
@@ -419,7 +419,7 @@ float Ban_IsClientBanned(entity client, float idx)
                if(ban_idfp == s) return TRUE;
        }
        if(ipbanned)
-               if(!cvar("g_banned_list_idmode") || !ban_idfp)
+               if(!autocvar_g_banned_list_idmode || !ban_idfp)
                        return TRUE;
        return FALSE;
 }
@@ -607,8 +607,8 @@ float GameCommand_Ban(string command)
                        client = edict_num(entno);
 
                        INITARG(3);
-                       GETARG(bantime, cvar("g_ban_default_bantime"));
-                       GETARG(masksize, cvar("g_ban_default_masksize"));
+                       GETARG(bantime, autocvar_g_ban_default_bantime);
+                       GETARG(masksize, autocvar_g_ban_default_masksize);
                        RESTARG(reason);
 
                        Ban_KickBanClient(client, bantime, masksize, reason);
@@ -623,7 +623,7 @@ float GameCommand_Ban(string command)
                        ip = argv(1);
 
                        INITARG(2);
-                       GETARG(bantime, cvar("g_ban_default_bantime"));
+                       GETARG(bantime, autocvar_g_ban_default_bantime);
                        RESTARG(reason);
 
                        Ban_Insert(ip, bantime, reason, 1);
index 5d55c22585ed69cb4932b47b6626554f9c1e6fee..8e052e8377a0688a3b143abaf181375b6090274b 100644 (file)
@@ -21,8 +21,8 @@ string ColoredTeamName(float t);
 
 string admin_name(void)
 {
-       if(cvar_string("sv_adminnick") != "")
-               return cvar_string("sv_adminnick");
+       if(autocvar_sv_adminnick != "")
+               return autocvar_sv_adminnick;
        else
                return "SERVER ADMIN";
 }
@@ -92,16 +92,16 @@ string GetAdvancedDeathReports(entity enPlayer) // Extra fragmessage information
        else
                strPlayerPingColor = "^2";
 
-       if((cvar("sv_fragmessage_information_stats")) && (enPlayer.health >= 1))
+       if((autocvar_sv_fragmessage_information_stats) && (enPlayer.health >= 1))
                strMessage = strcat(strMessage, "\n^7(Health ^1", ftos(nPlayerHealth), "^7 / Armor ^2", ftos(nPlayerArmor), "^7)");
 
-       if(cvar("sv_fragmessage_information_ping")) {
+       if(autocvar_sv_fragmessage_information_ping) {
                if(clienttype(enPlayer) == CLIENTTYPE_BOT) // Bots have no ping
                        strMessage = strcat(strMessage, " ^7(^2Bot");
                else
                        strMessage = strcat(strMessage, " ^7(Ping ", strPlayerPingColor, ftos(nPlayerPing), "ms");
-               if(cvar("sv_fragmessage_information_handicap"))
-                       if(cvar("sv_fragmessage_information_handicap") == 2)
+               if(autocvar_sv_fragmessage_information_handicap)
+                       if(autocvar_sv_fragmessage_information_handicap == 2)
                                if(nPlayerHandicap <= 1)
                                        strMessage = strcat(strMessage, "^7 / Handicap ^2Off^7)");
                                else
@@ -110,8 +110,8 @@ string GetAdvancedDeathReports(entity enPlayer) // Extra fragmessage information
                                strMessage = strcat(strMessage, "^7 / Handicap ^2", ftos(nPlayerHandicap), "^7)");
                else
                        strMessage = strcat(strMessage, "^7)");
-       } else if(cvar("sv_fragmessage_information_handicap")) {
-               if(cvar("sv_fragmessage_information_handicap") == 2)
+       } else if(autocvar_sv_fragmessage_information_handicap) {
+               if(autocvar_sv_fragmessage_information_handicap == 2)
                        if(nPlayerHandicap <= 1)
                                strMessage = strcat(strMessage, "\n^7(Handicap ^2Off^7)");
                        else
@@ -135,29 +135,29 @@ void GameLogEcho(string s)
     string fn;
     float matches;
 
-    if (cvar("sv_eventlog_files"))
+    if (autocvar_sv_eventlog_files)
     {
         if (!logfile_open)
         {
             logfile_open = TRUE;
-            matches = cvar("sv_eventlog_files_counter") + 1;
+            matches = autocvar_sv_eventlog_files_counter + 1;
             cvar_set("sv_eventlog_files_counter", ftos(matches));
             fn = ftos(matches);
             if (strlen(fn) < 8)
                 fn = strcat(substring("00000000", 0, 8 - strlen(fn)), fn);
-            fn = strcat(cvar_string("sv_eventlog_files_nameprefix"), fn, cvar_string("sv_eventlog_files_namesuffix"));
+            fn = strcat(autocvar_sv_eventlog_files_nameprefix, fn, autocvar_sv_eventlog_files_namesuffix);
             logfile = fopen(fn, FILE_APPEND);
             fputs(logfile, ":logversion:3\n");
         }
         if (logfile >= 0)
         {
-            if (cvar("sv_eventlog_files_timestamps"))
+            if (autocvar_sv_eventlog_files_timestamps)
                 fputs(logfile, strcat(":time:", strftime(TRUE, "%Y-%m-%d %H:%M:%S", "\n", s, "\n")));
             else
                 fputs(logfile, strcat(s, "\n"));
         }
     }
-    if (cvar("sv_eventlog_console"))
+    if (autocvar_sv_eventlog_console)
     {
         print(s, "\n");
     }
@@ -189,13 +189,13 @@ vector PL_CROUCH_MAX;
 float spawnpoint_nag;
 void relocate_spawnpoint()
 {
-    PL_VIEW_OFS                             = stov(cvar_string("sv_player_viewoffset"));
-    PL_MIN                                  = stov(cvar_string("sv_player_mins"));
-    PL_MAX                                  = stov(cvar_string("sv_player_maxs"));
-    PL_HEAD                                 = stov(cvar_string("sv_player_headsize"));
-    PL_CROUCH_VIEW_OFS                      = stov(cvar_string("sv_player_crouch_viewoffset"));
-    PL_CROUCH_MIN                           = stov(cvar_string("sv_player_crouch_mins"));
-    PL_CROUCH_MAX                           = stov(cvar_string("sv_player_crouch_maxs"));
+    PL_VIEW_OFS                             = stov(autocvar_sv_player_viewoffset);
+    PL_MIN                                  = stov(autocvar_sv_player_mins);
+    PL_MAX                                  = stov(autocvar_sv_player_maxs);
+    PL_HEAD                                 = stov(autocvar_sv_player_headsize);
+    PL_CROUCH_VIEW_OFS                      = stov(autocvar_sv_player_crouch_viewoffset);
+    PL_CROUCH_MIN                           = stov(autocvar_sv_player_crouch_mins);
+    PL_CROUCH_MAX                           = stov(autocvar_sv_player_crouch_maxs);
 
     // nudge off the floor
     setorigin(self, self.origin + '0 0 1');
@@ -213,7 +213,7 @@ void relocate_spawnpoint()
         print(" needs to be moved out of solid, e.g. by '", ftos(self.origin_x - o_x));
         print(" ", ftos(self.origin_y - o_y));
         print(" ", ftos(self.origin_z - o_z), "'\n");
-        if (cvar("g_spawnpoints_auto_move_out_of_solid"))
+        if (autocvar_g_spawnpoints_auto_move_out_of_solid)
         {
             if (!spawnpoint_nag)
                 print("\{1}^1NOTE: this map needs FIXING (it contains spawnpoints in solid, see server log)\n");
@@ -237,7 +237,7 @@ void relocate_spawnpoint()
         if (self.team)
             have_team_spawns = 1;
 
-    if (cvar("r_showbboxes"))
+    if (autocvar_r_showbboxes)
     {
         // show where spawnpoints point at too
         makevectors(self.angles);
@@ -638,8 +638,8 @@ float fexists(string f)
 void backtrace(string msg)
 {
     float dev, war;
-    dev = cvar("developer");
-    war = cvar("prvm_backtraceforwarnings");
+    dev = autocvar_developer;
+    war = autocvar_prvm_backtraceforwarnings;
     cvar_set("developer", "1");
     cvar_set("prvm_backtraceforwarnings", "1");
     print("\n");
@@ -1339,7 +1339,7 @@ float sound_allowed(float dest, entity e)
         if (e == msg_entity)
             return TRUE;
     // sounds by players can be removed
-    if (cvar("bot_sound_monopoly"))
+    if (autocvar_bot_sound_monopoly)
         if (clienttype(e) == CLIENTTYPE_REAL)
             return FALSE;
     // anything else may pass
@@ -1485,7 +1485,7 @@ void play2team(float t, string filename)
 {
     local entity head;
 
-    if (cvar("bot_sound_monopoly"))
+    if (autocvar_bot_sound_monopoly)
         return;
 
     FOR_EACH_REALPLAYER(head)
@@ -1497,7 +1497,7 @@ void play2team(float t, string filename)
 
 void play2all(string samp)
 {
-    if (cvar("bot_sound_monopoly"))
+    if (autocvar_bot_sound_monopoly)
         return;
 
     sound(world, CHAN_AUTO, samp, VOL_BASE, ATTN_NONE);
@@ -1562,12 +1562,12 @@ void precache()
     }
 
 #ifdef TTURRETS_ENABLED
-    if (cvar("g_turrets"))
+    if (autocvar_g_turrets)
         turrets_precash();
 #endif
 
     // Precache all player models if desired
-    if (cvar("sv_precacheplayermodels"))
+    if (autocvar_sv_precacheplayermodels)
     {
         PrecachePlayerSounds("sound/player/default.sounds");
         precache_all_playermodels("models/player/*.zym");
@@ -1577,22 +1577,22 @@ void precache()
         precache_all_playermodels("models/player/*.iqm");
     }
 
-    if (cvar("sv_defaultcharacter"))
+    if (autocvar_sv_defaultcharacter)
     {
         string s;
-        s = cvar_string("sv_defaultplayermodel_red");
+        s = autocvar_sv_defaultplayermodel_red;
         if (s != "")
             precache_playermodel(s);
-        s = cvar_string("sv_defaultplayermodel_blue");
+        s = autocvar_sv_defaultplayermodel_blue;
         if (s != "")
             precache_playermodel(s);
-        s = cvar_string("sv_defaultplayermodel_yellow");
+        s = autocvar_sv_defaultplayermodel_yellow;
         if (s != "")
             precache_playermodel(s);
-        s = cvar_string("sv_defaultplayermodel_pink");
+        s = autocvar_sv_defaultplayermodel_pink;
         if (s != "")
             precache_playermodel(s);
-        s = cvar_string("sv_defaultplayermodel");
+        s = autocvar_sv_defaultplayermodel;
         if (s != "")
             precache_playermodel(s);
     }
@@ -1652,7 +1652,7 @@ void precache()
         precache_sound ("weapons/hook_impact.wav"); // hook
     }
 
-    if(cvar("sv_precacheweapons"))
+    if(autocvar_sv_precacheweapons)
     {
         //precache weapon models/sounds
         local float wep;
@@ -2647,7 +2647,7 @@ vector shotorg_adjust_values(vector vecs, float y_is_right, float visual, float
        string s;
        vector v;
 
-       if (cvar("g_shootfromeye"))
+       if (autocvar_g_shootfromeye)
        {
                if (visual)
                {
@@ -2659,7 +2659,7 @@ vector shotorg_adjust_values(vector vecs, float y_is_right, float visual, float
                        vecs_z = 0;
                }
        }
-       else if (cvar("g_shootfromcenter"))
+       else if (autocvar_g_shootfromcenter)
        {
                if (visual)
                {
@@ -2671,7 +2671,7 @@ vector shotorg_adjust_values(vector vecs, float y_is_right, float visual, float
                        vecs_z -= 2;
                }
        }
-       else if ((s = cvar_string("g_shootfromfixedorigin")) != "")
+       else if ((s = autocvar_g_shootfromfixedorigin) != "")
        {
                v = stov(s);
                if (y_is_right)
@@ -2681,9 +2681,9 @@ vector shotorg_adjust_values(vector vecs, float y_is_right, float visual, float
                vecs_y = v_y;
                vecs_z = v_z;
        }
-       else if (cvar("g_shootfromclient"))
+       else if (autocvar_g_shootfromclient)
        {
-               vecs = shotorg_adjustfromclient(vecs, y_is_right, (cvar("g_shootfromclient") >= 2), algn);
+               vecs = shotorg_adjustfromclient(vecs, y_is_right, (autocvar_g_shootfromclient >= 2), algn);
        }
        return vecs;
 }
index b73bdb05fc25c81d336b6dba5fab181d442fc98b..ba1f8accc348c5fe2692f219531c4c6a2af78c50 100644 (file)
@@ -379,8 +379,8 @@ void onslaught_generator_think()
        self.nextthink = ceil(time + 1);
        if (!gameover)
        {
-               if (cvar("timelimit"))
-               if (time > game_starttime + cvar("timelimit") * 60)
+               if (autocvar_timelimit)
+               if (time > game_starttime + autocvar_timelimit * 60)
                {
                        // self.max_health / 300 gives 5 minutes of overtime.
                        // control points reduce the overtime duration.
@@ -809,7 +809,7 @@ void onslaught_controlpoint_updatesprite(entity e)
 void onslaught_generator_reset()
 {
        self.team = self.team_saved;
-       self.lasthealth = self.max_health = self.health = cvar("g_onslaught_gen_health");
+       self.lasthealth = self.max_health = self.health = autocvar_g_onslaught_gen_health;
        self.takedamage = DAMAGE_AIM;
        self.bot_attack = TRUE;
        self.iscaptured = TRUE;
@@ -874,7 +874,7 @@ void spawnfunc_onslaught_generator()
        self.colormap = 1024 + (self.team - 1) * 17;
        self.solid = SOLID_BBOX;
        self.movetype = MOVETYPE_NONE;
-       self.lasthealth = self.max_health = self.health = cvar("g_onslaught_gen_health");
+       self.lasthealth = self.max_health = self.health = autocvar_g_onslaught_gen_health;
        setmodel(self, "models/onslaught/generator.md3");
        setsize(self, '-52 -52 -14', '52 52 75');
        setorigin(self, self.origin);
@@ -1127,7 +1127,7 @@ void onslaught_controlpoint_icon_buildthink()
        if (self.health >= self.max_health)
        {
                self.health = self.max_health;
-               self.count = cvar("g_onslaught_cp_regen") * sys_frametime; // slow repair rate from now on
+               self.count = autocvar_g_onslaught_cp_regen * sys_frametime; // slow repair rate from now on
                self.think = onslaught_controlpoint_icon_think;
                sound(self, CHAN_TRIGGER, "onslaught/controlpoint_built.wav", VOL_BASE, ATTN_NORM);
                bprint(ColoredTeamName(self.team), " captured ", self.owner.message, " control point\n");
@@ -1177,8 +1177,8 @@ void onslaught_controlpoint_touch()
        self.goalentity = e = spawn();
        e.classname = "onslaught_controlpoint_icon";
        e.owner = self;
-       e.max_health = cvar("g_onslaught_cp_health");
-       e.health = cvar("g_onslaught_cp_buildhealth");
+       e.max_health = autocvar_g_onslaught_cp_health;
+       e.health = autocvar_g_onslaught_cp_buildhealth;
        e.solid = SOLID_BBOX;
        e.movetype = MOVETYPE_NONE;
        setmodel(e, "models/onslaught/controlpoint_icon.md3");
@@ -1191,7 +1191,7 @@ void onslaught_controlpoint_touch()
        e.colormap = 1024 + (e.team - 1) * 17;
        e.think = onslaught_controlpoint_icon_buildthink;
        e.nextthink = time + sys_frametime;
-       e.count = (e.max_health - e.health) * sys_frametime / cvar("g_onslaught_cp_buildtime"); // how long it takes to build
+       e.count = (e.max_health - e.health) * sys_frametime / autocvar_g_onslaught_cp_buildtime; // how long it takes to build
        sound(e, CHAN_TRIGGER, "onslaught/controlpoint_build.wav", VOL_BASE, ATTN_NORM);
        self.team = e.team;
        self.colormap = e.colormap;
index fa255699f16f22afedf838021338febebfb4d106..dd12e96bcb9471ff27b53a6364e4ff1b64988b5f 100644 (file)
@@ -153,7 +153,7 @@ void() monster_death_use =
 void() monsterinwall =
 {
        local entity e;
-       if (!cvar("developer"))
+       if (!autocvar_developer)
                return;
        // this is handy for level designers,
        // puts a spikey ball where the error is...
index 9b7ad548c4bebfeae4d99d4f2176d1e261f1c62e..2973dee97c01daff3b3cf4739a4396ac9834e817 100644 (file)
@@ -77,10 +77,10 @@ float zombie_scoretarget(entity trg)
                 if(trace_ent != trg)
                     return 0;
 
-                return (cvar("g_monster_zombie_targetrange") - vlen(self.origin - trg.origin)) * tmp;
+                return (autocvar_g_monster_zombie_targetrange - vlen(self.origin - trg.origin)) * tmp;
             }
             else if(self.enemy == trg)
-                return (cvar("g_monster_zombie_targetrange") - vlen(self.origin - trg.origin)) * tmp;
+                return (autocvar_g_monster_zombie_targetrange - vlen(self.origin - trg.origin)) * tmp;
         }
     }
 
@@ -153,7 +153,7 @@ void zombie_die(vector dir)
     self.event_damage   = SUB_Null;
     self.enemy          = world;
     self.think          = zombie_spawn;
-    self.nextthink      = time + cvar("g_monster_zombie_respawntime");
+    self.nextthink      = time + autocvar_g_monster_zombie_respawntime;
     self.pain_finished  = self.nextthink;
 }
 
@@ -212,7 +212,7 @@ void zombie_move()
     float vz, tdiff, tspeed;
 
     tdiff = time - self.zoomstate;
-    tspeed = tdiff * cvar("g_monster_zombie_turnspeed");
+    tspeed = tdiff * autocvar_g_monster_zombie_turnspeed;
     vz = self.velocity_z;
     self.zoomstate = time;
 
@@ -235,14 +235,14 @@ void zombie_move()
 
     if(vlen(self.origin - self.moveto) > 64)
     {
-        movelib_move_simple(v_forward ,cvar("g_monster_zombie_movespeed"),0.6);
+        movelib_move_simple(v_forward ,autocvar_g_monster_zombie_movespeed,0.6);
         if(time > self.pain_finished)
             if(self.attack_finished_single < time)
                 self.frame = zombie_anim_runforward;
     }
     else
     {
-        movelib_beak_simple(cvar("g_monster_zombie_stopspeed"));
+        movelib_beak_simple(autocvar_g_monster_zombie_stopspeed);
         if(time > self.pain_finished)
             if(self.attack_finished_single < time)
                 self.frame = zombie_anim_idle;
@@ -311,8 +311,8 @@ float zombie_verb_idle(float eval)
     case VCM_DO:
         float t;
 
-        t = cvar("g_monster_zombie_idle_timer_max") -  cvar("g_monster_zombie_idle_timer_min");
-        t = cvar("g_monster_zombie_idle_timer_min") + (random() * t);
+        t = autocvar_g_monster_zombie_idle_timer_max -  autocvar_g_monster_zombie_idle_timer_min;
+        t = autocvar_g_monster_zombie_idle_timer_min + (random() * t);
 
         if(random() < 0.5)
             verbstack_push(self.verbs_idle, zombie_verb_idle_roam,  ZV_IDLE + 1, t, self);
@@ -340,7 +340,7 @@ float zombie_verb_attack_findtarget(float eval)
         entity trg, best_trg;
         float trg_score, best_trg_score;
 
-        trg = findradius(self.origin,cvar("g_monster_zombie_targetrange"));
+        trg = findradius(self.origin,autocvar_g_monster_zombie_targetrange);
         while(trg)
         {
             trg_score = zombie_scoretarget(trg);
@@ -371,13 +371,13 @@ void zombie_runattack_damage()
     oldself = self;
     self = self.owner;
 
-    if(vlen(self.origin - self.enemy.origin) > cvar("g_monster_zombie_attack_run_hitrange"))
+    if(vlen(self.origin - self.enemy.origin) > autocvar_g_monster_zombie_attack_run_hitrange)
         return;
 
     if(vlen(normalize(self.origin - self.enemy.origin) - v_forward) < 1.6)
         return;
 
-    Damage(self.enemy, self, self, cvar("g_monster_zombie_attack_run_damage"), DEATH_TURRET, self.enemy.origin, normalize(self.enemy.origin - self.origin)  * cvar("g_monster_zombie_attack_run_force"));
+    Damage(self.enemy, self, self, autocvar_g_monster_zombie_attack_run_damage, DEATH_TURRET, self.enemy.origin, normalize(self.enemy.origin - self.origin)  * autocvar_g_monster_zombie_attack_run_force);
 
     self = oldself;
     self.think = SUB_Remove;
@@ -395,7 +395,7 @@ float zombie_verb_attack_run(float eval)
         if(self.attack_finished_single > time)
             return VS_CALL_NO;
 
-        if(vlen(self.origin - self.enemy.origin) > cvar("g_monster_zombie_attack_run_range"))
+        if(vlen(self.origin - self.enemy.origin) > autocvar_g_monster_zombie_attack_run_range)
             return VS_CALL_NO;
 
         if(vlen(normalize(self.origin - self.enemy.origin) - v_forward) < 1.6)
@@ -408,7 +408,7 @@ float zombie_verb_attack_run(float eval)
         pain = spawn();
         pain.owner = self;
         pain.think = zombie_runattack_damage;
-        pain.nextthink = time + cvar("g_monster_zombie_attack_run_delay");
+        pain.nextthink = time + autocvar_g_monster_zombie_attack_run_delay;
 
         self.attack_finished_single = time + 0.7;
         self.frame = zombie_anim_attackrun1 + rint(random() * 2);
@@ -426,7 +426,7 @@ void zombie_standattack_damage()
     //self = self.owner;
 
     setorigin(self,self.owner.origin + v_forward * 32);
-    RadiusDamage(self, self.owner, cvar("g_monster_zombie_attack_stand_damage"),cvar("g_monster_zombie_attack_stand_damage"),16,self, cvar("g_monster_zombie_attack_stand_force"),DEATH_TURRET,world);
+    RadiusDamage(self, self.owner, autocvar_g_monster_zombie_attack_stand_damage,autocvar_g_monster_zombie_attack_stand_damage,16,self, autocvar_g_monster_zombie_attack_stand_force,DEATH_TURRET,world);
     //float RadiusDamage (entity inflictor, entity attacker, float coredamage, float edgedamage, float rad, entity ignore, float forceintensity, float deathtype, entity directhitentity)
 
 
@@ -446,7 +446,7 @@ float zombie_verb_attack_stand(float eval)
         if(self.attack_finished_single > time)
             return VS_CALL_NO;
 
-        if(vlen(self.origin - self.enemy.origin) > cvar("g_monster_zombie_attack_stand_range"))
+        if(vlen(self.origin - self.enemy.origin) > autocvar_g_monster_zombie_attack_stand_range)
             return VS_CALL_NO;
 
         if(vlen(normalize(self.origin - self.enemy.origin) - v_forward) < 1.8)
@@ -459,7 +459,7 @@ float zombie_verb_attack_stand(float eval)
         pain = spawn();
         pain.owner = self;
         pain.think = zombie_runattack_damage;
-        pain.nextthink = time + cvar("g_monster_zombie_attack_stand_delay");
+        pain.nextthink = time + autocvar_g_monster_zombie_attack_stand_delay;
 
         self.attack_finished_single = time + 0.7;
         self.frame = zombie_anim_attackstanding1 + rint(random() * 1);
@@ -507,7 +507,7 @@ void zombie_spawn()
     self.nextthink      = time + 2.1;
     self.pain_finished  = self.nextthink;
     self.movetype       = MOVETYPE_WALK;
-    self.health         = cvar("g_monster_zombie_health");
+    self.health         = autocvar_g_monster_zombie_health;
     self.velocity       = '0 0 0';
     self.angles         = self.pos2;
     self.moveto         = self.origin;
@@ -520,7 +520,7 @@ void zombie_spawn()
 
 void spawnfunc_monster_zombie()
 {
-    if not(cvar("g_monsters"))
+    if not(autocvar_g_monsters)
     {
         remove(self);
         return;
index 790c9d04254e83cb8c82873568b55c6bca56e008..a1cc9deb6c6b0ed39e1f4707b56912797f8e9de5 100644 (file)
@@ -1,7 +1,7 @@
 void freezetag_Initialize()
 {
        precache_model("models/ice/ice.md3");
-       warmup = time + cvar("g_start_delay") + cvar("g_freezetag_warmup");
+       warmup = time + autocvar_g_start_delay + autocvar_g_freezetag_warmup;
 }
 
 void freezetag_CheckWinner()
@@ -9,7 +9,7 @@ void freezetag_CheckWinner()
        if(time <= game_starttime) // game didn't even start yet! nobody can win in that case.
                return;
 
-       if(next_round || (time > warmup - cvar("g_freezetag_warmup") && time < warmup))
+       if(next_round || (time > warmup - autocvar_g_freezetag_warmup && time < warmup))
                return; // already waiting for next round to start
 
        if((redalive >= 1 && bluealive >= 1) // counted in arena.qc
@@ -154,7 +154,7 @@ MUTATOR_HOOKFUNCTION(freezetag_PlayerDies)
                bprint("^7", frag_target.netname, "^1 was frozen by ^7", frag_attacker.netname, ".\n");
        }
 
-       frag_target.health = cvar("g_balance_health_start"); // "respawn" the player :P
+       frag_target.health = autocvar_g_balance_health_start; // "respawn" the player :P
 
        freezetag_CheckWinner();
 
@@ -166,7 +166,7 @@ MUTATOR_HOOKFUNCTION(freezetag_PlayerSpawn)
     freezetag_Unfreeze(); // start by making sure that all ice blocks are removed
 
        if(totalspawned == 1 && time > game_starttime) // only one player active on server, start a new match immediately
-       if(!next_round && warmup && (time < warmup - cvar("g_freezetag_warmup") || time > warmup)) // not awaiting next round
+       if(!next_round && warmup && (time < warmup - autocvar_g_freezetag_warmup || time > warmup)) // not awaiting next round
        {
                next_round = time;
                return 1;
@@ -189,7 +189,7 @@ MUTATOR_HOOKFUNCTION(freezetag_GiveFragsForKill)
 MUTATOR_HOOKFUNCTION(freezetag_PlayerPreThink)
 {
     vector revive_extra_size;
-    revive_extra_size = '1 1 1' * cvar("g_freezetag_revive_extra_size");
+    revive_extra_size = '1 1 1' * autocvar_g_freezetag_revive_extra_size;
 
     float teammate_nearby;
     FOR_EACH_PLAYER(other) if(self != other)
@@ -214,8 +214,8 @@ MUTATOR_HOOKFUNCTION(freezetag_PlayerPreThink)
         }
         else
         {
-            self.freezetag_revive_progress = (time - self.freezetag_beginrevive_time) / cvar("g_freezetag_revive_time");
-            if(time - self.freezetag_beginrevive_time >= cvar("g_freezetag_revive_time"))
+            self.freezetag_revive_progress = (time - self.freezetag_beginrevive_time) / autocvar_g_freezetag_revive_time;
+            if(time - self.freezetag_beginrevive_time >= autocvar_g_freezetag_revive_time)
             {
                 freezetag_Unfreeze();
 
@@ -264,7 +264,7 @@ MUTATOR_HOOKFUNCTION(freezetag_PlayerDamage_Calculate)
         if(frag_target.freezetag_frozen == 1 && frag_deathtype != DEATH_HURTTRIGGER)
         {
             frag_damage = 0;
-            frag_force = frag_force * cvar("g_freezetag_frozen_force");
+            frag_force = frag_force * autocvar_g_freezetag_frozen_force;
         }
     }
     return 1;
index c771ab173f9d1881076ae69f058d13377e7c0023..9fb47afbb354310890b7319fdc28555497ce36e4 100644 (file)
@@ -40,9 +40,9 @@ void ka_SpawnBall() // loads various values for the ball
        setmodel(e, e.model);
        setsize(e, '-16 -16 -20', '16 16 20'); // 20 20 20 was too big, player is only 16 16 24... gotta cheat with the Z (20) axis so that the particle isn't cut off
        e.classname = "keepawayball";
-       e.damageforcescale = cvar("g_keepawayball_damageforcescale");
+       e.damageforcescale = autocvar_g_keepawayball_damageforcescale;
        e.takedamage = DAMAGE_YES;
-       e.glow_color = cvar("g_keepawayball_trail_color");
+       e.glow_color = autocvar_g_keepawayball_trail_color;
        e.glow_trail = TRUE;
        e.movetype = MOVETYPE_BOUNCE;
        e.touch = ka_TouchEvent;
@@ -65,7 +65,7 @@ void ka_RespawnBall() // runs whenever the ball needs to be relocated
                self.angles = '0 0 0';
                self.solid = SOLID_TRIGGER;
                self.think = ka_RespawnBall;
-               self.nextthink = time + cvar("g_keepawayball_respawntime");
+               self.nextthink = time + autocvar_g_keepawayball_respawntime;
                
                pointparticles(particleeffectnum("electro_combo"), oldballorigin, '0 0 0', 1);
                pointparticles(particleeffectnum("electro_combo"), self.origin, '0 0 0', 1);
@@ -115,11 +115,11 @@ void ka_TouchEvent() // runs any time that the ball comes in contact with someth
        self.takedamage = DAMAGE_NO;
 
        // apply effects to player
-       other.glow_color = cvar("g_keepawayball_trail_color");
+       other.glow_color = autocvar_g_keepawayball_trail_color;
        other.glow_trail = TRUE;
        other.effects |= EF_DIMLIGHT;
-       other.alpha = cvar("g_keepaway_ballcarrier_alpha");
-       other.exteriorweaponentity.alpha = cvar("g_keepaway_ballcarrier_alpha");
+       other.alpha = autocvar_g_keepaway_ballcarrier_alpha;
+       other.exteriorweaponentity.alpha = autocvar_g_keepaway_ballcarrier_alpha;
 
        // messages and sounds
        Send_KillNotification(other.netname, "", "", KA_PICKUPBALL, MSG_KA);
@@ -152,7 +152,7 @@ void ka_DropEvent(entity plyr) // runs any time that a player is supposed to los
        ball.solid = SOLID_TRIGGER; // is this needed? 
        ball.wait = time + 1; 
        ball.think = ka_RespawnBall;
-       ball.nextthink = time + cvar("g_keepawayball_respawntime");
+       ball.nextthink = time + autocvar_g_keepawayball_respawntime;
        ball.touch = ka_TouchEvent;
        ball.takedamage = DAMAGE_YES;
        ball.effects &~= EF_NODRAW; 
@@ -209,11 +209,11 @@ MUTATOR_HOOKFUNCTION(ka_Scoring)
        {
                if(frag_target.ballcarried) { // add to amount of times killing carrier
                        PlayerScore_Add(frag_attacker, SP_KEEPAWAY_CARRIERKILLS, 1);
-                       if(cvar("g_keepaway_bckillscore")) // add bckills to the score
+                       if(autocvar_g_keepaway_bckillscore) // add bckills to the score
                                PlayerScore_Add(frag_attacker, SP_KEEPAWAY_SCORE, 1);
                }
                else if(!frag_attacker.ballcarried)
-                       if(cvar("g_keepaway_noncarrier_warn"))
+                       if(autocvar_g_keepaway_noncarrier_warn)
                                centerprint_atprio(frag_attacker, (CENTERPRIO_SPAM + 5), "Killing people while you don't have the ball gives no points!");
 
                if(frag_attacker.ballcarried) // add to amount of kills while ballcarrier
@@ -252,26 +252,26 @@ MUTATOR_HOOKFUNCTION(ka_PlayerDamage) // for changing damage and force values th
        {
                if(frag_target == frag_attacker) // damage done to yourself
                {
-                       frag_damage *= cvar("g_keepaway_ballcarrier_selfdamage");
-                       frag_force *= cvar("g_keepaway_ballcarrier_selfforce");
+                       frag_damage *= autocvar_g_keepaway_ballcarrier_selfdamage;
+                       frag_force *= autocvar_g_keepaway_ballcarrier_selfforce;
                }
                else // damage done to noncarriers
                {
-                       frag_damage *= cvar("g_keepaway_ballcarrier_damage");
-                       frag_force *= cvar("g_keepaway_ballcarrier_force");
+                       frag_damage *= autocvar_g_keepaway_ballcarrier_damage;
+                       frag_force *= autocvar_g_keepaway_ballcarrier_force;
                }
        }
        else if not(frag_target.ballcarried) // if the target is a noncarrier
        {
                if(frag_target == frag_attacker) // damage done to yourself
                {
-                       frag_damage *= cvar("g_keepaway_noncarrier_selfdamage");
-                       frag_force *= cvar("g_keepaway_noncarrier_selfforce");
+                       frag_damage *= autocvar_g_keepaway_noncarrier_selfdamage;
+                       frag_force *= autocvar_g_keepaway_noncarrier_selfforce;
                }
                else // damage done to other noncarriers
                {
-                       frag_damage *= cvar("g_keepaway_noncarrier_damage");
-                       frag_force *= cvar("g_keepaway_noncarrier_force");
+                       frag_damage *= autocvar_g_keepaway_noncarrier_damage;
+                       frag_force *= autocvar_g_keepaway_noncarrier_force;
                }
        }
        return 0;
@@ -282,8 +282,8 @@ MUTATOR_HOOKFUNCTION(ka_PlayerPowerups)
        if(self.ballcarried)
        { 
                // if the player has the ball, force ballcarrier alpha upon them
-               self.alpha = cvar("g_keepaway_ballcarrier_alpha");
-               self.exteriorweaponentity.alpha = cvar("g_keepaway_ballcarrier_alpha");
+               self.alpha = autocvar_g_keepaway_ballcarrier_alpha;
+               self.exteriorweaponentity.alpha = autocvar_g_keepaway_ballcarrier_alpha;
        
                // if we're in minstagib and a ballcarrier has just picked up invisibility, 
                // notify all the other players that the ballcarrier no longer has a waypoint
@@ -351,4 +351,4 @@ MUTATOR_DEFINITION(gamemode_keepaway)
        }
 
        return 0;
-}
\ No newline at end of file
+}
index 54be69cb11f3eb06c1629e5dd5563107b30aa348..e1cb1a85bcfe65e788eb11ce0fb1ada428205ee8 100644 (file)
@@ -180,7 +180,7 @@ void kh_Scores_Event(entity player, entity key, string what, float frags_player,
        if(key && key.owner && frags_owner)
                UpdateFrags(key.owner, frags_owner);
 
-       if(!cvar("sv_eventlog"))  //output extra info to the console or text file
+       if(!autocvar_sv_eventlog)  //output extra info to the console or text file
                return;
 
        s = strcat(":keyhunt:", what, ":", ftos(player.playerid), ":", ftos(frags_player));
@@ -284,8 +284,8 @@ void kh_Key_Detach(entity key) // runs every time a key is dropped or lost. Runs
        key.flags = FL_ITEM;
        key.solid = SOLID_TRIGGER;
        key.movetype = MOVETYPE_TOSS;
-       key.pain_finished = time + cvar("g_balance_keyhunt_delay_return");
-       key.damageforcescale = cvar("g_balance_keyhunt_damageforcescale");
+       key.pain_finished = time + autocvar_g_balance_keyhunt_delay_return;
+       key.damageforcescale = autocvar_g_balance_keyhunt_damageforcescale;
        key.takedamage = DAMAGE_YES;
        // let key.team stay
        key.modelindex = kh_key_dropped;
@@ -418,7 +418,7 @@ void kh_Key_Collect(entity key, entity player)  //a player picks up a dropped ke
 
        if(key.kh_dropperteam != player.team)
        {
-               kh_Scores_Event(player, key, "collect", cvar("g_balance_keyhunt_score_collect"), 0);
+               kh_Scores_Event(player, key, "collect", autocvar_g_balance_keyhunt_score_collect, 0);
                PlayerScore_Add(player, SP_KH_PICKUPS, 1);
        }
        key.kh_dropperteam = 0;
@@ -439,7 +439,7 @@ void kh_Key_Touch()  // runs many, many times when a key has been dropped and ca
        if(other.deadflag != DEAD_NO)
                return;
        if(other == self.enemy)
-               if(time < self.kh_droptime + cvar("g_balance_keyhunt_delay_collect"))
+               if(time < self.kh_droptime + autocvar_g_balance_keyhunt_delay_collect)
                        return;  // you just dropped it!
        kh_Key_Collect(self, other);
 }
@@ -487,7 +487,7 @@ void kh_FinishRound()  // runs when a team captures the keys
                kh_Key_Remove(key);
        kh_no_radar_circles = FALSE;
 
-       kh_Controller_SetThink(cvar("g_balance_keyhunt_delay_round"), "Round starts in ", kh_StartRound);
+       kh_Controller_SetThink(autocvar_g_balance_keyhunt_delay_round, "Round starts in ", kh_StartRound);
 }
 
 void kh_WinnerTeam(float teem)  // runs when a team wins
@@ -497,7 +497,7 @@ void kh_WinnerTeam(float teem)  // runs when a team wins
        float first;
        entity key;
        float score;
-       score = (kh_teams - 1) * cvar("g_balance_keyhunt_score_capture");
+       score = (kh_teams - 1) * autocvar_g_balance_keyhunt_score_capture;
        DistributeEvenly_Init(score, kh_teams);
        // twice the score for 3 team games, three times the score for 4 team games!
        // note: for a win by destroying the key, this should NOT be applied
@@ -566,9 +566,9 @@ void kh_LoserTeam(float teem, entity lostkey)  // runs when a player pushes a fl
        if(attacker)
        {
                if(lostkey.kh_previous_owner)
-                       kh_Scores_Event(lostkey.kh_previous_owner, world, "pushed", 0, -cvar("g_balance_keyhunt_score_push"));
+                       kh_Scores_Event(lostkey.kh_previous_owner, world, "pushed", 0, -autocvar_g_balance_keyhunt_score_push);
                        // don't actually GIVE him the -nn points, just log
-               kh_Scores_Event(attacker, world, "push", cvar("g_balance_keyhunt_score_push"), 0);
+               kh_Scores_Event(attacker, world, "push", autocvar_g_balance_keyhunt_score_push, 0);
                PlayerScore_Add(attacker, SP_KH_PUSHES, 1);
                centerprint(attacker, "Your push is the best!");
                bprint("The ", ColoredTeamName(teem), "^7 could not take care of the ", lostkey.netname, "^7 when ", attacker.netname, "^7 came\n");
@@ -576,7 +576,7 @@ void kh_LoserTeam(float teem, entity lostkey)  // runs when a player pushes a fl
        else
        {
                float of, fragsleft, i, j, thisteam;
-               of = cvar("g_balance_keyhunt_score_destroyed_ownfactor");
+               of = autocvar_g_balance_keyhunt_score_destroyed_ownfactor;
 
                FOR_EACH_PLAYER(player)
                        if(player.team != teem)
@@ -587,13 +587,13 @@ void kh_LoserTeam(float teem, entity lostkey)  // runs when a player pushes a fl
                                ++keys;
 
                if(lostkey.kh_previous_owner)
-                       kh_Scores_Event(lostkey.kh_previous_owner, world, "destroyed", 0, -cvar("g_balance_keyhunt_score_destroyed"));
+                       kh_Scores_Event(lostkey.kh_previous_owner, world, "destroyed", 0, -autocvar_g_balance_keyhunt_score_destroyed);
                        // don't actually GIVE him the -nn points, just log
 
                if(lostkey.kh_previous_owner.playerid == lostkey.kh_previous_owner_playerid)
                        PlayerScore_Add(lostkey.kh_previous_owner, SP_KH_DESTROYS, 1);
 
-               DistributeEvenly_Init(cvar("g_balance_keyhunt_score_destroyed"), keys * of + players);
+               DistributeEvenly_Init(autocvar_g_balance_keyhunt_score_destroyed, keys * of + players);
 
                FOR_EACH_KH_KEY(key)
                        if(key.owner && key.team != teem)
@@ -655,7 +655,7 @@ void kh_Key_Think()  // runs all the time
 #endif
 
                if(self.owner.BUTTON_USE)
-               if(time >= self.owner.kh_droptime + cvar("g_balance_keyhunt_delay_drop"))
+               if(time >= self.owner.kh_droptime + autocvar_g_balance_keyhunt_delay_drop)
                {
                        self.owner.kh_droptime = time;
                        self.kh_droptime = time;  // prevent collecting this one for some time
@@ -665,9 +665,9 @@ void kh_Key_Think()  // runs all the time
                        bprint(self.owner.netname, "^7 dropped the ", self.netname, "\n");
                        sound(self.owner, CHAN_AUTO, kh_sound_drop, VOL_BASE, ATTN_NORM);
                        makevectors(self.owner.v_angle);
-                       self.velocity = W_CalculateProjectileVelocity(self.owner.velocity, cvar("g_balance_keyhunt_throwvelocity") * v_forward, FALSE);
+                       self.velocity = W_CalculateProjectileVelocity(self.owner.velocity, autocvar_g_balance_keyhunt_throwvelocity * v_forward, FALSE);
                        kh_Key_AssignTo(self, world);
-                       self.pushltime = time + cvar("g_balance_keyhunt_protecttime");
+                       self.pushltime = time + autocvar_g_balance_keyhunt_protecttime;
                        self.kh_dropperteam = self.team;
                }
        }
@@ -690,7 +690,7 @@ void kh_Key_Think()  // runs all the time
                vector p;
                p = self.owner.origin;
                FOR_EACH_KH_KEY(key)
-                       if(vlen(key.owner.origin - p) > cvar("g_balance_keyhunt_maxdist"))
+                       if(vlen(key.owner.origin - p) > autocvar_g_balance_keyhunt_maxdist)
                                goto not_winning;
                kh_WinnerTeam(self.team);
 :not_winning
@@ -816,9 +816,9 @@ void kh_Key_DropAll(entity player, float suicide) // runs whenever a player dies
                        bprint(player.netname, "^7 died and lost the ", key.netname, "\n");
                        kh_Key_AssignTo(key, world);
                        makevectors('-1 0 0' * (45 + 45 * random()) + '0 360 0' * random());
-                       key.velocity = W_CalculateProjectileVelocity(player.velocity, cvar("g_balance_keyhunt_dropvelocity") * v_forward, FALSE);
+                       key.velocity = W_CalculateProjectileVelocity(player.velocity, autocvar_g_balance_keyhunt_dropvelocity * v_forward, FALSE);
                        key.pusher = mypusher;
-                       key.pushltime = time + cvar("g_balance_keyhunt_protecttime");
+                       key.pushltime = time + autocvar_g_balance_keyhunt_protecttime;
                        if(suicide)
                                key.kh_dropperteam = player.team;
                }
@@ -865,7 +865,7 @@ void kh_WaitForPlayers()  // delay start of the round until enough players are p
 
        teams_missing = kh_CheckEnoughPlayers();
        if(teams_missing == "")
-               kh_Controller_SetThink(cvar("g_balance_keyhunt_delay_round"), "Round starts in ", kh_StartRound);
+               kh_Controller_SetThink(autocvar_g_balance_keyhunt_delay_round, "Round starts in ", kh_StartRound);
        else
                kh_Controller_SetThink(1, strcat("Waiting for players to join...\n\nNeed active players for: ", teams_missing), kh_WaitForPlayers);
 }
@@ -922,7 +922,7 @@ void kh_StartRound()  // runs at the start of each round
        }
 
        kh_tracking_enabled = FALSE;
-       kh_Controller_SetThink(cvar("g_balance_keyhunt_delay_tracking"), "Scanning frequency range...", kh_EnableTrackingDevice);
+       kh_Controller_SetThink(autocvar_g_balance_keyhunt_delay_tracking, "Scanning frequency range...", kh_EnableTrackingDevice);
 }
 
 float kh_HandleFrags(entity attacker, entity targ, float f)  // adds to the player score
@@ -939,11 +939,11 @@ float kh_HandleFrags(entity attacker, entity targ, float f)  // adds to the play
                        nk = 0;
                        for(k = targ.kh_next; k != world; k = k.kh_next)
                                ++nk;
-                       kh_Scores_Event(attacker, targ.kh_next, "carrierfrag", -nk * cvar("g_balance_keyhunt_score_collect"), 0);
+                       kh_Scores_Event(attacker, targ.kh_next, "carrierfrag", -nk * autocvar_g_balance_keyhunt_score_collect, 0);
                }
                else
                {
-                       kh_Scores_Event(attacker, targ.kh_next, "carrierfrag", cvar("g_balance_keyhunt_score_carrierfrag")-1, 0);
+                       kh_Scores_Event(attacker, targ.kh_next, "carrierfrag", autocvar_g_balance_keyhunt_score_carrierfrag-1, 0);
                        PlayerScore_Add(attacker, SP_KH_KCKILLS, 1);
                        // the frag gets added later
                }
@@ -966,9 +966,9 @@ void kh_Initialize()  // sets up th KH environment
        precache_model("models/keyhunt/key.md3");
 
        // setup variables
-       kh_teams = cvar("g_keyhunt_teams_override");
+       kh_teams = autocvar_g_keyhunt_teams_override;
        if(kh_teams < 2)
-               kh_teams = cvar("g_keyhunt_teams");
+               kh_teams = autocvar_g_keyhunt_teams;
        kh_teams = bound(2, kh_teams, 4);
 
        // make a KH entity for controlling the game
index 894bb3ee54d2212f2f6dcfe056b06f5b4d8cc580..1c05a4a091bed2799cd05c1067edf2b1c4562f36 100644 (file)
@@ -78,13 +78,13 @@ MUTATOR_HOOKFUNCTION(dodging_PlayerPhysics) {
        // if we have e.g. 0.5 sec ramptime and a frametime of 0.25, then the ramp code 
        // will be called ramp_time/frametime times = 2 times. so, we need to 
        // add 0.5 * the total speed each frame until the dodge action is done..
-       common_factor = sys_frametime / cvar("sv_dodging_ramp_time");
+       common_factor = sys_frametime / autocvar_sv_dodging_ramp_time;
 
        // if ramp time is smaller than frametime we get problems ;D
        if (common_factor > 1) 
                common_factor = 1;
 
-       new_velocity_gain = self.dodging_velocity_gain - (common_factor * cvar("sv_dodging_horiz_speed"));
+       new_velocity_gain = self.dodging_velocity_gain - (common_factor * autocvar_sv_dodging_horiz_speed);
        if (new_velocity_gain < 0)
                new_velocity_gain = 0;
 
@@ -109,9 +109,9 @@ MUTATOR_HOOKFUNCTION(dodging_PlayerPhysics) {
 
                self.velocity = 
                          self.velocity 
-                       + (cvar("sv_dodging_up_speed") * v_up);
+                       + (autocvar_sv_dodging_up_speed * v_up);
 
-               if (cvar("sv_dodging_sound") == 1)
+               if (autocvar_sv_dodging_sound == 1)
                        PlayerSound(playersound_jump, CHAN_PLAYER, VOICETYPE_PLAYERSOUND);
 
                setanim(self, self.anim_jump, TRUE, FALSE, TRUE);
@@ -120,7 +120,7 @@ MUTATOR_HOOKFUNCTION(dodging_PlayerPhysics) {
        }
 
        // are we done with the dodging ramp yet?
-       if((self.dodging_action == 1) && ((time - self.last_dodging_time) > cvar("sv_dodging_ramp_time")))
+       if((self.dodging_action == 1) && ((time - self.last_dodging_time) > autocvar_sv_dodging_ramp_time))
        {
                // reset state so next dodge can be done correctly
                self.dodging_action = 0;
@@ -134,7 +134,7 @@ MUTATOR_HOOKFUNCTION(dodging_PlayerPhysics) {
 
 // returns 1 if the player is close to a wall
 float check_close_to_wall(float threshold) {
-       if (cvar("sv_dodging_wall_dodging") == 0)
+       if (autocvar_sv_dodging_wall_dodging == 0)
                return 0;
 
        vector trace_start;
@@ -190,11 +190,11 @@ MUTATOR_HOOKFUNCTION(dodging_GetPressedKeys) {
        dodge_detected = 0;
 
        // first check if the last dodge is far enough back in time so we can dodge again
-       if ((time - self.last_dodging_time) < cvar("sv_dodging_delay"))
+       if ((time - self.last_dodging_time) < autocvar_sv_dodging_delay)
                return 0;
 
-       if (check_close_to_ground(cvar("sv_dodging_height_threshold")) != 1 
-               && check_close_to_wall(cvar("sv_dodging_wall_distance_threshold")) != 1)
+       if (check_close_to_ground(autocvar_sv_dodging_height_threshold) != 1 
+               && check_close_to_wall(autocvar_sv_dodging_wall_distance_threshold) != 1)
                return 0;
 
        if (self.movement_x > 0) {
@@ -249,7 +249,7 @@ MUTATOR_HOOKFUNCTION(dodging_GetPressedKeys) {
                self.dodging_action = 1;
                self.dodging_single_action = 1;
 
-               self.dodging_velocity_gain = cvar("sv_dodging_horiz_speed");
+               self.dodging_velocity_gain = autocvar_sv_dodging_horiz_speed;
 
                self.dodging_direction_x = tap_direction_x;
                self.dodging_direction_y = tap_direction_y;
index cc3d563607e3582306dcf5982fafafd95e9f62ec..1cc5c9c65b0408f8def27fce190bcc33d5f3236f 100644 (file)
@@ -61,7 +61,7 @@ void NIX_GiveCurrentWeapon()
                nix_weapon = nix_nextweapon;
                nix_weapon_ammo = nix_nextweapon_ammo;
                nix_nextweapon = 0;
-               nix_nextchange = time + cvar("g_balance_nix_roundtime");
+               nix_nextchange = time + autocvar_g_balance_nix_roundtime;
                //weapon_action(nix_weapon, WR_PRECACHE); // forget it, too slow
        }
        
@@ -71,30 +71,30 @@ void NIX_GiveCurrentWeapon()
                if (self.items & IT_UNLIMITED_WEAPON_AMMO)
                {
                        self.ammo_shells = (nix_weapon_ammo & IT_SHELLS) ?
-                               cvar("g_pickup_shells_max") : 0;
+                               autocvar_g_pickup_shells_max : 0;
                        self.ammo_nails = (nix_weapon_ammo & IT_NAILS) ?
-                               cvar("g_pickup_nails_max") : 0;
+                               autocvar_g_pickup_nails_max : 0;
                        self.ammo_rockets = (nix_weapon_ammo & IT_ROCKETS) ?
-                               cvar("g_pickup_rockets_max") : 0;
+                               autocvar_g_pickup_rockets_max : 0;
                        self.ammo_cells = (nix_weapon_ammo & IT_CELLS) ?
-                               cvar("g_pickup_cells_max") : 0;
+                               autocvar_g_pickup_cells_max : 0;
                        self.ammo_fuel = (nix_weapon_ammo & IT_FUEL) ?
-                               cvar("g_pickup_fuel_max") : 0;
+                               autocvar_g_pickup_fuel_max : 0;
                }
                else
                {
                        self.ammo_shells = (nix_weapon_ammo & IT_SHELLS) ?
-                               cvar("g_balance_nix_ammo_shells") : 0;
+                               autocvar_g_balance_nix_ammo_shells : 0;
                        self.ammo_nails = (nix_weapon_ammo & IT_NAILS) ?
-                               cvar("g_balance_nix_ammo_nails") : 0;
+                               autocvar_g_balance_nix_ammo_nails : 0;
                        self.ammo_rockets = (nix_weapon_ammo & IT_ROCKETS) ?
-                               cvar("g_balance_nix_ammo_rockets") : 0;
+                               autocvar_g_balance_nix_ammo_rockets : 0;
                        self.ammo_cells = (nix_weapon_ammo & IT_CELLS) ?
-                               cvar("g_balance_nix_ammo_cells") : 0;
+                               autocvar_g_balance_nix_ammo_cells : 0;
                        self.ammo_fuel = (nix_weapon_ammo & IT_FUEL) ?
-                               cvar("g_balance_nix_ammo_fuel") : 0;
+                               autocvar_g_balance_nix_ammo_fuel : 0;
                }
-               self.nix_nextincr = time + cvar("g_balance_nix_incrtime");
+               self.nix_nextincr = time + autocvar_g_balance_nix_incrtime;
                if(dt >= 1 && dt <= 5)
                        self.nix_lastinfotime = -42;
                else
@@ -110,16 +110,16 @@ void NIX_GiveCurrentWeapon()
        if(!(self.items & IT_UNLIMITED_WEAPON_AMMO) && time > self.nix_nextincr)
        {
                if (nix_weapon_ammo & IT_SHELLS)
-                       self.ammo_shells = self.ammo_shells + cvar("g_balance_nix_ammoincr_shells");
+                       self.ammo_shells = self.ammo_shells + autocvar_g_balance_nix_ammoincr_shells;
                else if (nix_weapon_ammo & IT_NAILS)
-                       self.ammo_nails = self.ammo_nails + cvar("g_balance_nix_ammoincr_nails");
+                       self.ammo_nails = self.ammo_nails + autocvar_g_balance_nix_ammoincr_nails;
                else if (nix_weapon_ammo & IT_ROCKETS)
-                       self.ammo_rockets = self.ammo_rockets + cvar("g_balance_nix_ammoincr_rockets");
+                       self.ammo_rockets = self.ammo_rockets + autocvar_g_balance_nix_ammoincr_rockets;
                else if (nix_weapon_ammo & IT_CELLS)
-                       self.ammo_cells = self.ammo_cells + cvar("g_balance_nix_ammoincr_cells");
+                       self.ammo_cells = self.ammo_cells + autocvar_g_balance_nix_ammoincr_cells;
                if (nix_weapon_ammo & IT_FUEL) // hook uses cells and fuel
-                       self.ammo_fuel = self.ammo_fuel + cvar("g_balance_nix_ammoincr_fuel");
-               self.nix_nextincr = time + cvar("g_balance_nix_incrtime");
+                       self.ammo_fuel = self.ammo_fuel + autocvar_g_balance_nix_ammoincr_fuel;
+               self.nix_nextincr = time + autocvar_g_balance_nix_incrtime;
        }
 
        self.weapons = 0;
@@ -176,12 +176,12 @@ MUTATOR_HOOKFUNCTION(nix_FilterItem)
                case IT_25HP:
                case IT_ARMOR:
                case IT_ARMOR_SHARD:
-                       if (cvar("g_nix_with_healtharmor"))
+                       if (autocvar_g_nix_with_healtharmor)
                                return 0;
                        break;
                case IT_STRENGTH:
                case IT_INVINCIBLE:
-                       if (cvar("g_nix_with_powerups"))
+                       if (autocvar_g_nix_with_powerups)
                                return 0;
                        break;
        }
@@ -227,7 +227,7 @@ MUTATOR_DEFINITION(mutator_nix)
 
        MUTATOR_ONADD
        {
-               g_nix_with_laser = cvar("g_nix_with_laser");
+               g_nix_with_laser = autocvar_g_nix_with_laser;
 
                nix_nextchange = time;
                nix_nextweapon = 0;
index eb2bed54bd32ab7f55d1710d14427aaae72b24e8..b1f59497abde896bff38abc3fcfbad79120252ad 100644 (file)
@@ -43,7 +43,7 @@ void nb_init() // Called early (worldspawn stage)
        CVTOV(g_nexball_delay_idle);               //10
        CVTOV(g_nexball_football_physics);         //0
 
-       radar_showennemies = cvar("g_nexball_radar_showallplayers");
+       radar_showennemies = autocvar_g_nexball_radar_showallplayers;
 
        InitializeEntity(world, nb_delayedinit, INITPRIO_GAMETYPE);
 }
@@ -62,7 +62,7 @@ void ResetBall();
 void LogNB(string mode, entity actor)
 {
        string s;
-       if(!cvar("sv_eventlog"))
+       if(!autocvar_sv_eventlog)
                return;
        s = strcat(":nexball:", mode);
        if(actor != world)
@@ -256,7 +256,7 @@ void ResetBall (void)
                setorigin(self, self.spawnorigin); // make sure it's positioned correctly anyway
                self.movetype = MOVETYPE_NONE;
                self.think = InitBall;
-               self.nextthink = max(time, game_starttime) + cvar("g_nexball_delay_start");
+               self.nextthink = max(time, game_starttime) + autocvar_g_nexball_delay_start;
        }
 }
 
@@ -305,7 +305,7 @@ void basketball_touch (void)
                football_touch();
                return;
        }
-       if (!self.cnt && other.classname == "player" && (other.playerid != self.dropperid || time > self.ctf_droptime + cvar("g_nexball_delay_collect"))) {
+       if (!self.cnt && other.classname == "player" && (other.playerid != self.dropperid || time > self.ctf_droptime + autocvar_g_nexball_delay_collect)) {
                if (other.health <= 0)
                        return;
                LogNB("caught", other);
@@ -395,7 +395,7 @@ void GoalTouch (void)
        ball.think = ResetBall;
        if (ball.classname == "nexball_basketball")
                ball.touch = football_touch; // better than SUB_Null: football control until the ball gets reset
-       ball.nextthink = time + cvar("g_nexball_delay_goal") * (self.team != GOAL_OUT);
+       ball.nextthink = time + autocvar_g_nexball_delay_goal * (self.team != GOAL_OUT);
 }
 
 //=======================//
@@ -470,13 +470,13 @@ void SpawnBall (void)
 
        if (cvar(strcat("g_", self.classname, "_trail"))) //nexball_basketball :p
        {
-               self.glow_color = cvar("g_nexball_trail_color");
+               self.glow_color = autocvar_g_nexball_trail_color;
                self.glow_trail = TRUE;
        }
 
        self.movetype = MOVETYPE_FLY;
 
-       if (!cvar("g_nexball_sound_bounce"))
+       if (!autocvar_g_nexball_sound_bounce)
                self.noise = "";
        else if (!self.noise)
                self.noise = "sound/nexball/bounce.wav";
@@ -496,7 +496,7 @@ void SpawnBall (void)
 
        self.reset = ball_restart;
        self.think = InitBall;
-       self.nextthink = game_starttime + cvar("g_nexball_delay_start");
+       self.nextthink = game_starttime + autocvar_g_nexball_delay_start;
 }
 
 void spawnfunc_nexball_basketball (void)
@@ -514,8 +514,8 @@ void spawnfunc_nexball_basketball (void)
                self.effects = g_nexball_basketball_effects_default;
        self.solid = SOLID_TRIGGER;
        balls |= BALL_BASKET;
-       self.bouncefactor = cvar("g_nexball_basketball_bouncefactor");
-       self.bouncestop = cvar("g_nexball_basketball_bouncestop");
+       self.bouncefactor = autocvar_g_nexball_basketball_bouncefactor;
+       self.bouncestop = autocvar_g_nexball_basketball_bouncestop;
        SpawnBall();
 }
 
@@ -524,8 +524,8 @@ void spawnfunc_nexball_football (void)
        self.classname = "nexball_football";
        self.solid = SOLID_TRIGGER;
        balls |= BALL_FOOT;
-       self.bouncefactor = cvar("g_nexball_football_bouncefactor");
-       self.bouncestop = cvar("g_nexball_football_bouncestop");
+       self.bouncefactor = autocvar_g_nexball_football_bouncefactor;
+       self.bouncestop = autocvar_g_nexball_football_bouncestop;
        SpawnBall();
 }
 
@@ -603,7 +603,7 @@ void W_Nexball_Touch (void)
        if(attacker.team != other.team || g_nexball_basketball_teamsteal)
        if((ball = other.ballcarried) && (attacker.classname == "player" || attacker.classname == "gib"))
        {
-               other.velocity = other.velocity + normalize(self.velocity) * other.damageforcescale * cvar("g_balance_nexball_secondary_force");
+               other.velocity = other.velocity + normalize(self.velocity) * other.damageforcescale * autocvar_g_balance_nexball_secondary_force;
                other.flags &~= FL_ONGROUND;
                if(!attacker.ballcarried)
                {
@@ -644,15 +644,15 @@ void W_Nexball_Attack (float t)
                mul = 1;
        else
        {
-               mi = cvar("g_nexball_basketball_meter_minpower");
-               ma = max(mi, cvar("g_nexball_basketball_meter_maxpower")); // avoid confusion
+               mi = autocvar_g_nexball_basketball_meter_minpower;
+               ma = max(mi, autocvar_g_nexball_basketball_meter_maxpower); // avoid confusion
                //One triangle wave period with 1 as max
                mul = 2 * mod(t, g_nexball_meter_period) / g_nexball_meter_period;
                if (mul > 1)
                        mul = 2 - mul;
                mul = mi + (ma - mi) * mul; // range from the minimal power to the maximal power
        }
-       DropBall (ball, w_shotorg, W_CalculateProjectileVelocity(self.velocity, w_shotdir * cvar("g_balance_nexball_primary_speed") * mul, FALSE));
+       DropBall (ball, w_shotorg, W_CalculateProjectileVelocity(self.velocity, w_shotdir * autocvar_g_balance_nexball_primary_speed * mul, FALSE));
        //TODO: use the speed_up cvar too ??
 }
 
@@ -675,11 +675,11 @@ void W_Nexball_Attack2 (void)
        setsize (missile, '0 0 0', '0 0 0');
        setorigin (missile, w_shotorg);
 
-       W_SetupProjectileVelocity(missile, cvar("g_balance_nexball_secondary_speed"), 0);
+       W_SetupProjectileVelocity(missile, autocvar_g_balance_nexball_secondary_speed, 0);
        missile.angles = vectoangles (missile.velocity);
        missile.touch = W_Nexball_Touch;
        missile.think = SUB_Remove;
-       missile.nextthink = time + cvar("g_balance_nexball_secondary_lifetime"); //FIXME: use a distance instead?
+       missile.nextthink = time + autocvar_g_balance_nexball_secondary_lifetime; //FIXME: use a distance instead?
 
        missile.effects = EF_BRIGHTFIELD | EF_LOWPRECISION;
        missile.flags = FL_PROJECTILE;
@@ -690,31 +690,31 @@ float w_nexball_weapon(float req)
        if (req == WR_THINK)
        {
                if (self.BUTTON_ATCK)
-               if (weapon_prepareattack(0, cvar("g_balance_nexball_primary_refire")))
-               if (cvar("g_nexball_basketball_meter"))
+               if (weapon_prepareattack(0, autocvar_g_balance_nexball_primary_refire))
+               if (autocvar_g_nexball_basketball_meter)
                {
                        if (self.ballcarried && !self.metertime)
                                self.metertime = time;
                        else
-                               weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_nexball_primary_animtime"), w_ready);
+                               weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_nexball_primary_animtime, w_ready);
                }
                else
                {
                        W_Nexball_Attack(-1);
-                       weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_nexball_primary_animtime"), w_ready);
+                       weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_nexball_primary_animtime, w_ready);
                }
                if (self.BUTTON_ATCK2)
-               if (weapon_prepareattack(1, cvar("g_balance_nexball_secondary_refire")))
+               if (weapon_prepareattack(1, autocvar_g_balance_nexball_secondary_refire))
                {
                        W_Nexball_Attack2();
-                       weapon_thinkf(WFRAME_FIRE2, cvar("g_balance_nexball_secondary_animtime"), w_ready);
+                       weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_nexball_secondary_animtime, w_ready);
                }
 
                if (!self.BUTTON_ATCK && self.metertime && self.ballcarried)
                {
                        W_Nexball_Attack(time - self.metertime);
                        // DropBall or stealing will set metertime back to 0
-                       weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_nexball_primary_animtime"), w_ready);
+                       weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_nexball_primary_animtime, w_ready);
                }
        }
        else if (req == WR_PRECACHE)
index 0ac40ee0579f64730d850225da6ecbda52e4d21e..47e1a7ecd44b11fe7f7a46ae6cbdc8b7d5302040 100644 (file)
@@ -9,7 +9,7 @@ void PlayerStats_Init()
        string uri;
        playerstats_db = -1;
        playerstats_waitforme = TRUE;
-       uri = cvar_string("g_playerstats_uri");
+       uri = autocvar_g_playerstats_uri;
        if(uri == "")
                return;
        playerstats_db = db_create();
@@ -97,7 +97,7 @@ void PlayerStats_Shutdown()
        if(playerstats_db < 0)
                return;
 
-       uri = cvar_string("g_playerstats_uri");
+       uri = autocvar_g_playerstats_uri;
        if(uri != "")
        {
                b = buf_create();
index 4020d5d53f3b9e1a8bbbe24942e18686d6ed960a..0ce3d515a1d537837699d88b825fc9216dad9276 100644 (file)
@@ -179,9 +179,9 @@ float Portal_TeleportPlayer(entity teleporter, entity player)
 
        // reset fade counter
        teleporter.portal_wants_to_vanish = 0;
-       teleporter.fade_time = time + cvar("g_balance_portal_lifetime");
-       teleporter.health = cvar("g_balance_portal_health");
-       teleporter.enemy.health = cvar("g_balance_portal_health");
+       teleporter.fade_time = time + autocvar_g_balance_portal_lifetime;
+       teleporter.health = autocvar_g_balance_portal_health;
+       teleporter.enemy.health = autocvar_g_balance_portal_health;
 
        return 1;
 }
@@ -281,7 +281,7 @@ void Portal_Touch()
                        if(IS_INDEPENDENT_PLAYER(other.aiment) || IS_INDEPENDENT_PLAYER(self.aiment))
                                return; // cannot go through someone else's portal
        fixedmakevectors(self.mangle);
-       g = frametime * '0 0 -1' * cvar("sv_gravity");
+       g = frametime * '0 0 -1' * autocvar_sv_gravity;
        if(!Portal_WillHitPlane(other.origin, other.mins, other.maxs, other.velocity + g, self.origin, v_forward, self.maxs_x))
                return;
 
@@ -361,7 +361,7 @@ void Portal_Connect(entity teleporter, entity destination)
        destination.enemy = teleporter;
        Portal_MakeInPortal(teleporter);
        Portal_MakeOutPortal(destination);
-       teleporter.fade_time = time + cvar("g_balance_portal_lifetime");
+       teleporter.fade_time = time + autocvar_g_balance_portal_lifetime;
        destination.fade_time = teleporter.fade_time;
        teleporter.portal_wants_to_vanish = 0;
        destination.portal_wants_to_vanish = 0;
@@ -447,7 +447,7 @@ void Portal_Think()
        self.solid = SOLID_BBOX;
        self.aiment = world;
 
-       g = frametime * '0 0 -1' * cvar("sv_gravity");
+       g = frametime * '0 0 -1' * autocvar_sv_gravity;
 
        fixedmakevectors(self.mangle);
 
@@ -614,8 +614,8 @@ entity Portal_Spawn(entity own, vector org, vector ang)
        portal.portal_activatetime = time + 0.1;
        portal.takedamage = DAMAGE_AIM;
        portal.event_damage = Portal_Damage;
-       portal.fade_time = time + cvar("g_balance_portal_lifetime");
-       portal.health = cvar("g_balance_portal_health");
+       portal.fade_time = time + autocvar_g_balance_portal_lifetime;
+       portal.health = autocvar_g_balance_portal_health;
        setmodel(portal, "models/portal.md3");
        portal.modelindex_lod0 = portal.modelindex;
        portal.customizeentityforclient = Portal_Customize;
index 27f32be8388637c28aedb6dc25f53d088d349b06..80a379aa1f806090f170ceb4586d738cb19d06c9 100644 (file)
@@ -277,8 +277,8 @@ void race_SendTime(entity e, float cp, float t, float tvalid)
                        PlayerScore_Add(e, SP_RACE_TIME, snew - s);
                        l = PlayerTeamScore_Add(e, SP_RACE_LAPS, ST_RACE_LAPS, 1);
 
-                       if(cvar("fraglimit"))
-                               if(l >= cvar("fraglimit"))
+                       if(autocvar_fraglimit)
+                               if(l >= autocvar_fraglimit)
                                        race_StartCompleting();
 
                        if(race_completing)
@@ -306,9 +306,9 @@ void race_SendTime(entity e, float cp, float t, float tvalid)
                                if(cp == race_timed_checkpoint)
                                {
                                        race_setTime(GetMapname(), t, e.crypto_idfp, e.netname, e);
-                                       if(g_cts && cvar("g_cts_finish_kill_delay"))
+                                       if(g_cts && autocvar_g_cts_finish_kill_delay)
                                        {
-                                               CTS_ClientKill(cvar("g_cts_finish_kill_delay"));
+                                               CTS_ClientKill(autocvar_g_cts_finish_kill_delay);
                                        }
                                }
                                if(t < recordtime || recordtime == 0)
index e2b2134cc628648ae6d0b4b6d1536235cd65617b..8f5e005a425811016052ba7b63882c9cab3f83bb 100644 (file)
@@ -36,7 +36,7 @@ spawn point for runes in runematch
 
 void spawnfunc_runematch_spawn_point()
 {
-       if(!g_runematch || !cvar("g_runematch_fixedspawns"))
+       if(!g_runematch || !autocvar_g_runematch_fixedspawns)
        {
                remove(self);
                return;
@@ -156,7 +156,7 @@ vector RuneColormod(float r)
        if(r == CURSE_EMPATHY)
                _color = '179 0 204';//'128 0 255';
 
-       return _color * (1 / 255) * cvar("g_runematch_rune_color_strength");
+       return _color * (1 / 255) * autocvar_g_runematch_rune_color_strength;
 }
 
 void rune_respawn();
@@ -243,7 +243,7 @@ void rune_respawn()
                self.solid = SOLID_TRIGGER;
                self.touch = rune_touch;
                self.think = rune_respawn;
-               self.nextthink = time + cvar("g_runematch_shuffletime");//30 + random()*5; // fixme: cvar
+               self.nextthink = time + autocvar_g_runematch_shuffletime;//30 + random()*5; // fixme: cvar
        }
        else
        {
@@ -297,7 +297,7 @@ void DropRune(entity pl, entity e)
        e.solid = SOLID_TRIGGER;
        // reposition itself if not picked up soon
        e.think = rune_respawn;
-       e.nextthink = time + cvar("g_runematch_respawntime");//15 + random()*5; // fixme: cvar
+       e.nextthink = time + autocvar_g_runematch_respawntime;//15 + random()*5; // fixme: cvar
        e.touch = rune_touch;
 
        pl.runes = pl.runes - (pl.runes & (e.runes | e.enemy.runes));
@@ -358,8 +358,8 @@ void DropAllRunes(entity pl)
                curse = find(curse, classname, "curse");
        }
 
-       numtodrop = cvar("g_runematch_drop_runes_max");
-       prevent_same = !cvar("g_runematch_allow_same");
+       numtodrop = autocvar_g_runematch_drop_runes_max;
+       prevent_same = !autocvar_g_runematch_allow_same;
 
        rune = curse = world;
        do
@@ -452,7 +452,7 @@ void spawn_runes()
        runes_used  = 0;
        curses_used = 0;
 
-       prevent_same = !cvar("g_runematch_allow_same");
+       prevent_same = !autocvar_g_runematch_allow_same;
        numrunes = RUNE_COUNT;
 
        while(numrunes > 0)
@@ -501,8 +501,8 @@ void spawn_runes()
                e.colormod = RuneColormod(rn);
                e.enemy.colormod = RuneColormod(cs);
 
-               e.alpha = e.enemy.alpha = cvar("g_runematch_rune_alpha");//0.78;
-               e.effects = e.enemy.effects = cvar("g_runematch_rune_effects") | EF_LOWPRECISION;//EF_ADDITIVE;// | EF_FULLBRIGHT;
+               e.alpha = e.enemy.alpha = autocvar_g_runematch_rune_alpha;//0.78;
+               e.effects = e.enemy.effects = autocvar_g_runematch_rune_effects | EF_LOWPRECISION;//EF_ADDITIVE;// | EF_FULLBRIGHT;
 
                //e.glow_size = e.enemy.glow_size = cvar("g_runematch_rune_glow_size");
                //e.glow_color = e.enemy.glow_color = cvar("g_runematch_rune_glow_color");
@@ -533,7 +533,7 @@ void RuneMatchGivePoints()
 {
        entity rune;
 
-       if(!g_runematch || !cvar("g_runematch_pointamt"))
+       if(!g_runematch || !autocvar_g_runematch_pointamt)
                return;
 
        if(gameover)
@@ -542,7 +542,7 @@ void RuneMatchGivePoints()
        if(runematch_point_time > time)
                return;
 
-       runematch_point_time = time + cvar("g_runematch_pointrate");
+       runematch_point_time = time + autocvar_g_runematch_pointrate;
 
        rune = world;
        do
@@ -553,7 +553,7 @@ void RuneMatchGivePoints()
 
                if(rune.owner.classname == "player")
                {
-                       UpdateFrags(rune.owner, cvar("g_runematch_pointamt"));
+                       UpdateFrags(rune.owner, autocvar_g_runematch_pointamt);
                }
        }while(rune);
 }
@@ -586,15 +586,15 @@ float RunematchHandleFrags(entity attacker, entity targ, float f)
        }
 
        if(!arunes && !trunes)
-               return f - 1 + cvar("g_runematch_frags_norune"); // don't give points to players when no runes are involved.
+               return f - 1 + autocvar_g_runematch_frags_norune; // don't give points to players when no runes are involved.
 
        if(arunes)
        {       // got a kill while holding runes
-               newfrags = newfrags + cvar("g_runematch_frags_killedby_runeholder");//5;
+               newfrags = newfrags + autocvar_g_runematch_frags_killedby_runeholder;//5;
        }
        if(trunes)
        {       // killed an enemy holding runes
-               newfrags = newfrags + cvar("g_runematch_frags_killed_runeholder");//5;
+               newfrags = newfrags + autocvar_g_runematch_frags_killed_runeholder;//5;
        }
        if(newfrags)
                f = f - 1 + newfrags;
index fbddca71df4438742f9e125f57bc458e2cf42173..2c5e2b14490498ef2f8190f3530c92e77e450796 100644 (file)
@@ -368,11 +368,11 @@ void WinningConditionHelper()
        entity sk;
 
        s = GetGametype();
-       s = strcat(s, ":", cvar_string("g_xonoticversion"));
+       s = strcat(s, ":", autocvar_g_xonoticversion);
        s = strcat(s, ":P", ftos(cvar_purechanges_count));
        s = strcat(s, "::", GetPlayerScoreString(world, 1)); // make this 1 once we can, note: this doesn't contain any :<letter>
 
-       fullstatus = cvar("g_full_getstatus_responses");
+       fullstatus = autocvar_g_full_getstatus_responses;
 
        if(teamscores_entities_count)
        {
index 96acdba94cea1f892dfa07fadf9df7ecb3def100..a4c993d83f1cd1fc4117f2517aa29b388205fa88 100644 (file)
@@ -91,7 +91,7 @@ void ScoreRules_dom()
 {
        float sp_domticks, sp_score;
        sp_score = sp_domticks = 0;
-       if(cvar("g_domination_disable_frags"))
+       if(autocvar_g_domination_disable_frags)
                sp_domticks = SFL_SORT_PRIO_PRIMARY;
        else
                sp_score = SFL_SORT_PRIO_PRIMARY;
index 0a170635b877781576890064bff53e450ce4dda7..c73f0355f8ad6ba1bd927e53c68e3e457e060d32 100644 (file)
@@ -67,18 +67,18 @@ void CreatureFrame (void)
                                self.dmg = 2;
                        }
                        // check for falling damage
-                       if(!self.hook.state && !g_ca && !(g_cts && !cvar("g_cts_selfdamage")))
+                       if(!self.hook.state && !g_ca && !(g_cts && !autocvar_g_cts_selfdamage))
                        {
                                dm = vlen(self.oldvelocity) - vlen(self.velocity); // dm is now the velocity DECREASE. Velocity INCREASE should never cause a sound or any damage.
                                if (self.deadflag)
-                                       dm = (dm - cvar("g_balance_falldamage_deadminspeed")) * cvar("g_balance_falldamage_factor");
+                                       dm = (dm - autocvar_g_balance_falldamage_deadminspeed) * autocvar_g_balance_falldamage_factor;
                                else
-                                       dm = min((dm - cvar("g_balance_falldamage_minspeed")) * cvar("g_balance_falldamage_factor"), cvar("g_balance_falldamage_maxdamage"));
+                                       dm = min((dm - autocvar_g_balance_falldamage_minspeed) * autocvar_g_balance_falldamage_factor, autocvar_g_balance_falldamage_maxdamage);
                                if (dm > 0)
                                        Damage (self, world, world, dm, DEATH_FALL, self.origin, '0 0 0');
                        }
 
-                       maxspeed = cvar("g_maxspeed");
+                       maxspeed = autocvar_g_maxspeed;
                        if(maxspeed > 0 && vlen(self.velocity) > maxspeed)
                                Damage (self, world, world, 100000, DEATH_SHOOTING_STAR, self.origin, '0 0 0');
 
@@ -175,14 +175,14 @@ void StartFrame (void)
 
        WarpZone_StartFrame();
 
-       sys_frametime = cvar("sys_ticrate") * cvar("slowmo");
+       sys_frametime = autocvar_sys_ticrate * autocvar_slowmo;
        if(sys_frametime <= 0)
                sys_frametime = 1.0 / 60.0; // somewhat safe fallback
 
        if (timeoutStatus == 1) // just before the timeout (when timeoutStatus will be 2)
-               orig_slowmo = cvar("slowmo"); // slowmo will be restored after the timeout
+               orig_slowmo = autocvar_slowmo; // slowmo will be restored after the timeout
 
-       skill = cvar("skill");
+       skill = autocvar_skill;
 
        Spawnqueue_Check();
 
@@ -192,7 +192,7 @@ void StartFrame (void)
 
        if(game_delay_last == TRUE)
        if(game_delay == FALSE)
-       if(cvar("sv_eventlog"))
+       if(autocvar_sv_eventlog)
                        GameLogEcho(":startdelay_ended");
 
        game_delay_last = game_delay;
@@ -200,7 +200,7 @@ void StartFrame (void)
        // if in warmup stage and limit for warmup is hit start match
        if (inWarmupStage)
        if ((g_warmup_limit > 0 && time >= g_warmup_limit)
-        || (g_warmup_limit == 0 && cvar("timelimit") != 0 && time >= cvar("timelimit") * 60))
+        || (g_warmup_limit == 0 && autocvar_timelimit != 0 && time >= autocvar_timelimit * 60))
        {
                ReadyRestart();
                return;
@@ -214,7 +214,7 @@ void StartFrame (void)
        RuneMatchGivePoints();
        bot_serverframe();
 
-       if(cvar("spawn_debugview"))
+       if(autocvar_spawn_debugview)
        {
                RandomSelection_Init();
                for(self = world; (self = find(self, classname, "player")); )
index ee66278b34899733738a66e373f73cded1541406..5a86bee8391a617e719bc3d3e419b2eed2780b9a 100644 (file)
@@ -57,7 +57,7 @@ float Item_Customize()
        {
                if(g_ghost_items)
                {
-                       self.colormod = stov(cvar_string("g_ghost_items_color"));
+                       self.colormod = stov(autocvar_g_ghost_items_color);
                        self.glowmod = self.colormod;
                        self.alpha = g_ghost_items;
                        return TRUE;
@@ -111,7 +111,7 @@ void Item_Show (entity e, float mode)
                // make the item translucent green and not touchable
                e.model = e.mdl;
                e.solid = SOLID_NOT;
-               e.colormod = stov(cvar_string("g_ghost_items_color"));
+               e.colormod = stov(autocvar_g_ghost_items_color);
                e.glowmod = e.colormod;
                e.alpha = g_ghost_items;
                e.customizeentityforclient = func_null;
@@ -123,7 +123,7 @@ void Item_Show (entity e, float mode)
                // hide the item completely
                e.model = string_null;
                e.solid = SOLID_NOT;
-               e.colormod = stov(cvar_string("g_ghost_items_color"));
+               e.colormod = stov(autocvar_g_ghost_items_color);
                e.glowmod = e.colormod;
                e.alpha = 0;
                e.customizeentityforclient = func_null;
@@ -133,9 +133,9 @@ void Item_Show (entity e, float mode)
 
        if (e.strength_finished || e.invincible_finished)
                e.effects |= EF_ADDITIVE | EF_FULLBRIGHT;
-       if (cvar("g_nodepthtestitems"))
+       if (autocvar_g_nodepthtestitems)
                e.effects |= EF_NODEPTHTEST;
-       if (cvar("g_fullbrightitems"))
+       if (autocvar_g_fullbrightitems)
                e.effects |= EF_FULLBRIGHT;
 
        // relink entity (because solid may have changed)
@@ -269,7 +269,7 @@ float Item_GiveTo(entity item, entity player)
                        {
                                pickedup = TRUE;
                                player.ammo_fuel = bound(player.ammo_fuel, g_pickup_fuel_max, player.ammo_fuel + item.ammo_fuel);
-                               player.pauserotfuel_finished = max(player.pauserotfuel_finished, time + cvar("g_balance_pause_fuel_rot"));
+                               player.pauserotfuel_finished = max(player.pauserotfuel_finished, time + autocvar_g_balance_pause_fuel_rot);
                        }
                        if((it = (item.items - (item.items & player.items)) & IT_PICKUPMASK))
                        {
@@ -298,7 +298,7 @@ float Item_GiveTo(entity item, entity player)
                                if (item.weapons & WEPBIT_MINSTANEX)
                                        W_GiveWeapon (player, WEP_MINSTANEX, item.netname);
                                if (item.ammo_cells)
-                                       player.ammo_cells = bound(player.ammo_cells, 999, player.ammo_cells + cvar("g_minstagib_ammo_drop"));
+                                       player.ammo_cells = bound(player.ammo_cells, 999, player.ammo_cells + autocvar_g_minstagib_ammo_drop);
                                player.health = 100;
                        }
 
@@ -308,7 +308,7 @@ float Item_GiveTo(entity item, entity player)
                                pickedup = TRUE;
                                // sound not available
                                // AnnounceTo(player, "_lives");
-                               player.armorvalue = bound(player.armorvalue, 999, player.armorvalue + cvar("g_minstagib_extralives"));
+                               player.armorvalue = bound(player.armorvalue, 999, player.armorvalue + autocvar_g_minstagib_extralives);
                                sprint(player, "^3You picked up some extra lives\n");
                        }
 
@@ -318,7 +318,7 @@ float Item_GiveTo(entity item, entity player)
                                pickedup = TRUE;
                                // sound not available
                                // AnnounceTo(player, "invisible");
-                               player.strength_finished = max(player.strength_finished, time) + cvar("g_balance_powerup_strength_time");
+                               player.strength_finished = max(player.strength_finished, time) + autocvar_g_balance_powerup_strength_time;
                        }
 
                        // speed powerup
@@ -327,7 +327,7 @@ float Item_GiveTo(entity item, entity player)
                                pickedup = TRUE;
                                // sound not available
                                // AnnounceTo(player, "speed");
-                               player.invincible_finished = max(player.invincible_finished, time) + cvar("g_balance_powerup_strength_time");
+                               player.invincible_finished = max(player.invincible_finished, time) + autocvar_g_balance_powerup_strength_time;
                        }
                }
        }
@@ -390,7 +390,7 @@ float Item_GiveTo(entity item, entity player)
                        {
                                pickedup = TRUE;
                                player.ammo_fuel = bound(player.ammo_fuel, g_pickup_fuel_max, player.ammo_fuel + item.ammo_fuel);
-                               player.pauserotfuel_finished = max(player.pauserotfuel_finished, time + cvar("g_balance_pause_fuel_rot"));
+                               player.pauserotfuel_finished = max(player.pauserotfuel_finished, time + autocvar_g_balance_pause_fuel_rot);
                        }
                }
 
@@ -418,12 +418,12 @@ float Item_GiveTo(entity item, entity player)
                        if (item.strength_finished)
                        {
                                pickedup = TRUE;
-                               player.strength_finished = max(player.strength_finished, time) + cvar("g_balance_powerup_strength_time");
+                               player.strength_finished = max(player.strength_finished, time) + autocvar_g_balance_powerup_strength_time;
                        }
                        if (item.invincible_finished)
                        {
                                pickedup = TRUE;
-                               player.invincible_finished = max(player.invincible_finished, time) + cvar("g_balance_powerup_invincible_time");
+                               player.invincible_finished = max(player.invincible_finished, time) + autocvar_g_balance_powerup_invincible_time;
                        }
 
                        if (item.health)
@@ -431,14 +431,14 @@ float Item_GiveTo(entity item, entity player)
                        {
                                pickedup = TRUE;
                                player.health = bound(player.health, item.max_health, player.health + item.health);
-                               player.pauserothealth_finished = max(player.pauserothealth_finished, time + cvar("g_balance_pause_health_rot"));
+                               player.pauserothealth_finished = max(player.pauserothealth_finished, time + autocvar_g_balance_pause_health_rot);
                        }
                        if (item.armorvalue)
                        if ((player.armorvalue < item.max_armorvalue) || item.pickup_anyway)
                        {
                                pickedup = TRUE;
                                player.armorvalue = bound(player.armorvalue, item.max_armorvalue, player.armorvalue + item.armorvalue);
-                               player.pauserotarmor_finished = max(player.pauserotarmor_finished, time + cvar("g_balance_pause_armor_rot"));
+                               player.pauserotarmor_finished = max(player.pauserotarmor_finished, time + autocvar_g_balance_pause_armor_rot);
                        }
                }
        }
@@ -779,7 +779,7 @@ void StartItem (string itemmodel, string pickupsound, float defaultrespawntime,
                }
                */
 
-               if(cvar("spawn_debug") >= 2)
+               if(autocvar_spawn_debug >= 2)
                {
                        entity otheritem;
                        for(otheritem = findradius(self.origin, 3); otheritem; otheritem = otheritem.chain)
@@ -816,7 +816,7 @@ void StartItem (string itemmodel, string pickupsound, float defaultrespawntime,
                                return;
                        }
                }
-               else if (!cvar("g_pickup_items") && itemid != IT_STRENGTH && itemid != IT_INVINCIBLE && itemid != IT_HEALTH)
+               else if (!autocvar_g_pickup_items && itemid != IT_STRENGTH && itemid != IT_INVINCIBLE && itemid != IT_HEALTH)
                {
                        startitem_failed = TRUE;
                        remove (self);
@@ -1255,10 +1255,10 @@ void spawnfunc_item_health_large (void) {
 }
 
 void spawnfunc_item_health_mega (void) {
-       if(!cvar("g_powerup_superhealth"))
+       if(!autocvar_g_powerup_superhealth)
                return;
 
-       if((g_arena || g_ca) && !cvar("g_arena_powerups"))
+       if((g_arena || g_ca) && !autocvar_g_arena_powerups)
                return;
 
        if(g_minstagib) {
@@ -1282,10 +1282,10 @@ void spawnfunc_item_health25() { spawnfunc_item_health_medium(); }
 void spawnfunc_item_health100() { spawnfunc_item_health_mega(); }
 
 void spawnfunc_item_strength (void) {
-       if(!cvar("g_powerup_strength"))
+       if(!autocvar_g_powerup_strength)
                return;
 
-       if((g_arena || g_ca) && !cvar("g_arena_powerups"))
+       if((g_arena || g_ca) && !autocvar_g_arena_powerups)
                return;
 
        if(g_minstagib) {
@@ -1298,10 +1298,10 @@ void spawnfunc_item_strength (void) {
 }
 
 void spawnfunc_item_invincible (void) {
-       if(!cvar("g_powerup_shield"))
+       if(!autocvar_g_powerup_shield)
                return;
 
-       if((g_arena || g_ca) && !cvar("g_arena_powerups"))
+       if((g_arena || g_ca) && !autocvar_g_arena_powerups)
                return;
 
        if(g_minstagib) {
@@ -1357,9 +1357,9 @@ void spawnfunc_target_items (void)
 
        self.use = target_items_use;
        if(!self.strength_finished)
-               self.strength_finished = cvar("g_balance_powerup_strength_time");
+               self.strength_finished = autocvar_g_balance_powerup_strength_time;
        if(!self.invincible_finished)
-               self.invincible_finished = cvar("g_balance_powerup_invincible_time");
+               self.invincible_finished = autocvar_g_balance_powerup_invincible_time;
 
        precache_sound("misc/itempickup.wav");
        precache_sound("misc/megahealth.wav");
@@ -1752,9 +1752,9 @@ float GiveItems(entity e, float beginarg, float endarg)
        POSTGIVE_VALUE(e, ammo_cells, 0, "misc/itempickup.wav", string_null);
        POSTGIVE_VALUE(e, ammo_shells, 0, "misc/itempickup.wav", string_null);
        POSTGIVE_VALUE(e, ammo_rockets, 0, "misc/itempickup.wav", string_null);
-       POSTGIVE_VALUE_ROT(e, ammo_fuel, 1, pauserotfuel_finished, cvar("g_balance_pause_fuel_rot"), pauseregen_finished, cvar("g_balance_pause_fuel_regen"), "misc/itempickup.wav", string_null);
-       POSTGIVE_VALUE_ROT(e, armorvalue, 1, pauserotarmor_finished, cvar("g_balance_pause_armor_rot"), pauseregen_finished, cvar("g_balance_pause_health_regen"), "misc/armor25.wav", string_null);
-       POSTGIVE_VALUE_ROT(e, health, 1, pauserothealth_finished, cvar("g_balance_pause_health_rot"), pauseregen_finished, cvar("g_balance_pause_health_regen"), "misc/megahealth.wav", string_null);
+       POSTGIVE_VALUE_ROT(e, ammo_fuel, 1, pauserotfuel_finished, autocvar_g_balance_pause_fuel_rot, pauseregen_finished, autocvar_g_balance_pause_fuel_regen, "misc/itempickup.wav", string_null);
+       POSTGIVE_VALUE_ROT(e, armorvalue, 1, pauserotarmor_finished, autocvar_g_balance_pause_armor_rot, pauseregen_finished, autocvar_g_balance_pause_health_regen, "misc/armor25.wav", string_null);
+       POSTGIVE_VALUE_ROT(e, health, 1, pauserothealth_finished, autocvar_g_balance_pause_health_rot, pauseregen_finished, autocvar_g_balance_pause_health_regen, "misc/megahealth.wav", string_null);
 
        if (g_minstagib)
        {
index e5340ab930e63ee5031c32be23c80d4404aa9df1..5fced5fe7ad736cb996f3e7167e4114a92efb51b 100644 (file)
@@ -35,7 +35,7 @@ vector trigger_push_calculatevelocity(vector org, entity tgt, float ht)
 
        torg = tgt.origin + (tgt.mins + tgt.maxs) * 0.5;
 
-       grav = cvar("sv_gravity");
+       grav = autocvar_sv_gravity;
 
        zdist = torg_z - org_z;
        sdist = vlen(torg - org - zdist * '0 0 1');
index d92a2539d42487fb436bfa19c0c53999170e1bfc..3089ab650a83b33f449bdea80375ae6cfc63692b 100644 (file)
@@ -542,7 +542,7 @@ void spawnfunc_func_pendulum()
        if(!self.freq)
        {
                // find pendulum length (same formula as Q3A)
-               self.freq = 1 / (M_PI * 2) * sqrt(cvar("sv_gravity") / (3 * max(8, fabs(self.mins_z))));
+               self.freq = 1 / (M_PI * 2) * sqrt(autocvar_sv_gravity / (3 * max(8, fabs(self.mins_z))));
        }
 
        // copy initial angle
index 3d3f1d626ec0f43c99ea5839e5d5315f66beaab5..241b8f76df6cbb85cc53e18a2d2cb3e255005625 100644 (file)
@@ -70,25 +70,25 @@ void target_give_init()
        entity targ;
        for (targ = world; (targ = find(targ, targetname, self.target)); ) {
                if (targ.classname == "weapon_rocketlauncher") {
-                       self.ammo_rockets += targ.count * cvar("g_balance_rocketlauncher_ammo");
+                       self.ammo_rockets += targ.count * autocvar_g_balance_rocketlauncher_ammo;
                        self.netname = "rocketlauncher";
                }
                else if (targ.classname == "weapon_plasmagun") {
-                       self.ammo_rockets += targ.count * cvar("g_balance_hagar_primary_ammo");
+                       self.ammo_rockets += targ.count * autocvar_g_balance_hagar_primary_ammo;
                        if(self.netname == "")
                                self.netname = "hagar";
                        else
                                self.netname = strcat(self.netname, " hagar");
                }
                else if (targ.classname == "weapon_bfg") {
-                       self.ammo_cells += targ.count * cvar("g_balance_crylink_primary_ammo");
+                       self.ammo_cells += targ.count * autocvar_g_balance_crylink_primary_ammo;
                        if(self.netname == "")
                                self.netname = "crylink";
                        else
                                self.netname = strcat(self.netname, " crylink");
                }
                else if (targ.classname == "weapon_grenadelauncher") {
-                       self.ammo_rockets += targ.count * cvar("g_balance_grenadelauncher_primary_ammo");
+                       self.ammo_rockets += targ.count * autocvar_g_balance_grenadelauncher_primary_ammo;
                        if(self.netname == "")
                                self.netname = "grenadelauncher";
                        else
index 1df46990a7a508f0ed0f301b659a6e78593bb075..93ced82670b1a36fb15c42a8236419621d52513a 100644 (file)
@@ -33,7 +33,7 @@ float check_tdeath(entity player, vector org, vector telefragmin, vector telefra
        {
                TDEATHLOOP(org)
                {
-                       if not(teams_matter && cvar("g_telefrags_teamplay") && head.team == player.team)
+                       if not(teams_matter && autocvar_g_telefrags_teamplay && head.team == player.team)
                                if(head.classname == "player")
                                        if(head.health >= 1)
                                                return 1;
@@ -48,7 +48,7 @@ void tdeath(entity player, entity teleporter, entity telefragger, vector telefra
        {
                if (player.classname == "player" && player.health >= 1)
                {
-                       if not(teams_matter && cvar("g_telefrags_teamplay") && head.team == player.team)
+                       if not(teams_matter && autocvar_g_telefrags_teamplay && head.team == player.team)
                        {
                                if(head.classname == "player")
                                        if(head.health >= 1)
@@ -115,7 +115,7 @@ void TeleportPlayer(entity teleporter, entity player, vector to, vector to_angle
        if(player.classname == "player")
        {
                if(tflags & TELEPORT_FLAG_TDEATH)
-                       if(player.takedamage && player.deadflag == DEAD_NO && !g_race && !g_cts && (cvar("g_telefrags") || (tflags & TELEPORT_FLAG_FORCE_TDEATH)))
+                       if(player.takedamage && player.deadflag == DEAD_NO && !g_race && !g_cts && (autocvar_g_telefrags || (tflags & TELEPORT_FLAG_FORCE_TDEATH)))
                                tdeath(player, teleporter, telefragger, telefragmin, telefragmax);
 
                // player no longer is on ground
@@ -128,7 +128,7 @@ void TeleportPlayer(entity teleporter, entity player, vector to, vector to_angle
                if(teleporter.owner)
                {
                        player.pusher = teleporter.owner;
-                       player.pushltime = time + cvar("g_maxpushtime");
+                       player.pushltime = time + autocvar_g_maxpushtime;
                }
                else
                {
@@ -183,7 +183,7 @@ void Teleport_Touch (void)
                for(e = world; (e = find(e, targetname, self.target)); )
                {
                        p = 1;
-                       if(cvar("g_telefrags_avoid"))
+                       if(autocvar_g_telefrags_avoid)
                        {
                                o = e.origin + '0 0 1' * (1 - other.mins_z - 24);
                                if(check_tdeath(other, o, '0 0 0', '0 0 0'))
@@ -205,9 +205,9 @@ void Teleport_Touch (void)
        if(e.speed)
                if(vlen(other.velocity) > e.speed)
                        other.velocity = normalize(other.velocity) * max(0, e.speed);
-       if(cvar("g_teleport_maxspeed"))
-               if(vlen(other.velocity) > cvar("g_teleport_maxspeed"))
-                       other.velocity = normalize(other.velocity) * max(0, cvar("g_teleport_maxspeed"));
+       if(autocvar_g_teleport_maxspeed)
+               if(vlen(other.velocity) > autocvar_g_teleport_maxspeed)
+                       other.velocity = normalize(other.velocity) * max(0, autocvar_g_teleport_maxspeed);
 
        o = e.origin + '0 0 1' * (1 - other.mins_z - 24);
        TeleportPlayer(self, other, o, e.mangle, v_forward * vlen(other.velocity), '0 0 0', '0 0 0', TELEPORT_FLAGS_TELEPORTER);
index 4dfa9a72e4e7cdc12dacea7797ab4b858bce1db3..fffae0b85eae5c4d8500dc830c81c191ebe089d5 100644 (file)
@@ -14,11 +14,11 @@ float IsTeamBalanceForced()
                return 0; // no rebalancing whatsoever please
        if(!teams_matter)
                return 0;
-       if(cvar("g_campaign"))
+       if(autocvar_g_campaign)
                return 0;
-       if(cvar("bot_vs_human") && (c3==-1 && c4==-1))
+       if(autocvar_bot_vs_human && (c3==-1 && c4==-1))
                return 0;
-       if(!cvar("g_balance_teams_force"))
+       if(!autocvar_g_balance_teams_force)
                return -1;
        return 1;
 }
@@ -76,7 +76,7 @@ void entcs_init();
 
 void LogTeamchange(float player_id, float team_number, float type)
 {
-       if(!cvar("sv_eventlog"))
+       if(!autocvar_sv_eventlog)
                return;
 
        if(player_id < 1)
@@ -112,7 +112,7 @@ void ReadGameCvars()
        float i;
 
        found = 0;
-       prev = cvar("gamecfg");
+       prev = autocvar_gamecfg;
        for(i = 0; i < 2; ++i)
        {
 //#NO AUTOCVARS START
@@ -143,7 +143,7 @@ void ReadGameCvars()
        if(!found)
                g_dm = 1;
 
-       if(g_dm && cvar("deathmatch_force_teamplay"))
+       if(g_dm && autocvar_deathmatch_force_teamplay)
        {
                g_dm = 0;
                g_tdm = 1;
@@ -203,9 +203,9 @@ void InitGameplayMode()
        ReadGameCvars();
 
        // set both here, gamemode can override it later
-       timelimit_override = cvar("timelimit_override");
-       fraglimit_override = cvar("fraglimit_override");
-       leadlimit_override = cvar("leadlimit_override");
+       timelimit_override = autocvar_timelimit_override;
+       fraglimit_override = autocvar_fraglimit_override;
+       leadlimit_override = autocvar_leadlimit_override;
 
        if(g_dm)
        {
@@ -219,7 +219,7 @@ void InitGameplayMode()
                gamemode_name = "Team Deathmatch";
                ActivateTeamplay();
                tdm_init();
-               if(cvar("g_tdm_team_spawns"))
+               if(autocvar_g_tdm_team_spawns)
                        have_team_spawns = -1; // request team spawns
        }
 
@@ -228,8 +228,8 @@ void InitGameplayMode()
                game = GAME_DOMINATION;
                gamemode_name = "Domination";
                ActivateTeamplay();
-               fraglimit_override = cvar("g_domination_point_limit");
-               leadlimit_override = cvar("g_domination_point_leadlimit");
+               fraglimit_override = autocvar_g_domination_point_limit;
+               leadlimit_override = autocvar_g_domination_point_leadlimit;
                dom_init();
                have_team_spawns = -1; // request team spawns
        }
@@ -239,20 +239,20 @@ void InitGameplayMode()
                game = GAME_CTF;
                gamemode_name = "Capture the Flag";
                ActivateTeamplay();
-               if(cvar("g_campaign"))
+               if(autocvar_g_campaign)
                        g_ctf_win_mode = 2;
                else
-                       g_ctf_win_mode = cvar("g_ctf_win_mode");
-               g_ctf_ignore_frags = cvar("g_ctf_ignore_frags");
+                       g_ctf_win_mode = autocvar_g_ctf_win_mode;
+               g_ctf_ignore_frags = autocvar_g_ctf_ignore_frags;
                if(g_ctf_win_mode == 2)
                {
-                       fraglimit_override = cvar("g_ctf_capture_limit");
-                       leadlimit_override = cvar("g_ctf_capture_leadlimit");
+                       fraglimit_override = autocvar_g_ctf_capture_limit;
+                       leadlimit_override = autocvar_g_ctf_capture_leadlimit;
                }
                else
                {
-                       fraglimit_override = cvar("capturelimit_override");
-                       leadlimit_override = cvar("captureleadlimit_override");
+                       fraglimit_override = autocvar_capturelimit_override;
+                       leadlimit_override = autocvar_captureleadlimit_override;
                }
                ctf_init();
                have_team_spawns = -1; // request team spawns
@@ -262,10 +262,10 @@ void InitGameplayMode()
        {
                game = GAME_RUNEMATCH;
                gamemode_name = "Rune Match";
-               if(cvar("deathmatch_force_teamplay"))
+               if(autocvar_deathmatch_force_teamplay)
                        ActivateTeamplay();
-               fraglimit_override = cvar("g_runematch_point_limit");
-               leadlimit_override = cvar("g_runematch_point_leadlimit");
+               fraglimit_override = autocvar_g_runematch_point_limit;
+               leadlimit_override = autocvar_g_runematch_point_leadlimit;
                runematch_init();
        }
 
@@ -273,7 +273,7 @@ void InitGameplayMode()
        {
                game = GAME_LMS;
                gamemode_name = "Last Man Standing";
-               fraglimit_override = cvar("g_lms_lives_override");
+               fraglimit_override = autocvar_g_lms_lives_override;
                leadlimit_override = 0; // not supported by LMS
                if(fraglimit_override == 0)
                        fraglimit_override = -1;
@@ -286,12 +286,12 @@ void InitGameplayMode()
        {
                game = GAME_ARENA;
                gamemode_name = "Arena";
-               fraglimit_override = cvar("g_arena_point_limit");
-               leadlimit_override = cvar("g_arena_point_leadlimit");
-               maxspawned = cvar("g_arena_maxspawned");
+               fraglimit_override = autocvar_g_arena_point_limit;
+               leadlimit_override = autocvar_g_arena_point_leadlimit;
+               maxspawned = autocvar_g_arena_maxspawned;
                if(maxspawned < 2)
                        maxspawned = 2;
-               arena_roundbased = cvar("g_arena_roundbased");
+               arena_roundbased = autocvar_g_arena_roundbased;
        }
 
        if(g_ca)
@@ -299,8 +299,8 @@ void InitGameplayMode()
                game = GAME_CA;
                gamemode_name = "Clan Arena";
                ActivateTeamplay();
-               fraglimit_override = cvar("g_ca_point_limit");
-               leadlimit_override = cvar("g_ca_point_leadlimit");
+               fraglimit_override = autocvar_g_ca_point_limit;
+               leadlimit_override = autocvar_g_ca_point_leadlimit;
                precache_sound("ctf/red_capture.wav");
                precache_sound("ctf/blue_capture.wav");
        }
@@ -309,8 +309,8 @@ void InitGameplayMode()
                game = GAME_KEYHUNT;
                gamemode_name = "Key Hunt";
                ActivateTeamplay();
-               fraglimit_override = cvar("g_keyhunt_point_limit");
-               leadlimit_override = cvar("g_keyhunt_point_leadlimit");
+               fraglimit_override = autocvar_g_keyhunt_point_limit;
+               leadlimit_override = autocvar_g_keyhunt_point_leadlimit;
                MUTATOR_ADD(gamemode_keyhunt);
        }
 
@@ -319,8 +319,8 @@ void InitGameplayMode()
                game = GAME_FREEZETAG;
                gamemode_name = "Freeze Tag";
                ActivateTeamplay();
-               fraglimit_override = cvar("g_freezetag_point_limit");
-               leadlimit_override = cvar("g_freezetag_point_leadlimit");
+               fraglimit_override = autocvar_g_freezetag_point_limit;
+               leadlimit_override = autocvar_g_freezetag_point_leadlimit;
                MUTATOR_ADD(gamemode_freezetag);
        }
 
@@ -346,17 +346,17 @@ void InitGameplayMode()
                game = GAME_RACE;
                gamemode_name = "Race";
 
-               if(cvar("g_race_teams"))
+               if(autocvar_g_race_teams)
                {
                        ActivateTeamplay();
-                       race_teams = bound(2, cvar("g_race_teams"), 4);
+                       race_teams = bound(2, autocvar_g_race_teams, 4);
                        have_team_spawns = -1; // request team spawns
                }
                else
                        race_teams = 0;
 
-               qualifying_override = cvar("g_race_qualifying_timelimit_override");
-               fraglimit_override = cvar("g_race_laps_limit");
+               qualifying_override = autocvar_g_race_qualifying_timelimit_override;
+               fraglimit_override = autocvar_g_race_laps_limit;
                leadlimit_override = 0; // currently not supported by race
        }
 
@@ -373,8 +373,8 @@ void InitGameplayMode()
        {
                game = GAME_NEXBALL;
                gamemode_name = "Nexball";
-               fraglimit_override = cvar("g_nexball_goallimit");
-               leadlimit_override = cvar("g_nexball_goalleadlimit");
+               fraglimit_override = autocvar_g_nexball_goallimit;
+               leadlimit_override = autocvar_g_nexball_goalleadlimit;
                ActivateTeamplay();
                nb_init();
                have_team_spawns = -1; // request team spawns
@@ -397,7 +397,7 @@ void InitGameplayMode()
        cache_lastmutatormsg = strzone("");
 
        // enforce the server's universal frag/time limits
-       if(!cvar("g_campaign"))
+       if(!autocvar_g_campaign)
        {
                if(fraglimit_override >= 0)
                        cvar_set("fraglimit", ftos(fraglimit_override));
@@ -412,19 +412,19 @@ void InitGameplayMode()
        if(g_race)
        {
                // we need to find out the correct value for g_race_qualifying
-               if(cvar("g_campaign"))
+               if(autocvar_g_campaign)
                {
                        g_race_qualifying = 1;
                }
-               else if(!cvar("g_campaign") && cvar("g_race_qualifying_timelimit") > 0)
+               else if(!autocvar_g_campaign && autocvar_g_race_qualifying_timelimit > 0)
                {
                        g_race_qualifying = 2;
-                       race_fraglimit = cvar("fraglimit");
-                       race_leadlimit = cvar("leadlimit");
-                       race_timelimit = cvar("timelimit");
+                       race_fraglimit = autocvar_fraglimit;
+                       race_leadlimit = autocvar_leadlimit;
+                       race_timelimit = autocvar_timelimit;
                        cvar_set("fraglimit", "0");
                        cvar_set("leadlimit", "0");
-                       cvar_set("timelimit", ftos(cvar("g_race_qualifying_timelimit")));
+                       cvar_set("timelimit", ftos(autocvar_g_race_qualifying_timelimit));
                }
                else
                        g_race_qualifying = 0;
@@ -444,7 +444,7 @@ void InitGameplayMode()
 string GetClientVersionMessage() {
        local string versionmsg;
        if (self.version_mismatch) {
-               if(self.version < cvar("gameversion")) {
+               if(self.version < autocvar_gameversion) {
                        versionmsg = "^3Your client version is outdated.\n\n\n### YOU WON'T BE ABLE TO PLAY ON THIS SERVER ###\n\n\nPlease update!!!^8";
                } else {
                        versionmsg = "^3This server is using an outdated Xonotic version.\n\n\n ### THIS SERVER IS INCOMPATIBLE AND THUS YOU CANNOT JOIN ###.^8";
@@ -462,14 +462,14 @@ void PrintWelcomeMessage(entity pl)
 
        if(self.cvar_scr_centertime == 0) return;
 
-       if(cvar("g_campaign"))
+       if(autocvar_g_campaign)
        {
                if(self.classname == "player" && !self.BUTTON_INFO)
                        return;
        }
        else
        {
-               if((time - self.jointime) > cvar("welcome_message_time") && !self.BUTTON_INFO)
+               if((time - self.jointime) > autocvar_welcome_message_time && !self.BUTTON_INFO)
                        return;
        }
 
@@ -478,7 +478,7 @@ void PrintWelcomeMessage(entity pl)
                self.welcomemessage_time = time + max(0.5, self.cvar_scr_centertime * 0.6);
        }
 
-       if(cvar("g_campaign"))
+       if(autocvar_g_campaign)
        {
                centerprint(pl, campaign_message);
                return;
@@ -518,9 +518,9 @@ void PrintWelcomeMessage(entity pl)
                else
                        modifications = strcat(modifications, ", ", g_weaponarena_list, " Arena");
        }
-       if(cvar("g_start_weapon_laser") == 0)
+       if(autocvar_g_start_weapon_laser == 0)
                modifications = strcat(modifications, ", No start weapons");
-       if(cvar("sv_gravity") < 800)
+       if(autocvar_sv_gravity < 800)
                modifications = strcat(modifications, ", Low gravity");
        if(g_cloaked)
                modifications = strcat(modifications, ", Cloaked");
@@ -541,7 +541,7 @@ void PrintWelcomeMessage(entity pl)
        local string versionmessage;
        versionmessage = GetClientVersionMessage();
 
-       s = strcat(s, NEWLINES, "This is Xonotic ", cvar_string("g_xonoticversion"), "\n", versionmessage);
+       s = strcat(s, NEWLINES, "This is Xonotic ", autocvar_g_xonoticversion, "\n", versionmessage);
        s = strcat(s, "^8\n\nmatch type is ^1", gamemode_name, "^8\n");
 
        if(modifications != "")
@@ -553,13 +553,13 @@ void PrintWelcomeMessage(entity pl)
        if (g_grappling_hook)
                s = strcat(s, "\n\n^3grappling hook^8 is enabled, press 'e' to use it\n");
 
-       if(cache_lastmutatormsg != cvar_string("g_mutatormsg"))
+       if(cache_lastmutatormsg != autocvar_g_mutatormsg)
        {
                if(cache_lastmutatormsg)
                        strunzone(cache_lastmutatormsg);
                if(cache_mutatormsg)
                        strunzone(cache_mutatormsg);
-               cache_lastmutatormsg = strzone(cvar_string("g_mutatormsg"));
+               cache_lastmutatormsg = strzone(autocvar_g_mutatormsg);
                cache_mutatormsg = strzone(cache_lastmutatormsg);
        }
 
@@ -567,7 +567,7 @@ void PrintWelcomeMessage(entity pl)
                s = strcat(s, "\n\n^8special gameplay tips: ^7", cache_mutatormsg);
        }
 
-       motd = cvar_string("sv_motd");
+       motd = autocvar_sv_motd;
        if (motd != "") {
                s = strcat(s, "\n\n^8MOTD: ^7", strreplace("\\n", "\n", motd));
        }
@@ -632,7 +632,7 @@ void CheckAllowedTeams (entity for_whom)
        c1 = c2 = c3 = c4 = -1;
        cb1 = cb2 = cb3 = cb4 = 0;
 
-       if(cvar("g_campaign") && for_whom && clienttype(for_whom) == CLIENTTYPE_REAL)
+       if(autocvar_g_campaign && for_whom && clienttype(for_whom) == CLIENTTYPE_REAL)
        {
                c1 = 0; // only allow RED team for player joining
        }
@@ -702,9 +702,9 @@ void CheckAllowedTeams (entity for_whom)
 
        // TODO: Balance quantity of bots across > 2 teams when bot_vs_human is set (and remove next line)
        if(c3==-1 && c4==-1)
-       if(cvar("bot_vs_human") && for_whom)
+       if(autocvar_bot_vs_human && for_whom)
        {
-               if(cvar("bot_vs_human") > 0)
+               if(autocvar_bot_vs_human > 0)
                {
                        // bots are all blue
                        if(clienttype(for_whom) == CLIENTTYPE_BOT)
@@ -817,12 +817,12 @@ float FindSmallestTeam(entity pl, float ignore_pl)
        if(c4 >= 0)
                totalteams = totalteams + 1;
 
-       if((cvar("bot_vs_human") || pl.team_forced > 0) && totalteams == 1)
+       if((autocvar_bot_vs_human || pl.team_forced > 0) && totalteams == 1)
                totalteams += 1;
 
        if(totalteams <= 1)
        {
-               if(cvar("g_campaign") && pl && clienttype(pl) == CLIENTTYPE_REAL)
+               if(autocvar_g_campaign && pl && clienttype(pl) == CLIENTTYPE_REAL)
                        return 1; // special case for campaign and player joining
                else if(g_domination)
                        error("Too few teams available for domination\n");
@@ -900,10 +900,10 @@ float JoinBestTeam(entity pl, float only_return_best, float forcebestteam)
        CheckAllowedTeams(pl);
 
        // if we want the player in a certain team for campaign, force him there
-       if(cvar("g_campaign"))
+       if(autocvar_g_campaign)
        if(clienttype(pl) == CLIENTTYPE_REAL) // only players, not bots
        {
-               switch(cvar("g_campaign_forceteam"))
+               switch(autocvar_g_campaign_forceteam)
                {
                        case 1:
                                SetPlayerColors(pl, COLOR_TEAM1 - 1);
@@ -1037,12 +1037,12 @@ void SV_ChangeTeam(float _color)
                return;
        }
 
-       if((cvar("g_campaign")) || (cvar("g_changeteam_banned") && self.wasplayer)) {
+       if((autocvar_g_campaign) || (autocvar_g_changeteam_banned && self.wasplayer)) {
                sprint(self, "Team changes not allowed\n");
                return; // changing teams is not allowed
        }
 
-       if(cvar("g_balance_teams_prevent_imbalance"))
+       if(autocvar_g_balance_teams_prevent_imbalance)
        {
                // only allow changing to a smaller or equal size team
 
@@ -1357,9 +1357,9 @@ void tdm_spawnteams()
 {
        float numteams;
 
-       numteams = cvar("g_tdm_teams_override");
+       numteams = autocvar_g_tdm_teams_override;
        if(numteams < 2)
-               numteams = cvar("g_tdm_teams");
+               numteams = autocvar_g_tdm_teams;
        numteams = bound(2, numteams, 4);
 
        tdm_spawnteam("Red", COLOR_TEAM1-1);
index fdeb4dd5ccb1a757d9b3af95a99be20b05e4fa15..b7af33af82e506cc657ceee10e3cd6573fbb42d5 100644 (file)
@@ -276,8 +276,8 @@ void turret_stdproc_damage (entity inflictor, entity attacker, float damage, flo
         if(clienttype(attacker) == CLIENTTYPE_REAL)
             sprint(attacker, "\{1}Turret tells you: I'm on your team!\n");
 
-        if(cvar("g_friendlyfire"))
-            damage = damage * cvar("g_friendlyfire");
+        if(autocvar_g_friendlyfire)
+            damage = damage * autocvar_g_friendlyfire;
         else
             return;
     }
index 3561c8ca0fb7dee70a26a607932a74768f319d21..4a2e886af863bdca739e41c43786dc5f684bc5ab 100644 (file)
@@ -718,7 +718,7 @@ void turret_think()
 
         // g_turrets_targetscan_maxdelay forces a target re-scan at least this often
         float do_target_scan;
-        if((self.target_select_time + cvar("g_turrets_targetscan_maxdelay")) < time)
+        if((self.target_select_time + autocvar_g_turrets_targetscan_maxdelay) < time)
             do_target_scan = 1;
 
         // Old target (if any) invalid?
@@ -729,7 +729,7 @@ void turret_think()
         }
 
         // But never more often then g_turrets_targetscan_mindelay!
-        if (self.target_select_time + cvar("g_turrets_targetscan_mindelay") > time)
+        if (self.target_select_time + autocvar_g_turrets_targetscan_mindelay > time)
             do_target_scan = 0;
 
         if(do_target_scan)
@@ -753,7 +753,7 @@ void turret_think()
             return;
         }
         else
-            self.lip = time + cvar("g_turrets_aimidle_delay"); // Keep track of the last time we had a target.
+            self.lip = time + autocvar_g_turrets_aimidle_delay; // Keep track of the last time we had a target.
 
         // Predict?
         if not(self.aim_flags & TFL_AIM_NO)
@@ -777,7 +777,7 @@ void turret_think()
 
 void turret_fire()
 {
-    if (cvar("g_turrets_nofire") != 0)
+    if (autocvar_g_turrets_nofire != 0)
         return;
 
     self.turret_firefunc();
@@ -836,7 +836,7 @@ void turrets_manager_think()
     self.nextthink = time + 1;
 
     entity e;
-    if (cvar("g_turrets_reloadcvars") == 1)
+    if (autocvar_g_turrets_reloadcvars == 1)
     {
         e = nextent(world);
         while (e)
@@ -864,7 +864,7 @@ float turret_stdproc_init (string cvar_base_name, float csqc_shared, string base
        entity e, ee;
 
     // Are turrets allowed?
-    if (cvar("g_turrets") == 0)
+    if (autocvar_g_turrets == 0)
         return 0;
 
 
@@ -913,7 +913,7 @@ float turret_stdproc_init (string cvar_base_name, float csqc_shared, string base
     load_unit_settings(self,self.cvar_basename, 0);
 
     // Handle turret teams.
-    if (cvar("g_assault") != 0)
+    if (autocvar_g_assault != 0)
     {
         if not (self.team)
             self.team = 14; // Assume turrets are on the defending side if not explicitly set otehrwize
index fa150df0a84e7254350a891c9a49e109a96a8bfe..02c0ffa6016291288e71014f89b9dd53574f9c57 100644 (file)
@@ -11,10 +11,10 @@ float ewheel_speed_stop;
 
 void turret_ewheel_loadcvars()
 {
-    ewheel_speed_fast   = cvar("g_turrets_unit_ewheel_speed_fast");
-    ewheel_speed_slow   = cvar("g_turrets_unit_ewheel_speed_slow");
-    ewheel_speed_slower = cvar("g_turrets_unit_ewheel_speed_slower");
-    ewheel_speed_stop   = cvar("g_turrets_unit_ewheel_speed_stop");
+    ewheel_speed_fast   = autocvar_g_turrets_unit_ewheel_speed_fast;
+    ewheel_speed_slow   = autocvar_g_turrets_unit_ewheel_speed_slow;
+    ewheel_speed_slower = autocvar_g_turrets_unit_ewheel_speed_slower;
+    ewheel_speed_stop   = autocvar_g_turrets_unit_ewheel_speed_stop;
 }
 
 void turret_ewheel_projectile_explode()
@@ -311,7 +311,7 @@ void turret_ewheel_dinit()
     self.tur_head.frame = 1;
 
     // Convert from dgr / sec to dgr / tic
-    self.tur_head.aim_speed = cvar("g_turrets_unit_ewheel_turnrate");
+    self.tur_head.aim_speed = autocvar_g_turrets_unit_ewheel_turnrate;
     self.tur_head.aim_speed = self.tur_head.aim_speed / (1 / self.ticrate);
 
     if (!turret_tag_fire_update())
index b6408ed4f32b1f3aa936caad9234a1452fc4930e..1e2890f6ea6c9bce6d1653bd1b5989d9c4b5c8b4 100644 (file)
@@ -10,10 +10,10 @@ void turret_hellion_missile_damage (entity inflictor, entity attacker, float dam
 
 void turret_hellion_postthink()
 {
-    if (cvar("g_turrets_reloadcvars"))
+    if (autocvar_g_turrets_reloadcvars)
     {
-        if (!self.shot_speed_max)  self.shot_speed_max  = cvar("g_turrets_unit_hellion_std_shot_speed_max");
-        if (!self.shot_speed_gain) self.shot_speed_gain = cvar("g_turrets_unit_hellion_std_shot_speed_gain");
+        if (!self.shot_speed_max)  self.shot_speed_max  = autocvar_g_turrets_unit_hellion_std_shot_speed_max;
+        if (!self.shot_speed_gain) self.shot_speed_gain = autocvar_g_turrets_unit_hellion_std_shot_speed_gain;
     }
 
     if (self.tur_head.frame != 0)
@@ -177,10 +177,10 @@ void turret_hellion_dinit()
     if (self.netname == "")      self.netname  = "Hellion Missile Turret";
 
     if not (self.shot_speed_max)
-        self.shot_speed_max  = cvar("g_turrets_unit_hellion_std_shot_speed_max");
+        self.shot_speed_max  = autocvar_g_turrets_unit_hellion_std_shot_speed_max;
 
     if not (self.shot_speed_gain)
-        self.shot_speed_gain = cvar("g_turrets_unit_hellion_std_shot_speed_gain");
+        self.shot_speed_gain = autocvar_g_turrets_unit_hellion_std_shot_speed_gain;
 
     self.turrcaps_flags = TFL_TURRCAPS_RADIUSDMG | TFL_TURRCAPS_FASTPROJ | TFL_TURRCAPS_PLAYERKILL | TFL_TURRCAPS_MISSILEKILL;
     self.aim_flags = TFL_AIM_SIMPLE;
index cea4c13bd822bef60c2c2dc6f4109f1d84c95146..2b8e0f6a38089da861aa43ef9c2f1524a0163cd4 100644 (file)
@@ -111,7 +111,7 @@ void turret_hk_attack()
     missile.enemy            = self.enemy;
     missile.team             = self.team;
     missile.cnt              = time + 30;
-    missile.ticrate          = max(cvar("sys_ticrate"),0.05);
+    missile.ticrate          = max(autocvar_sys_ticrate,0.05);
 
        CSQCProjectile(missile, FALSE, PROJECTILE_ROCKET, FALSE); // no culling, fly sound
 
@@ -289,7 +289,7 @@ void turret_hk_missile_think()
 
     // Calculate new heading
     olddir = normalize(self.velocity);
-    newdir = normalize(olddir + wishdir * cvar("g_turrets_unit_hk_std_shot_speed_turnrate"));
+    newdir = normalize(olddir + wishdir * autocvar_g_turrets_unit_hk_std_shot_speed_turnrate);
 
     // Set heading & speed
     self.velocity = newdir * myspeed;
@@ -367,13 +367,13 @@ void turret_hk_missile_explode()
 
 void turret_hk_postthink()
 {
-    if (cvar("g_turrets_reloadcvars"))
+    if (autocvar_g_turrets_reloadcvars)
     {
-        hk_maxspeed = cvar("g_turrets_unit_hk_std_shot_speed_max");
-        hk_minspeed = cvar("g_turrets_unit_hk_std_shot_speed");
-        hk_accel    = cvar("g_turrets_unit_hk_std_shot_speed_accel");
-        hk_accel2   = cvar("g_turrets_unit_hk_std_shot_speed_accel2");
-        hk_decel    = cvar("g_turrets_unit_hk_std_shot_speed_decel");
+        hk_maxspeed = autocvar_g_turrets_unit_hk_std_shot_speed_max;
+        hk_minspeed = autocvar_g_turrets_unit_hk_std_shot_speed;
+        hk_accel    = autocvar_g_turrets_unit_hk_std_shot_speed_accel;
+        hk_accel2   = autocvar_g_turrets_unit_hk_std_shot_speed_accel2;
+        hk_decel    = autocvar_g_turrets_unit_hk_std_shot_speed_decel;
     }
 
     if (self.tur_head.frame != 0)
@@ -388,11 +388,11 @@ void turret_hk_dinit()
 {
     if (self.netname == "")      self.netname  = "Hunter-killer turret";
 
-    hk_maxspeed = cvar("g_turrets_unit_hk_std_shot_speed_max");
-    hk_minspeed = cvar("g_turrets_unit_hk_std_shot_speed");
-    hk_accel    = cvar("g_turrets_unit_hk_std_shot_speed_accel");
-    hk_accel2   = cvar("g_turrets_unit_hk_std_shot_speed_accel2");
-    hk_decel    = cvar("g_turrets_unit_hk_std_shot_speed_decel");
+    hk_maxspeed = autocvar_g_turrets_unit_hk_std_shot_speed_max;
+    hk_minspeed = autocvar_g_turrets_unit_hk_std_shot_speed;
+    hk_accel    = autocvar_g_turrets_unit_hk_std_shot_speed_accel;
+    hk_accel2   = autocvar_g_turrets_unit_hk_std_shot_speed_accel2;
+    hk_decel    = autocvar_g_turrets_unit_hk_std_shot_speed_decel;
 
     self.turrcaps_flags = TFL_TURRCAPS_RADIUSDMG | TFL_TURRCAPS_MEDPROJ | TFL_TURRCAPS_PLAYERKILL | TFL_TURRCAPS_RECIVETARGETS;
 
index c9a37416b6cdd581edff7b5eb317f734368aaec5..f6426fce25efdab96a268ee0f6b1a513db1bd7ae 100644 (file)
@@ -6,7 +6,7 @@ void turret_machinegun_attack();
 void turret_machinegun_attack()
 {
     sound (self, CHAN_WEAPON, "weapons/uzi_fire.wav", VOL_BASE, ATTN_NORM);
-    fireBallisticBullet (self.tur_shotorg, self.tur_shotdir_updated,self.shot_spread, self.shot_speed, 5, self.shot_dmg, 0, self.shot_force, DEATH_TURRET, 0, 1, cvar("g_balance_uzi_bulletconstant"));
+    fireBallisticBullet (self.tur_shotorg, self.tur_shotdir_updated,self.shot_spread, self.shot_speed, 5, self.shot_dmg, 0, self.shot_force, DEATH_TURRET, 0, 1, autocvar_g_balance_uzi_bulletconstant);
     endFireBallisticBullet();
 
     //w_deathtypestring = "had an alergic reaction due to 10 kilos of led";
@@ -25,7 +25,7 @@ void turret_machinegun_std_init()
     self.turrcaps_flags = TFL_TURRCAPS_PLAYERKILL;
     self.aim_flags = TFL_AIM_LEAD | TFL_AIM_SHOTTIMECOMPENSATE;
     
-       if not (cvar("g_antilag_bullets"))
+       if not (autocvar_g_antilag_bullets)
                self.turrcaps_flags |= TFL_TURRCAPS_HITSCAN;
 
     if (turret_stdproc_init("machinegun_std",0,"models/turrets/base.md3","models/turrets/machinegun.md3") == 0)
index e454dadfb533b17410e5f83a4fa09ab0ea262764..9c5ca071d8d5ce8489f233986ba62fe6577a2684 100644 (file)
@@ -79,7 +79,7 @@ void turret_phaser_attack()
     entity beam;
 
     beam = spawn();
-    beam.ticrate = 0.1; //cvar("sys_ticrate");
+    beam.ticrate = 0.1; //autocvar_sys_ticrate;
     setmodel(beam,"models/turrets/phaser_beam.md3");
     beam.effects = EF_LOWPRECISION;
     beam.solid = SOLID_NOT;
@@ -98,7 +98,7 @@ void turret_phaser_attack()
     self.fireflag = 1;
 
     beam.attack_finished_single = self.attack_finished_single;
-    self.attack_finished_single = time; // + cvar("sys_ticrate");
+    self.attack_finished_single = time; // + autocvar_sys_ticrate;
 
     setattachment(beam,self.tur_head,"tag_fire");
 
index 9d786f407947244b0f9e66ea2bd889756ae1c709..0f2de3c869ab1a96fe43328c54f7f4627d018248 100644 (file)
@@ -30,7 +30,7 @@ void turret_targettrigger_touch()
 */
 void spawnfunc_turret_targettrigger()
 {
-    if (!cvar("g_turrets"))
+    if (!autocvar_g_turrets)
     {
         remove(self);
         return;
index 3952dc16a407cf02f98270e732194c0d4317245d..5d37db4929d115b40b30d0b634162066e0d005b4 100644 (file)
@@ -37,21 +37,21 @@ float walker_std_rocket_turnrate;
 
 void walker_loadcvars()
 {
-    walker_meele_dmg    = cvar("g_turrets_unit_walker_std_meele_dmg");
-    walker_meele_force  = cvar("g_turrets_unit_walker_std_meele_force");
-
-    walker_speed_stop   = cvar("g_turrets_unit_walker_speed_stop");
-    walker_speed_walk   = cvar("g_turrets_unit_walker_speed_walk");
-    walker_speed_run    = cvar("g_turrets_unit_walker_speed_run");
-    walker_speed_jump   = cvar("g_turrets_unit_walker_speed_jump");
-    walker_speed_roam   = cvar("g_turrets_unit_walker_speed_roam");
-    walker_speed_swim   = cvar("g_turrets_unit_walker_speed_swim");
-
-    walker_std_rocket_dmg       = cvar("g_turrets_unit_walker_std_rocket_dmg");
-    walker_std_rocket_radius    = cvar("g_turrets_unit_walker_std_rocket_radius");
-    walker_std_rocket_force     = cvar("g_turrets_unit_walker_std_rocket_force");
-    walker_std_rocket_speed     = cvar("g_turrets_unit_walker_std_rocket_speed");
-    walker_std_rocket_turnrate  = cvar("g_turrets_unit_walker_std_rocket_turnrate");
+    walker_meele_dmg    = autocvar_g_turrets_unit_walker_std_meele_dmg;
+    walker_meele_force  = autocvar_g_turrets_unit_walker_std_meele_force;
+
+    walker_speed_stop   = autocvar_g_turrets_unit_walker_speed_stop;
+    walker_speed_walk   = autocvar_g_turrets_unit_walker_speed_walk;
+    walker_speed_run    = autocvar_g_turrets_unit_walker_speed_run;
+    walker_speed_jump   = autocvar_g_turrets_unit_walker_speed_jump;
+    walker_speed_roam   = autocvar_g_turrets_unit_walker_speed_roam;
+    walker_speed_swim   = autocvar_g_turrets_unit_walker_speed_swim;
+
+    walker_std_rocket_dmg       = autocvar_g_turrets_unit_walker_std_rocket_dmg;
+    walker_std_rocket_radius    = autocvar_g_turrets_unit_walker_std_rocket_radius;
+    walker_std_rocket_force     = autocvar_g_turrets_unit_walker_std_rocket_force;
+    walker_std_rocket_speed     = autocvar_g_turrets_unit_walker_std_rocket_speed;
+    walker_std_rocket_turnrate  = autocvar_g_turrets_unit_walker_std_rocket_turnrate;
 
 }
 
@@ -546,7 +546,7 @@ float walker_attack_meele()
 
     wish_angle = angleofs(self,self.enemy);
 
-    if (self.tur_dist_enemy > cvar("g_turrets_unit_walker_std_meele_range"))
+    if (self.tur_dist_enemy > autocvar_g_turrets_unit_walker_std_meele_range)
         return 0;
     else
         if (fabs(wish_angle_y) > 15)
@@ -564,10 +564,10 @@ float walker_attack_rockets()
     if (self.tur_head.attack_finished_single > time)
         return 0;
 
-    if (self.tur_dist_enemy < cvar("g_turrets_unit_walker_std_rockets_range_min"))
+    if (self.tur_dist_enemy < autocvar_g_turrets_unit_walker_std_rockets_range_min)
         return 0;
 
-    if (self.tur_dist_enemy > cvar("g_turrets_unit_walker_std_rockets_range"))
+    if (self.tur_dist_enemy > autocvar_g_turrets_unit_walker_std_rockets_range)
         return 0;
 
     entity rv;
@@ -578,7 +578,7 @@ float walker_attack_rockets()
     rv.cnt       = 4;
     rv.owner     = self;
 
-    self.tur_head.attack_finished_single = time + cvar("g_turrets_unit_walker_std_rocket_refire");
+    self.tur_head.attack_finished_single = time + autocvar_g_turrets_unit_walker_std_rocket_refire;
 
     return 1;
 }
@@ -616,7 +616,7 @@ void walker_postthink()
 void walker_attack()
 {
     sound (self, CHAN_WEAPON, "weapons/uzi_fire.wav", VOL_BASE, ATTN_NORM);
-    fireBallisticBullet (self.tur_shotorg, self.tur_shotdir_updated,self.shot_spread, self.shot_speed, 5, self.shot_dmg, 0, self.shot_force, DEATH_TURRET, 0, 1, cvar("g_balance_uzi_bulletconstant"));
+    fireBallisticBullet (self.tur_shotorg, self.tur_shotdir_updated,self.shot_spread, self.shot_speed, 5, self.shot_dmg, 0, self.shot_force, DEATH_TURRET, 0, 1, autocvar_g_balance_uzi_bulletconstant);
     endFireBallisticBullet();
     if (self.uzi_bulletcounter == 2)
     {
@@ -694,7 +694,7 @@ void turret_walker_dinit()
     self.turrcaps_flags = TFL_TURRCAPS_PLAYERKILL | TFL_TURRCAPS_MOVE ;
     self.aim_flags = TFL_AIM_LEAD;
 
-    if (cvar("g_antilag_bullets"))
+    if (autocvar_g_antilag_bullets)
         self.turrcaps_flags |= TFL_TURRCAPS_HITSCAN;
     else
         self.aim_flags      |= TFL_AIM_SHOTTIMECOMPENSATE;
index e2a61336027fc151d962ff309ecc531a1298372c..09efab4bfc629ef2d81d50b387f636c168f28f47 100644 (file)
@@ -31,23 +31,23 @@ float  jetfromtag_groundcontact;
 
 void racer_loadsettings()
 {
-    racer_power_min         = cvar("g_vehicle_racer_power_min")   * 0.25;
-    racer_power_air         = cvar("g_vehicle_racer_power_air")   * 0.25;
-    racer_power_solid       = cvar("g_vehicle_racer_power_solid") * 0.25;
+    racer_power_min         = autocvar_g_vehicle_racer_power_min   * 0.25;
+    racer_power_air         = autocvar_g_vehicle_racer_power_air   * 0.25;
+    racer_power_solid       = autocvar_g_vehicle_racer_power_solid * 0.25;
 
-    racer_springlength      = cvar("g_vehicle_racer_springlength");
-    racer_anglestabilizer   = cvar("g_vehicle_racer_anglestabilizer");
-    racer_pitchspeed        = cvar("g_vehicle_racer_pitchspeed");
-    racer_turnspeed         = cvar("g_vehicle_racer_turnspeed");
-    racer_turnroll          = cvar("g_vehicle_racer_turnroll");
-    racer_speed_forward     = cvar("g_vehicle_racer_speed_forward");
-    racer_speed_strafe      = cvar("g_vehicle_racer_speed_strafe");
+    racer_springlength      = autocvar_g_vehicle_racer_springlength;
+    racer_anglestabilizer   = autocvar_g_vehicle_racer_anglestabilizer;
+    racer_pitchspeed        = autocvar_g_vehicle_racer_pitchspeed;
+    racer_turnspeed         = autocvar_g_vehicle_racer_turnspeed;
+    racer_turnroll          = autocvar_g_vehicle_racer_turnroll;
+    racer_speed_forward     = autocvar_g_vehicle_racer_speed_forward;
+    racer_speed_strafe      = autocvar_g_vehicle_racer_speed_strafe;
 
-    racer_afterburn_cost    = cvar("g_vehicle_racer_afterburn_cost");
+    racer_afterburn_cost    = autocvar_g_vehicle_racer_afterburn_cost;
 
-    racer_healthmax = cvar("g_vehicle_racer_health");
-    racer_shieldmax = cvar("g_vehicle_racer_shield");
-    racer_energymax = cvar("g_vehicle_racer_energy");
+    racer_healthmax = autocvar_g_vehicle_racer_health;
+    racer_shieldmax = autocvar_g_vehicle_racer_shield;
+    racer_energymax = autocvar_g_vehicle_racer_energy;
 
 }
 
@@ -147,7 +147,7 @@ void racer_bolt_explode()
 
     org2 = findbetterlocation (self.origin, 8);
     pointparticles(particleeffectnum("laser_impact"), org2, trace_plane_normal * 1000, 1);
-    RadiusDamage (self, self.realowner, cvar("g_vehicle_racer_laser_damage"), 0, cvar("g_vehicle_racer_laser_radius"), world, 150, DEATH_WAKIGUN, world);
+    RadiusDamage (self, self.realowner, autocvar_g_vehicle_racer_laser_damage, 0, autocvar_g_vehicle_racer_laser_radius, world, 150, DEATH_WAKIGUN, world);
     sound (self, CHAN_PROJECTILE, "weapons/electro_impact.wav", VOL_BASE, ATTN_NORM);
 
     remove (self);
@@ -163,7 +163,7 @@ void racer_rocket_explode()
     sound (self, CHAN_PROJECTILE, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
     org2 = findbetterlocation (self.origin, 16);
     pointparticles(particleeffectnum("rocket_explode"), org2, '0 0 0', 1);
-    RadiusDamage (self, self.realowner ,cvar("g_vehicle_racer_rocket_damage"), 0, cvar("g_vehicle_racer_rocket_radius"), world, 150, DEATH_WAKIROCKET, world);
+    RadiusDamage (self, self.realowner ,autocvar_g_vehicle_racer_rocket_damage, 0, autocvar_g_vehicle_racer_rocket_radius, world, 150, DEATH_WAKIROCKET, world);
 
     remove (self);
 }
@@ -200,7 +200,7 @@ void racer_fire_cannon(string tagname)
     bolt.think           = racer_bolt_explode;
     bolt.nextthink       = time + 9;
     bolt.bot_dodge       = TRUE;
-    bolt.bot_dodgerating = cvar("g_vehicle_racer_laser_damage");
+    bolt.bot_dodgerating = autocvar_g_vehicle_racer_laser_damage;
     setorigin(bolt, gettaginfo(self,gettagindex(self,tagname)));
 
     vector v;
@@ -208,7 +208,7 @@ void racer_fire_cannon(string tagname)
     v = normalize(self.owner.cursor_trace_endpos - bolt.origin);
     v_forward_z = v_z * 0.5;
 
-    bolt.velocity = v_forward * cvar("g_vehicle_racer_laser_speed");
+    bolt.velocity = v_forward * autocvar_g_vehicle_racer_laser_speed;
 
     CSQCProjectile(bolt, TRUE, PROJECTILE_LASER, TRUE);
 }
@@ -300,8 +300,8 @@ void racer_fire_rocket(string tagname)
 
     rocket = spawn();
     setsize (rocket, '-1 -1 -1', '1 1 1');
-    rocket.lip             = cvar("g_vehicle_racer_rocket_accel") * sys_frametime;
-    rocket.wait            = cvar("g_vehicle_racer_rocket_turnrate");
+    rocket.lip             = autocvar_g_vehicle_racer_rocket_accel * sys_frametime;
+    rocket.wait            = autocvar_g_vehicle_racer_rocket_turnrate;
     rocket.solid           = SOLID_BBOX;
     rocket.movetype        = MOVETYPE_FLYMISSILE;
     rocket.flags           = FL_PROJECTILE;
@@ -309,7 +309,7 @@ void racer_fire_rocket(string tagname)
     rocket.realowner       = self.owner;
     rocket.touch           = racer_rocket_touch;
     rocket.bot_dodge       = TRUE;
-    rocket.bot_dodgerating = cvar("g_vehicle_racer_rocket_damage");
+    rocket.bot_dodgerating = autocvar_g_vehicle_racer_rocket_damage;
     setorigin(rocket, gettaginfo(self,gettagindex(self,tagname)));
 
     /*
@@ -320,7 +320,7 @@ void racer_fire_rocket(string tagname)
     {
         rocket.delay           = vlen(rocket.enemy.origin  - rocket.origin);
         rocket.cnt             = time + 9;
-        rocket.velocity = v_forward * cvar("g_vehicle_racer_rocket_speed");
+        rocket.velocity = v_forward * autocvar_g_vehicle_racer_rocket_speed;
         rocket.think = racer_rocket_think;
         rocket.nextthink = time;
         CSQCProjectile(rocket, FALSE, PROJECTILE_ROCKET, FALSE); // no culling, has fly sound
@@ -329,7 +329,7 @@ void racer_fire_rocket(string tagname)
     {
     */
         rocket.cnt             = time + 9;
-        rocket.velocity = v_forward * cvar("g_vehicle_racer_rocket_speed");
+        rocket.velocity = v_forward * autocvar_g_vehicle_racer_rocket_speed;
         rocket.think = racer_rocket_groundhugger;
         rocket.nextthink = time;
         CSQCProjectile(rocket, TRUE, PROJECTILE_ROCKET, TRUE);
@@ -358,7 +358,7 @@ float racer_pplug()
     float ftmp, ftmp2;
     vector df;
 
-    if(cvar("g_vehicle_racer_reload"))
+    if(autocvar_g_vehicle_racer_reload)
     {
         racer_loadsettings();
         cvar_set("g_vehicle_racer_reload","0");
@@ -443,14 +443,14 @@ float racer_pplug()
     if (player.BUTTON_JUMP)
     if(racer.vehicle_energy >= (racer_afterburn_cost * frametime))
     {
-        racer.wait = time + cvar("g_vehicle_racer_energy_usepause");
+        racer.wait = time + autocvar_g_vehicle_racer_energy_usepause;
         racer.vehicle_energy -= racer_afterburn_cost * frametime;
-        df += (v_forward * cvar("g_vehicle_racer_speed_afterburn"));
+        df += (v_forward * autocvar_g_vehicle_racer_speed_afterburn);
     }
 
     racer.velocity  += df * frametime;
 
-    df = (vlen(racer.velocity) * cvar("g_vehicle_racer_downforce") * v_up) * frametime;
+    df = (vlen(racer.velocity) * autocvar_g_vehicle_racer_downforce * v_up) * frametime;
     racer.velocity  = racer.velocity - df;
     player.movement = racer.velocity;
 
@@ -466,10 +466,10 @@ float racer_pplug()
 
     if(player.BUTTON_ATCK)
     if(time > racer.attack_finished_single)
-    if(racer.vehicle_energy >= cvar("g_vehicle_racer_laser_cost"))
+    if(racer.vehicle_energy >= autocvar_g_vehicle_racer_laser_cost)
     {
-        racer.vehicle_energy -= cvar("g_vehicle_racer_laser_cost");
-        racer.wait = time + cvar("g_vehicle_racer_energy_usepause");
+        racer.vehicle_energy -= autocvar_g_vehicle_racer_laser_cost;
+        racer.wait = time + autocvar_g_vehicle_racer_energy_usepause;
 
         if(racer.cnt)
         {
@@ -481,7 +481,7 @@ float racer_pplug()
             racer_fire_cannon("tag_fire2");
             racer.cnt = 1;
         }
-        racer.attack_finished_single = time + cvar("g_vehicle_racer_laser_refire");
+        racer.attack_finished_single = time + autocvar_g_vehicle_racer_laser_refire;
     }
 
     if(player.BUTTON_ATCK2)
@@ -489,7 +489,7 @@ float racer_pplug()
     {
         racer_fire_rocket("tag_rocket_r");
         racer_fire_rocket("tag_rocket_l");
-        racer.delay = time + cvar("g_vehicle_racer_rocket_refire");
+        racer.delay = time + autocvar_g_vehicle_racer_rocket_refire;
         racer.lip = time;
 
     }
@@ -596,8 +596,8 @@ void racer_enter()
     self.owner.effects        |= EF_NODRAW;
     self.owner.view_ofs = '0 0 0';
 
-    self.owner.vehicle_health = (self.vehicle_health / cvar("g_vehicle_racer_health"));
-    self.owner.vehicle_shield = (self.vehicle_shield / cvar("g_vehicle_racer_shield"));
+    self.owner.vehicle_health = (self.vehicle_health / autocvar_g_vehicle_racer_health);
+    self.owner.vehicle_shield = (self.vehicle_shield / autocvar_g_vehicle_racer_shield);
 
     setorigin(other,self.origin + '0 0 32');
     other.velocity = self.velocity;
@@ -681,7 +681,7 @@ void racer_exit(float eject)
         ret = spawn();
         ret.enemy = self;
         ret.think = racer_return;
-        ret.nextthink = time + cvar("g_vehicle_racer_respawntime");
+        ret.nextthink = time + autocvar_g_vehicle_racer_respawntime;
     }
 }
 
@@ -762,7 +762,7 @@ void racer_blowup()
     RadiusDamage (self, self, 250, 15, 250, world, 250, DEATH_WAKIBLOWUP, world);
 
     self.alpha = -1;
-    self.nextthink  = time + cvar("g_vehicle_racer_respawntime");
+    self.nextthink  = time + autocvar_g_vehicle_racer_respawntime;
     self.think      = racer_spawn;
     self.movetype   = MOVETYPE_NONE;
     self.effects    = EF_NODRAW;
index 424093b93ba68419c96795ac1407a01b5abd6121..38ebad04275078262cfc5d9bbdf3c6613ad50557 100644 (file)
@@ -409,7 +409,7 @@ void raptor_exit(float eject)
         ret = spawn();
         ret.enemy = self;
         ret.think = raptor_return;
-        ret.nextthink = time + cvar("g_vehicle_racer_respawntime");
+        ret.nextthink = time + autocvar_g_vehicle_racer_respawntime;
     }
 }
 
@@ -421,7 +421,7 @@ float raptor_pplug()
     vector df;
 
 
-    if(cvar("g_vehicle_raptor_reload"))
+    if(autocvar_g_vehicle_raptor_reload)
     {
         raptor_loadsettings();
         cvar_set("g_vehicle_raptor_reload","0");
index 5bbc67c564fee9909c2bfb9144cab9e8250b8042..fa0781fa786519e736ef39d86fa7a9da1d7d7730 100644 (file)
@@ -27,10 +27,10 @@ void spiderbot_rocket_explode()
         self.owner = self.realowner;
 
     RadiusDamage (self, self.owner,
-        cvar("g_vehicle_spiderbot_rocket_damage"),
-        cvar("g_vehicle_spiderbot_rocket_edgedamage"),
-        cvar("g_vehicle_spiderbot_rocket_radius"), world,
-        cvar("g_vehicle_spiderbot_rocket_force"), DEATH_SBROCKET, world);
+        autocvar_g_vehicle_spiderbot_rocket_damage,
+        autocvar_g_vehicle_spiderbot_rocket_edgedamage,
+        autocvar_g_vehicle_spiderbot_rocket_radius, world,
+        autocvar_g_vehicle_spiderbot_rocket_force, DEATH_SBROCKET, world);
 
     remove (self);
 }
@@ -58,8 +58,8 @@ void spiderbot_rocket_unguided()
 
 
     olddir = normalize(self.velocity);
-    newdir = normalize(self.pos1 - self.origin) + randomvec() * cvar("g_vehicle_spiderbot_rocket_noise");
-    self.velocity = normalize(olddir + newdir * cvar("g_vehicle_spiderbot_rocket_turnrate")) * cvar("g_vehicle_spiderbot_rocket_speed");
+    newdir = normalize(self.pos1 - self.origin) + randomvec() * autocvar_g_vehicle_spiderbot_rocket_noise;
+    self.velocity = normalize(olddir + newdir * autocvar_g_vehicle_spiderbot_rocket_turnrate) * autocvar_g_vehicle_spiderbot_rocket_speed;
 
     UpdateCSQCProjectile(self);
 
@@ -79,8 +79,8 @@ void spiderbot_rocket_guided()
 
     crosshair_trace(self.owner);
     olddir = normalize(self.velocity);
-    newdir = normalize(trace_endpos - self.origin) + randomvec() * cvar("g_vehicle_spiderbot_rocket_noise");
-    self.velocity = normalize(olddir + newdir * cvar("g_vehicle_spiderbot_rocket_turnrate")) * cvar("g_vehicle_spiderbot_rocket_speed");
+    newdir = normalize(trace_endpos - self.origin) + randomvec() * autocvar_g_vehicle_spiderbot_rocket_noise;
+    self.velocity = normalize(olddir + newdir * autocvar_g_vehicle_spiderbot_rocket_turnrate) * autocvar_g_vehicle_spiderbot_rocket_speed;
 
     UpdateCSQCProjectile(self);
 
@@ -161,15 +161,15 @@ void spiderbot_rocket_do()
 
     rocket.classname       = "spiderbot_rocket";
     rocket.bot_dodge       = TRUE;
-    rocket.bot_dodgerating = cvar("g_vehicle_spiderbot_rocket_damage");
-    rocket.cnt             = time + cvar("g_vehicle_spiderbot_rocket_lifetime");
-    rocket.health          = cvar("g_vehicle_spiderbot_rocket_health");
+    rocket.bot_dodgerating = autocvar_g_vehicle_spiderbot_rocket_damage;
+    rocket.cnt             = time + autocvar_g_vehicle_spiderbot_rocket_lifetime;
+    rocket.health          = autocvar_g_vehicle_spiderbot_rocket_health;
     rocket.takedamage      = DAMAGE_AIM;
     rocket.event_damage    = spiderbot_rocket_damage;
     rocket.owner           = self.owner;
     rocket.nextthink       = time;
     rocket.movetype        = MOVETYPE_FLYMISSILE;
-    rocket.velocity        = normalize(v_forward + (v_up * 0.5) + randomvec() * 0.25) * cvar("g_vehicle_spiderbot_rocket_speed");
+    rocket.velocity        = normalize(v_forward + (v_up * 0.5) + randomvec() * 0.25) * autocvar_g_vehicle_spiderbot_rocket_speed;
     rocket.angles          = vectoangles(rocket.velocity);
     rocket.think           = spiderbot_rocket_guided;
     rocket.touch           = spiderbot_rocket_touch;
@@ -181,9 +181,9 @@ void spiderbot_rocket_do()
 
     self.tur_head.frame += 1;
     if (self.tur_head.frame == 9)
-        self.attack_finished_single = cvar("g_vehicle_spiderbot_rocket_reload");
+        self.attack_finished_single = autocvar_g_vehicle_spiderbot_rocket_reload;
     else
-        self.attack_finished_single = cvar("g_vehicle_spiderbot_rocket_refire");
+        self.attack_finished_single = autocvar_g_vehicle_spiderbot_rocket_refire;
 
     self.gun2.cnt = time + self.attack_finished_single;
 }
@@ -213,8 +213,8 @@ void spiderbot_minigun_fire(entity gun, float trail)
 
     sound (gun, CHAN_WEAPON, "weapons/uzi_fire.wav", VOL_BASE, ATTN_NORM);
 
-    fireBullet (v, v_forward, cvar("g_vehicle_spiderbot_minigun_spread"), cvar("g_vehicle_spiderbot_minigun_damage"),
-        cvar("g_vehicle_spiderbot_minigun_spread"), DEATH_SBMINIGUN, 0);
+    fireBullet (v, v_forward, autocvar_g_vehicle_spiderbot_minigun_spread, autocvar_g_vehicle_spiderbot_minigun_damage,
+        autocvar_g_vehicle_spiderbot_minigun_spread, DEATH_SBMINIGUN, 0);
 
 
        UziFlash();
@@ -231,7 +231,7 @@ void spiderbot_miniguns_do()
     if((self.vehicle_reload1 == 1) || (!self.owner.BUTTON_ATCK))
     {
 
-        ftmp = 1 / cvar("g_vehicle_spiderbot_minigun_cooldown") * sys_frametime;
+        ftmp = 1 / autocvar_g_vehicle_spiderbot_minigun_cooldown * sys_frametime;
         self.owner.vehicle_reload1 = max(self.owner.vehicle_reload1 - ftmp, 0);
         if(self.owner.vehicle_reload1 <= 0)
             self.vehicle_reload1 = 0;
@@ -270,17 +270,17 @@ void spiderbot_miniguns_do()
 
             self = self.vehicle;
 
-            ftmp = cvar("g_vehicle_spiderbot_minigun_refire") / cvar("g_vehicle_spiderbot_minigun_heat");
+            ftmp = autocvar_g_vehicle_spiderbot_minigun_refire / autocvar_g_vehicle_spiderbot_minigun_heat;
             self.owner.vehicle_reload1 +=  ftmp;
 
             if(self.owner.vehicle_reload1 >= 1)
             {
                 self.vehicle_reload1 = 1;
                 self.owner.vehicle_reload1 = 1;
-                self.tur_head.attack_finished_single = cvar("g_vehicle_spiderbot_minigun_cooldown") + time;
+                self.tur_head.attack_finished_single = autocvar_g_vehicle_spiderbot_minigun_cooldown + time;
             }
             else
-                self.tur_head.attack_finished_single = cvar("g_vehicle_spiderbot_minigun_refire") + time;
+                self.tur_head.attack_finished_single = autocvar_g_vehicle_spiderbot_minigun_refire + time;
         }
 
         self = self.owner;
@@ -323,17 +323,17 @@ float spiderbot_pplug()
     if(ad_y < -180) ad_y += 360;
 
     // Rotate head
-    ftmp = cvar("g_vehicle_spiderbot_head_turnspeed") * sys_frametime;
+    ftmp = autocvar_g_vehicle_spiderbot_head_turnspeed * sys_frametime;
     ad_y = bound(-ftmp, ad_y, ftmp);
-    spider.tur_head.angles_y = bound(cvar("g_vehicle_spiderbot_head_turnlimit") * -1, spider.tur_head.angles_y + ad_y, cvar("g_vehicle_spiderbot_head_turnlimit"));
+    spider.tur_head.angles_y = bound(autocvar_g_vehicle_spiderbot_head_turnlimit * -1, spider.tur_head.angles_y + ad_y, autocvar_g_vehicle_spiderbot_head_turnlimit);
 
     // Pitch head
-    ftmp = cvar("g_vehicle_spiderbot_head_pitchspeed") * sys_frametime;
+    ftmp = autocvar_g_vehicle_spiderbot_head_pitchspeed * sys_frametime;
     ad_x = bound(-ftmp, ad_x, ftmp);
-    spider.tur_head.angles_x = bound(cvar("g_vehicle_spiderbot_head_pitchlimit_down"), spider.tur_head.angles_x + ad_x, cvar("g_vehicle_spiderbot_head_pitchlimit_up"));
+    spider.tur_head.angles_x = bound(autocvar_g_vehicle_spiderbot_head_pitchlimit_down, spider.tur_head.angles_x + ad_x, autocvar_g_vehicle_spiderbot_head_pitchlimit_up);
 
     // Turn Body
-    ftmp = cvar("g_vehicle_spiderbot_turnspeed") * sys_frametime;
+    ftmp = autocvar_g_vehicle_spiderbot_turnspeed * sys_frametime;
     ftmp = bound(-ftmp, spider.tur_head.angles_y, ftmp);
 
     self = spider;
@@ -350,7 +350,7 @@ float spiderbot_pplug()
         {
             if(vlen(player.movement) == 0)
             {
-                movelib_beak_simple(cvar("g_vehicle_spiderbot_speed_stop"));
+                movelib_beak_simple(autocvar_g_vehicle_spiderbot_speed_stop);
                 spider.frame = 5;
             }
             else
@@ -371,7 +371,7 @@ float spiderbot_pplug()
                         spider.frame = 1;
                     }
                     player.movement_y = 0;
-                    movelib_move_simple(normalize(v_forward * player.movement_x),cvar("g_vehicle_spiderbot_speed_walk"),cvar("g_vehicle_spiderbot_movement_inertia"));
+                    movelib_move_simple(normalize(v_forward * player.movement_x),autocvar_g_vehicle_spiderbot_speed_walk,autocvar_g_vehicle_spiderbot_movement_inertia);
                 }
                 else if(player.movement_y != 0)
                 {
@@ -385,7 +385,7 @@ float spiderbot_pplug()
                         player.movement_y = 1;
                         spider.frame = 3;
                     }
-                    movelib_move_simple(normalize(v_right * player.movement_y),cvar("g_vehicle_spiderbot_speed_strafe"),cvar("g_vehicle_spiderbot_movement_inertia"));
+                    movelib_move_simple(normalize(v_right * player.movement_y),autocvar_g_vehicle_spiderbot_speed_strafe,autocvar_g_vehicle_spiderbot_movement_inertia);
                 }
 
             }
@@ -417,7 +417,7 @@ float spiderbot_pplug()
 void spiderbot_think()
 {
     if(self.flags & FL_ONGROUND)
-        movelib_beak_simple(cvar("g_vehicle_spiderbot_speed_stop"));
+        movelib_beak_simple(autocvar_g_vehicle_spiderbot_speed_stop);
 
     self.nextthink = time;
 }
@@ -452,8 +452,8 @@ void spiderbot_enter()
     self.owner.vehicle        = self;
     self.owner.event_damage   = SUB_Null;
     self.owner.hud            = HUD_SPIDERBOT;
-    self.owner.vehicle_health = (self.vehicle_health / cvar("g_vehicle_spiderbot_health"));
-    self.owner.vehicle_shield = (self.vehicle_shield / cvar("g_vehicle_spiderbot_shield"));
+    self.owner.vehicle_health = (self.vehicle_health / autocvar_g_vehicle_spiderbot_health);
+    self.owner.vehicle_shield = (self.vehicle_shield / autocvar_g_vehicle_spiderbot_shield);
     self.owner.view_ofs       = '0 0 0';
     self.owner.vehicle_ammo1 = self.vehicle_ammo1;
     self.owner.vehicle_ammo2 = self.vehicle_ammo2;
@@ -586,7 +586,7 @@ void spiderbot_touch()
 
         //todo: add check for velocity/angle here (so we dont cush players runing into us from behind)
 
-        Damage(other,self,self.owner,cvar("g_vehicle_spiderbot_crush_dmg"),DEATH_SBCRUSH,'0 0 0', normalize(other.origin - self.origin) * cvar("g_vehicle_spiderbot_crush_force") );
+        Damage(other,self,self.owner,autocvar_g_vehicle_spiderbot_crush_dmg,DEATH_SBCRUSH,'0 0 0', normalize(other.origin - self.origin) * autocvar_g_vehicle_spiderbot_crush_force );
         return;
     }
 
@@ -662,7 +662,7 @@ void spiderbot_blowup()
     RadiusDamage (self, self, 250, 15, 250, world, 250, DEATH_SBBLOWUP, world);
 
     self.alpha = self.tur_head.alpha = self.gun1.alpha = self.gun2.alpha = -1;
-    self.nextthink  = time + cvar("g_vehicle_spiderbot_respawntime");
+    self.nextthink  = time + autocvar_g_vehicle_spiderbot_respawntime;
     self.think      = spiderbot_spawn;
     self.movetype   = MOVETYPE_NONE;
 
index adc037c833b60bf757dc76cbf179447e0aee3252..fbc8032bb1cd6fa3f846d9b37a7c5c84916cd719 100644 (file)
@@ -55,7 +55,7 @@ entity GetKickVoteVictim(string vote, string cmd, entity caller)
                GetKickVoteVictim_newcommand = strcat(argv(0), " # ", ftos(num_for_edict(e)));
                if(argv(0) == "kickban")
                {
-                       GetKickVoteVictim_newcommand = strcat(GetKickVoteVictim_newcommand, " ", ftos(cvar("g_ban_default_bantime")), " ", ftos(cvar("g_ban_default_masksize")), " ", reason);
+                       GetKickVoteVictim_newcommand = strcat(GetKickVoteVictim_newcommand, " ", ftos(autocvar_g_ban_default_bantime), " ", ftos(autocvar_g_ban_default_masksize), " ", reason);
                }
                else if(argv(0) == "kick")
                {
@@ -147,8 +147,8 @@ float GameCommand_Vote(string s, entity e) {
                                print_to(e, "^1No vote called.");
                        }
                } else if(argv(1) == "call") {
-                       if(!e || cvar("sv_vote_call")) {
-                               if(cvar("sv_vote_nospectators") && e && e.classname != "player") {
+                       if(!e || autocvar_sv_vote_call) {
+                               if(autocvar_sv_vote_nospectators && e && e.classname != "player") {
                                        print_to(e, "^1Error: Only players can call a vote."); // TODO invent a cvar name for allowing votes by spectators during warmup anyway
                                }
                                else if(timeoutStatus) { //don't allow a vote call during a timeout
@@ -171,14 +171,14 @@ float GameCommand_Vote(string s, entity e) {
                                                votecalledvote_display = strzone(RemapVote_display);
                                                votecalled = TRUE;
                                                votecalledmaster = FALSE;
-                                               votefinished = time + cvar("sv_vote_timeout");
+                                               votefinished = time + autocvar_sv_vote_timeout;
                                                votecaller = e; // remember who called the vote
                                                if(e) {
                                                        e.vote_vote = 1; // of course you vote yes
-                                                       e.vote_next = time + cvar("sv_vote_wait");
+                                                       e.vote_next = time + autocvar_sv_vote_wait;
                                                }
                                                bprint("\{1}^2* ^3", VoteNetname(votecaller), "^2 calls a vote for ", votecalledvote_display, "\n");
-                                               if(cvar("sv_eventlog"))
+                                               if(autocvar_sv_eventlog)
                                                        GameLogEcho(strcat(":vote:vcall:", ftos(votecaller.playerid), ":", votecalledvote_display));
                                                VoteCount(); // needed if you are the only one
                                                Nagger_VoteChanged();
@@ -215,7 +215,7 @@ float GameCommand_Vote(string s, entity e) {
                                print_to(e, "^1You are not allowed to stop that Vote.");
                        }
                } else if(argv(1) == "master") {
-                       if(cvar("sv_vote_master")) {
+                       if(autocvar_sv_vote_master) {
                                if(votecalled) {
                                        print_to(e, "^1There is already a vote called.");
                                } else {
@@ -223,14 +223,14 @@ float GameCommand_Vote(string s, entity e) {
                                        votecalledmaster = TRUE;
                                        votecalledvote = strzone("XXX");
                                        votecalledvote_display = strzone("^3master");
-                                       votefinished = time + cvar("sv_vote_timeout");
+                                       votefinished = time + autocvar_sv_vote_timeout;
                                        votecaller = e; // remember who called the vote
                                        if(e) {
                                                e.vote_vote = 1; // of course you vote yes
-                                               e.vote_next = time + cvar("sv_vote_wait");
+                                               e.vote_next = time + autocvar_sv_vote_wait;
                                        }
                                        bprint("\{1}^2* ^3", VoteNetname(votecaller), "^2 calls a vote to become ^3master^2.\n");
-                                       if(cvar("sv_eventlog"))
+                                       if(autocvar_sv_eventlog)
                                                GameLogEcho(strcat(":vote:vcall:", ftos(votecaller.playerid), ":", votecalledvote_display));
                                        VoteCount(); // needed if you are the only one
                                        Nagger_VoteChanged();
@@ -248,7 +248,7 @@ float GameCommand_Vote(string s, entity e) {
                                        print_to(e, "Syntax error in command. See 'vhelp' for more info.");
                                } else if(RemapVote(dovote, "vdo", e)) { // strcat seems to be necessary
                                        bprint("\{1}^2* ^3", VoteNetname(e), "^2 used their ^3master^2 status to do \"^2", RemapVote_display, "^2\".\n");
-                                       if(cvar("sv_eventlog"))
+                                       if(autocvar_sv_eventlog)
                                                GameLogEcho(strcat(":vote:vdo:", ftos(e.playerid), ":", RemapVote_display));
                                        localcmd(strcat(RemapVote_vote, "\n"));
                                } else {
@@ -259,7 +259,7 @@ float GameCommand_Vote(string s, entity e) {
                        }
                } else if(argv(1) == "login") {
                        local string masterpwd;
-                       masterpwd = cvar_string("sv_vote_master_password");
+                       masterpwd = autocvar_sv_vote_master_password;
                        if(masterpwd != "") {
                                local float granted;
                                granted = (masterpwd == argv(2));
@@ -268,7 +268,7 @@ float GameCommand_Vote(string s, entity e) {
                                if(granted) {
                                        print("Accepted master login from ", VoteNetname(e), "\n");
                                        bprint("\{1}^2* ^3", VoteNetname(e), "^2 logged in as ^3master^2\n");
-                                       if(cvar("sv_eventlog"))
+                                       if(autocvar_sv_eventlog)
                                                GameLogEcho(strcat(":vote:vlogin:", ftos(e.playerid)));
                                }
                                else
@@ -282,13 +282,13 @@ float GameCommand_Vote(string s, entity e) {
                        } else if (!e) {
                                print_to(e, "^1You can't vote from the server console.");
                        } else if(e.vote_vote == 0
-                                 || cvar("sv_vote_change")) {
+                                 || autocvar_sv_vote_change) {
                                msg_entity = e;
                                VoteDialog_UpdateHighlight(1);
                                print_to(e, "^1You accepted the vote.");
                                e.vote_vote = 1;
                                centerprint_expire(e, CENTERPRIO_VOTE);
-                               if(!cvar("sv_vote_singlecount")) {
+                               if(!autocvar_sv_vote_singlecount) {
                                        VoteCount();
                                }
                        } else {
@@ -300,13 +300,13 @@ float GameCommand_Vote(string s, entity e) {
                        } else if (!e) {
                                print_to(e, "^1You can't vote from the server console.");
                        } else if(e.vote_vote == 0
-                                 || cvar("sv_vote_change")) {
+                                 || autocvar_sv_vote_change) {
                                msg_entity = e;
                                VoteDialog_UpdateHighlight(2);
                                print_to(e, "^1You rejected the vote.");
                                e.vote_vote = -1;
                                centerprint_expire(e, CENTERPRIO_VOTE);
-                               if(!cvar("sv_vote_singlecount")) {
+                               if(!autocvar_sv_vote_singlecount) {
                                        VoteCount();
                                }
                        } else {
@@ -318,13 +318,13 @@ float GameCommand_Vote(string s, entity e) {
                        } else if (!e) {
                                print_to(e, "^1You can't vote from the server console.");
                        } else if(e.vote_vote == 0
-                                 || cvar("sv_vote_change")) {
+                                 || autocvar_sv_vote_change) {
                                msg_entity = e;
                                VoteDialog_UpdateHighlight(3);
                                print_to(e, "^1You abstained from your vote.");
                                e.vote_vote = -2;
                                centerprint_expire(e, CENTERPRIO_VOTE);
-                               if(!cvar("sv_vote_singlecount")) {
+                               if(!autocvar_sv_vote_singlecount) {
                                        VoteCount();
                                }
                        } else {
@@ -341,17 +341,17 @@ float GameCommand_Vote(string s, entity e) {
 
 void VoteHelp(entity e) {
        local string vmasterdis;
-       if(!cvar("sv_vote_master")) {
+       if(!autocvar_sv_vote_master) {
                vmasterdis = " ^1(disabled)";
        }
 
        local string vlogindis;
-       if("" == cvar_string("sv_vote_master_password")) {
+       if("" == autocvar_sv_vote_master_password) {
                vlogindis = " ^1(disabled)";
        }
 
        local string vcalldis;
-       if(!cvar("sv_vote_call")) {
+       if(!autocvar_sv_vote_call) {
                vcalldis = " ^1(disabled)";
        }
 
@@ -367,9 +367,9 @@ void VoteHelp(entity e) {
        print_to(e, "^7\"^2yes^7\", \"^2no^7\", \"^2abstain^7\" and \"^2dontcare^7\" to make your vote.");
        print_to(e, "^7If enough of the players vote yes the vote is accepted.");
        print_to(e, "^7If enough of the players vote no the vote is rejected.");
-       print_to(e, strcat("^7If neither the vote will timeout after ", ftos(cvar("sv_vote_timeout")), "^7 seconds."));
+       print_to(e, strcat("^7If neither the vote will timeout after ", ftos(autocvar_sv_vote_timeout), "^7 seconds."));
        print_to(e, "^7You can call a vote for or execute these commands:");
-       print_to(e, strcat("^3", cvar_string("sv_vote_commands"), "^7 and maybe further ^3arguments^7"));
+       print_to(e, strcat("^3", autocvar_sv_vote_commands, "^7 and maybe further ^3arguments^7"));
 }
 
 string VoteNetname(entity e)
@@ -377,10 +377,10 @@ string VoteNetname(entity e)
        if(e) {
                return e.netname;
        } else {
-               if(cvar_string("sv_adminnick") != "") {
-                       return cvar_string("sv_adminnick");
+               if(autocvar_sv_adminnick != "") {
+                       return autocvar_sv_adminnick;
                } else {
-                       return cvar_string("hostname");
+                       return autocvar_hostname;
                }
        }
 }
@@ -393,7 +393,7 @@ string ValidateMap(string m, entity e)
                print_to(e, "This map is not available on this server.");
                return string_null;
        }
-       if(!cvar("sv_vote_override_mostrecent"))
+       if(!autocvar_sv_vote_override_mostrecent)
                if(Map_IsRecent(m))
                {
                        print_to(e, "This server does not allow for recent maps to be played again. Please be patient for some rounds.");
@@ -443,17 +443,17 @@ float VoteCommandInList(string votecommand, string list)
 }
 
 float VoteAllowed(string votecommand, string cmd) {
-       if(VoteCommandInList(votecommand, cvar_string("sv_vote_commands")))
+       if(VoteCommandInList(votecommand, autocvar_sv_vote_commands))
                return TRUE;
 
        if(cmd == "vdo")
        {
-               if(VoteCommandInList(votecommand, cvar_string("sv_vote_master_commands")))
+               if(VoteCommandInList(votecommand, autocvar_sv_vote_master_commands))
                        return TRUE;
        }
        else
        {
-               if(VoteCommandInList(votecommand, cvar_string("sv_vote_only_commands")))
+               if(VoteCommandInList(votecommand, autocvar_sv_vote_only_commands))
                        return TRUE;
        }
 
@@ -512,12 +512,12 @@ void VoteTimeout() {
 
 void VoteStop(entity stopper) {
        bprint("\{1}^2* ^3", VoteNetname(stopper), "^2 stopped ^3", VoteNetname(votecaller), "^2's vote\n");
-       if(cvar("sv_eventlog"))
+       if(autocvar_sv_eventlog)
                GameLogEcho(strcat(":vote:vstop:", ftos(stopper.playerid)));
        if(stopper == votecaller) {
                // no wait for next vote so you can correct your vote
                if(votecaller) {
-                       votecaller.vote_next = time + cvar("sv_vote_stop");
+                       votecaller.vote_next = time + autocvar_sv_vote_stop;
                }
        }
        VoteReset();
@@ -542,7 +542,7 @@ void VoteSpam(float yescount, float nocount, float abstaincount, float notvoters
                s = strcat(s, ftos(notvoters), "^2 didn't have to vote\n");
        }
        bprint(s);
-       if(cvar("sv_eventlog"))
+       if(autocvar_sv_eventlog)
        {
                s = strcat(":vote:v", result, ":", ftos(yescount));
                s = strcat(s, ":", ftos(nocount));
@@ -603,7 +603,7 @@ void VoteCount() {
        }
 
        //in tournament mode, if we have at least one player then don't make the vote dependent on spectators (so specs don't have to press F1)
-       if(cvar("sv_vote_nospectators"))
+       if(autocvar_sv_vote_nospectators)
        if(realplayercount > 0) {
                yescount = realplayeryescount;
                nocount = realplayernocount;
@@ -612,8 +612,8 @@ void VoteCount() {
        }
 
        float votefactor, simplevotefactor;
-       votefactor = bound(0.5, cvar("sv_vote_majority_factor"), 0.999);
-       simplevotefactor = cvar("sv_vote_simple_majority_factor");
+       votefactor = bound(0.5, autocvar_sv_vote_majority_factor, 0.999);
+       simplevotefactor = autocvar_sv_vote_simple_majority_factor;
        float needed;
        needed = floor((playercount - abstaincount) * max(votefactor, simplevotefactor)) + 1;
        VoteDialog_Update(MSG_ALL, yescount, nocount, needed);
index 1347fc88c94baae7678661584e54be2c68c2be15..777f0d112bbb6721775f33b9a07a074e6f94a1cd 100644 (file)
@@ -11,13 +11,13 @@ REGISTER_WEAPON(CAMPINGRIFLE, w_campingrifle, IT_NAILS, 7, WEP_FLAG_NORMAL | WEP
 float W_CampingRifle_CheckMaxBullets(float checkammo)
 {
        float maxbulls;
-       maxbulls = cvar("g_balance_campingrifle_magazinecapacity");
+       maxbulls = autocvar_g_balance_campingrifle_magazinecapacity;
        if(!maxbulls)
                maxbulls = 8; // match HUD
        if(checkammo)
                if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
-                       maxbulls = min(maxbulls, floor(self.ammo_nails / min(cvar("g_balance_campingrifle_primary_ammo"), cvar("g_balance_campingrifle_secondary_ammo"))));
-       if(self.campingrifle_bulletcounter > maxbulls || !cvar("g_balance_campingrifle_magazinecapacity"))
+                       maxbulls = min(maxbulls, floor(self.ammo_nails / min(autocvar_g_balance_campingrifle_primary_ammo, autocvar_g_balance_campingrifle_secondary_ammo)));
+       if(self.campingrifle_bulletcounter > maxbulls || !autocvar_g_balance_campingrifle_magazinecapacity)
                self.campingrifle_bulletcounter = maxbulls;
        return (self.campingrifle_bulletcounter == maxbulls);
 }
@@ -25,9 +25,9 @@ float W_CampingRifle_CheckMaxBullets(float checkammo)
 void W_CampingRifle_ReloadedAndReady()
 {
        float t;
-       self.campingrifle_bulletcounter = cvar("g_balance_campingrifle_magazinecapacity");
+       self.campingrifle_bulletcounter = autocvar_g_balance_campingrifle_magazinecapacity;
        W_CampingRifle_CheckMaxBullets(TRUE);
-       t = ATTACK_FINISHED(self) - cvar("g_balance_campingrifle_reloadtime") - 1;
+       t = ATTACK_FINISHED(self) - autocvar_g_balance_campingrifle_reloadtime - 1;
        ATTACK_FINISHED(self) = t;
        w_ready();
 }
@@ -38,7 +38,7 @@ float W_CampingRifle_Reload()
 
        W_CampingRifle_CheckMaxBullets(TRUE);
 
-       if(self.ammo_nails < min(cvar("g_balance_campingrifle_primary_ammo"), cvar("g_balance_campingrifle_secondary_ammo"))) // when we get here, bulletcounter must be 0 or -1
+       if(self.ammo_nails < min(autocvar_g_balance_campingrifle_primary_ammo, autocvar_g_balance_campingrifle_secondary_ammo)) // when we get here, bulletcounter must be 0 or -1
        {
                print("cannot reload... not enough bullets\n");
                self.campingrifle_bulletcounter = -1; // reload later
@@ -46,7 +46,7 @@ float W_CampingRifle_Reload()
                return 0;
        }
        
-       if (self.campingrifle_bulletcounter >= cvar("g_balance_campingrifle_magazinecapacity"))
+       if (self.campingrifle_bulletcounter >= autocvar_g_balance_campingrifle_magazinecapacity)
                return 0;
 
        if (self.weaponentity)
@@ -60,10 +60,10 @@ float W_CampingRifle_Reload()
 
        sound (self, CHAN_WEAPON2, "weapons/campingrifle_reload.wav", VOL_BASE, ATTN_NORM);
 
-       t = max(time, ATTACK_FINISHED(self)) + cvar("g_balance_campingrifle_reloadtime") + 1;
+       t = max(time, ATTACK_FINISHED(self)) + autocvar_g_balance_campingrifle_reloadtime + 1;
        ATTACK_FINISHED(self) = t;
 
-       weapon_thinkf(WFRAME_RELOAD, cvar("g_balance_campingrifle_reloadtime"), W_CampingRifle_ReloadedAndReady);
+       weapon_thinkf(WFRAME_RELOAD, autocvar_g_balance_campingrifle_reloadtime, W_CampingRifle_ReloadedAndReady);
 
        self.campingrifle_bulletcounter = -1;
 
@@ -84,9 +84,9 @@ void W_CampingRifle_FireBullet(float pSpread, float pDamage, float pHeadshotAdde
                self.ammo_nails -= pAmmo;
 
        if(deathtype & HITTYPE_SECONDARY)
-               W_SetupShot (self, cvar("g_antilag_bullets") && pSpeed >= cvar("g_antilag_bullets"), 2, "weapons/campingrifle_fire2.wav", CHAN_WEAPON, cvar("g_balance_campingrifle_secondary_damage") + cvar("g_balance_campingrifle_secondary_headshotaddeddamage"));
+               W_SetupShot (self, autocvar_g_antilag_bullets && pSpeed >= autocvar_g_antilag_bullets, 2, "weapons/campingrifle_fire2.wav", CHAN_WEAPON, autocvar_g_balance_campingrifle_secondary_damage + autocvar_g_balance_campingrifle_secondary_headshotaddeddamage);
        else
-               W_SetupShot (self, cvar("g_antilag_bullets") && pSpeed >= cvar("g_antilag_bullets"), 2, "weapons/campingrifle_fire.wav", CHAN_WEAPON, cvar("g_balance_campingrifle_primary_damage") + cvar("g_balance_campingrifle_primary_headshotaddeddamage"));
+               W_SetupShot (self, autocvar_g_antilag_bullets && pSpeed >= autocvar_g_antilag_bullets, 2, "weapons/campingrifle_fire.wav", CHAN_WEAPON, autocvar_g_balance_campingrifle_primary_damage + autocvar_g_balance_campingrifle_primary_headshotaddeddamage);
 
        pointparticles(particleeffectnum("shotgun_muzzleflash"), w_shotorg, w_shotdir * 2000, 1);
 
@@ -97,12 +97,12 @@ void W_CampingRifle_FireBullet(float pSpread, float pDamage, float pHeadshotAdde
        }
 
        if(deathtype & HITTYPE_SECONDARY)
-               fireBallisticBullet(w_shotorg, w_shotdir, pSpread, pSpeed, pLifetime, pDamage, pHeadshotAddedDamage / pDamage, pForce, deathtype, (cvar("g_balance_campingrifle_secondary_tracer") ? EF_RED : EF_BLUE), 1, pBulletConstant);
+               fireBallisticBullet(w_shotorg, w_shotdir, pSpread, pSpeed, pLifetime, pDamage, pHeadshotAddedDamage / pDamage, pForce, deathtype, (autocvar_g_balance_campingrifle_secondary_tracer ? EF_RED : EF_BLUE), 1, pBulletConstant);
        else
-               fireBallisticBullet(w_shotorg, w_shotdir, pSpread, pSpeed, pLifetime, pDamage, pHeadshotAddedDamage / pDamage, pForce, deathtype, (cvar("g_balance_campingrifle_primary_tracer") ? EF_RED : EF_BLUE), 1, pBulletConstant);
+               fireBallisticBullet(w_shotorg, w_shotdir, pSpread, pSpeed, pLifetime, pDamage, pHeadshotAddedDamage / pDamage, pForce, deathtype, (autocvar_g_balance_campingrifle_primary_tracer ? EF_RED : EF_BLUE), 1, pBulletConstant);
        endFireBallisticBullet();
 
-       if (cvar("g_casings") >= 2)
+       if (autocvar_g_casings >= 2)
                SpawnCasing (((random () * 50 + 50) * v_right) - (v_forward * (random () * 25 + 25)) - ((random () * 5 - 70) * v_up), 2, vectoangles(v_forward),'0 250 0', 100, 3, self);
        
        self.campingrifle_bulletcounter = self.campingrifle_bulletcounter - 1;
@@ -111,12 +111,12 @@ void W_CampingRifle_FireBullet(float pSpread, float pDamage, float pHeadshotAdde
 
 void W_CampingRifle_Attack()
 {
-       W_CampingRifle_FireBullet(cvar("g_balance_campingrifle_primary_spread"), cvar("g_balance_campingrifle_primary_damage"), cvar("g_balance_campingrifle_primary_headshotaddeddamage"), cvar("g_balance_campingrifle_primary_force"), cvar("g_balance_campingrifle_primary_speed"), cvar("g_balance_campingrifle_primary_lifetime"), cvar("g_balance_campingrifle_primary_ammo"), WEP_CAMPINGRIFLE, cvar("g_balance_campingrifle_primary_bulletconstant"));
+       W_CampingRifle_FireBullet(autocvar_g_balance_campingrifle_primary_spread, autocvar_g_balance_campingrifle_primary_damage, autocvar_g_balance_campingrifle_primary_headshotaddeddamage, autocvar_g_balance_campingrifle_primary_force, autocvar_g_balance_campingrifle_primary_speed, autocvar_g_balance_campingrifle_primary_lifetime, autocvar_g_balance_campingrifle_primary_ammo, WEP_CAMPINGRIFLE, autocvar_g_balance_campingrifle_primary_bulletconstant);
 }
 
 void W_CampingRifle_Attack2()
 {
-       W_CampingRifle_FireBullet(cvar("g_balance_campingrifle_secondary_spread"), cvar("g_balance_campingrifle_secondary_damage"), cvar("g_balance_campingrifle_secondary_headshotaddeddamage"), cvar("g_balance_campingrifle_secondary_force"), cvar("g_balance_campingrifle_secondary_speed"), cvar("g_balance_campingrifle_secondary_lifetime"), cvar("g_balance_campingrifle_secondary_ammo"), WEP_CAMPINGRIFLE | HITTYPE_SECONDARY, cvar("g_balance_campingrifle_secondary_bulletconstant"));
+       W_CampingRifle_FireBullet(autocvar_g_balance_campingrifle_secondary_spread, autocvar_g_balance_campingrifle_secondary_damage, autocvar_g_balance_campingrifle_secondary_headshotaddeddamage, autocvar_g_balance_campingrifle_secondary_force, autocvar_g_balance_campingrifle_secondary_speed, autocvar_g_balance_campingrifle_secondary_lifetime, autocvar_g_balance_campingrifle_secondary_ammo, WEP_CAMPINGRIFLE | HITTYPE_SECONDARY, autocvar_g_balance_campingrifle_secondary_bulletconstant);
 }
 
 void spawnfunc_weapon_campingrifle (void)
@@ -187,7 +187,7 @@ float w_campingrifle(float req)
                        self.bot_secondary_campingriflemooth = 0;
                if(self.bot_secondary_campingriflemooth == 0)
                {
-                       if(bot_aim(cvar("g_balance_campingrifle_primary_speed"), 0, cvar("g_balance_campingrifle_primary_lifetime"), TRUE))
+                       if(bot_aim(autocvar_g_balance_campingrifle_primary_speed, 0, autocvar_g_balance_campingrifle_primary_lifetime, TRUE))
                        {
                                self.BUTTON_ATCK = TRUE;
                                if(random() < 0.01) self.bot_secondary_campingriflemooth = 1;
@@ -195,7 +195,7 @@ float w_campingrifle(float req)
                }
                else
                {
-                       if(bot_aim(cvar("g_balance_campingrifle_secondary_speed"), 0, cvar("g_balance_campingrifle_secondary_lifetime"), TRUE))
+                       if(bot_aim(autocvar_g_balance_campingrifle_secondary_speed, 0, autocvar_g_balance_campingrifle_secondary_lifetime, TRUE))
                        {
                                self.BUTTON_ATCK2 = TRUE;
                                if(random() < 0.03) self.bot_secondary_campingriflemooth = 0;
@@ -212,25 +212,25 @@ float w_campingrifle(float req)
                }
                else
                {
-                       self.campingrifle_accumulator = bound(time - cvar("g_balance_campingrifle_bursttime"), self.campingrifle_accumulator, time);
+                       self.campingrifle_accumulator = bound(time - autocvar_g_balance_campingrifle_bursttime, self.campingrifle_accumulator, time);
                        if (self.BUTTON_ATCK)
-                       if (weapon_prepareattack_check(0, cvar("g_balance_campingrifle_primary_refire")))
-                       if (time >= self.campingrifle_accumulator + cvar("g_balance_campingrifle_primary_burstcost"))
+                       if (weapon_prepareattack_check(0, autocvar_g_balance_campingrifle_primary_refire))
+                       if (time >= self.campingrifle_accumulator + autocvar_g_balance_campingrifle_primary_burstcost)
                        {
-                               weapon_prepareattack_do(0, cvar("g_balance_campingrifle_primary_refire"));
-                               W_CampingRifle_BulletHail(cvar("g_balance_campingrifle_primary_bullethail"), W_CampingRifle_Attack, WFRAME_FIRE1, cvar("g_balance_campingrifle_primary_animtime"), cvar("g_balance_campingrifle_primary_refire"));
-                               self.campingrifle_accumulator += cvar("g_balance_campingrifle_primary_burstcost");
+                               weapon_prepareattack_do(0, autocvar_g_balance_campingrifle_primary_refire);
+                               W_CampingRifle_BulletHail(autocvar_g_balance_campingrifle_primary_bullethail, W_CampingRifle_Attack, WFRAME_FIRE1, autocvar_g_balance_campingrifle_primary_animtime, autocvar_g_balance_campingrifle_primary_refire);
+                               self.campingrifle_accumulator += autocvar_g_balance_campingrifle_primary_burstcost;
                        }
                        if (self.BUTTON_ATCK2)
                        {       
-                               if (cvar("g_balance_campingrifle_secondary"))
+                               if (autocvar_g_balance_campingrifle_secondary)
                                {
-                                       if (weapon_prepareattack_check(1, cvar("g_balance_campingrifle_secondary_refire")))
-                                       if (time >= self.campingrifle_accumulator + cvar("g_balance_campingrifle_secondary_burstcost"))
+                                       if (weapon_prepareattack_check(1, autocvar_g_balance_campingrifle_secondary_refire))
+                                       if (time >= self.campingrifle_accumulator + autocvar_g_balance_campingrifle_secondary_burstcost)
                                        {
-                                               weapon_prepareattack_do(1, cvar("g_balance_campingrifle_secondary_refire"));
-                                               W_CampingRifle_BulletHail(cvar("g_balance_campingrifle_secondary_bullethail"), W_CampingRifle_Attack2, WFRAME_FIRE2, cvar("g_balance_campingrifle_secondary_animtime"), cvar("g_balance_campingrifle_primary_refire"));
-                                               self.campingrifle_accumulator += cvar("g_balance_campingrifle_secondary_burstcost");
+                                               weapon_prepareattack_do(1, autocvar_g_balance_campingrifle_secondary_refire);
+                                               W_CampingRifle_BulletHail(autocvar_g_balance_campingrifle_secondary_bullethail, W_CampingRifle_Attack2, WFRAME_FIRE2, autocvar_g_balance_campingrifle_secondary_animtime, autocvar_g_balance_campingrifle_primary_refire);
+                                               self.campingrifle_accumulator += autocvar_g_balance_campingrifle_secondary_burstcost;
                                        }
                                }
                        }
@@ -250,22 +250,22 @@ float w_campingrifle(float req)
                weapon_setup(WEP_CAMPINGRIFLE);
 
                full = W_CampingRifle_CheckMaxBullets(TRUE);
-               if(cvar("g_balance_campingrifle_auto_reload_on_switch"))
+               if(autocvar_g_balance_campingrifle_auto_reload_on_switch)
                        if(!full)
                                self.campingrifle_bulletcounter = -1;
        }
        else if (req == WR_CHECKAMMO1)
-               return self.ammo_nails >= cvar("g_balance_campingrifle_primary_ammo");
+               return self.ammo_nails >= autocvar_g_balance_campingrifle_primary_ammo;
        else if (req == WR_CHECKAMMO2)
-               return self.ammo_nails >= cvar("g_balance_campingrifle_secondary_ammo");
+               return self.ammo_nails >= autocvar_g_balance_campingrifle_secondary_ammo;
        else if (req == WR_RELOAD)
        {
                W_CampingRifle_Reload();
        }
        else if (req == WR_RESETPLAYER)
        {
-               self.campingrifle_accumulator = time - cvar("g_balance_campingrifle_bursttime");
-               self.campingrifle_bulletcounter = cvar("g_balance_campingrifle_magazinecapacity");
+               self.campingrifle_accumulator = time - autocvar_g_balance_campingrifle_bursttime;
+               self.campingrifle_bulletcounter = autocvar_g_balance_campingrifle_magazinecapacity;
                W_CampingRifle_CheckMaxBullets(FALSE);
        }
        return TRUE;
index 2dd97c831df1f86c613cdb90bc14f7cf682f710c..3be3be20214716d0d559a085b8c1cbddd23d6167 100644 (file)
@@ -249,7 +249,7 @@ float W_BallisticBullet_LeaveSolid(entity e, vector vel, float constant)
        // maxdist = 0.5 * v0 * v0 / constant
        // dprint("max dist = ", ftos(maxdist), "\n");
 
-       if(maxdist <= cvar("g_ballistics_mindistance"))
+       if(maxdist <= autocvar_g_ballistics_mindistance)
                return 0;
 
        traceline_inverted (self.origin, self.origin + normalize(vel) * maxdist, MOVE_NORMAL, self);
@@ -259,7 +259,7 @@ float W_BallisticBullet_LeaveSolid(entity e, vector vel, float constant)
 
        self.W_BallisticBullet_LeaveSolid_origin = trace_endpos;
 
-       dst = max(cvar("g_ballistics_mindistance"), vlen(trace_endpos - self.origin));
+       dst = max(autocvar_g_ballistics_mindistance, vlen(trace_endpos - self.origin));
        // E(s) = E0 - constant * s, constant = area of bullet circle * material constant / mass
        Es_m = E0_m - constant * dst;
        if(Es_m <= 0)
@@ -352,7 +352,7 @@ void fireBallisticBullet(vector start, vector dir, float spread, float pSpeed, f
        entity pl, oldself;
        float antilagging;
 
-       antilagging = (cvar("g_antilag_bullets") && (pSpeed >= cvar("g_antilag_bullets")));
+       antilagging = (autocvar_g_antilag_bullets && (pSpeed >= autocvar_g_antilag_bullets));
 
        entity proj;
        proj = spawn();
@@ -370,7 +370,7 @@ void fireBallisticBullet(vector start, vector dir, float spread, float pSpeed, f
        proj.nextthink = time + lifetime; // min(pLifetime, vlen(world.maxs - world.mins) / pSpeed);
        W_SetupProjectileVelocityEx(proj, dir, v_up, pSpeed, 0, 0, spread, antilagging);
        proj.angles = vectoangles(proj.velocity);
-       proj.dmg_radius = cvar("g_ballistics_materialconstant") / bulletconstant;
+       proj.dmg_radius = autocvar_g_ballistics_materialconstant / bulletconstant;
        // so: bulletconstant = bullet mass / area of bullet circle
        setorigin(proj, start);
        proj.flags = FL_PROJECTILE;
@@ -400,7 +400,7 @@ void fireBallisticBullet(vector start, vector dir, float spread, float pSpeed, f
                        lag = 0;
                if(clienttype(self) != CLIENTTYPE_REAL)
                        lag = 0;
-               if(cvar("g_antilag") == 0 || self.cvar_cl_noantilag)
+               if(autocvar_g_antilag == 0 || self.cvar_cl_noantilag)
                        lag = 0; // only do hitscan, but no antilag
 
                if(lag)
index 092cb10e49b389c7a5ffa0610b7904ac8d19bbb6..d1f4e5d5ecc9b04852885fb5c26f1809bc820374 100644 (file)
@@ -52,7 +52,7 @@ void W_Crylink_LinkExplode (entity e, entity e2)
        if(e == e.realowner.crylink_lastgroup)
                e.realowner.crylink_lastgroup = world;
 
-       RadiusDamage (e, e.realowner, cvar("g_balance_crylink_primary_damage") * a, cvar("g_balance_crylink_primary_edgedamage") * a, cvar("g_balance_crylink_primary_radius"), world, cvar("g_balance_crylink_primary_force") * a, e.projectiledeathtype, other);
+       RadiusDamage (e, e.realowner, autocvar_g_balance_crylink_primary_damage * a, autocvar_g_balance_crylink_primary_edgedamage * a, autocvar_g_balance_crylink_primary_radius, world, autocvar_g_balance_crylink_primary_force * a, e.projectiledeathtype, other);
 
        if(e.queuenext != e2)
                W_Crylink_LinkExplode(e.queuenext, e2);
@@ -174,26 +174,26 @@ void W_Crylink_LinkJoinEffect_Think()
                {
                        if(e.projectiledeathtype & HITTYPE_SECONDARY)
                        {
-                               if(cvar("g_balance_crylink_secondary_joinexplode"))
+                               if(autocvar_g_balance_crylink_secondary_joinexplode)
                                {
-                                       n = n / cvar("g_balance_crylink_secondary_shots");
-                                       RadiusDamage (e, e.realowner, cvar("g_balance_crylink_secondary_joinexplode_damage") * n, 
-                                                                       cvar("g_balance_crylink_secondary_joinexplode_edgedamage") * n, 
-                                                                       cvar("g_balance_crylink_secondary_joinexplode_radius") * n, e.realowner, 
-                                                                       cvar("g_balance_crylink_secondary_joinexplode_force") * n, e.projectiledeathtype, other);
+                                       n = n / autocvar_g_balance_crylink_secondary_shots;
+                                       RadiusDamage (e, e.realowner, autocvar_g_balance_crylink_secondary_joinexplode_damage * n, 
+                                                                       autocvar_g_balance_crylink_secondary_joinexplode_edgedamage * n, 
+                                                                       autocvar_g_balance_crylink_secondary_joinexplode_radius * n, e.realowner, 
+                                                                       autocvar_g_balance_crylink_secondary_joinexplode_force * n, e.projectiledeathtype, other);
 
                                        pointparticles(particleeffectnum("crylink_joinexplode"), self.origin, '0 0 0', n);
                                }                               
                        }
                        else
                        {
-                               if(cvar("g_balance_crylink_primary_joinexplode"))
+                               if(autocvar_g_balance_crylink_primary_joinexplode)
                                {
-                                       n = n / cvar("g_balance_crylink_primary_shots");
-                                       RadiusDamage (e, e.realowner, cvar("g_balance_crylink_primary_joinexplode_damage") * n, 
-                                                                       cvar("g_balance_crylink_primary_joinexplode_edgedamage") * n, 
-                                                                       cvar("g_balance_crylink_primary_joinexplode_radius") * n, e.realowner, 
-                                                                       cvar("g_balance_crylink_primary_joinexplode_force") * n, e.projectiledeathtype, other);
+                                       n = n / autocvar_g_balance_crylink_primary_shots;
+                                       RadiusDamage (e, e.realowner, autocvar_g_balance_crylink_primary_joinexplode_damage * n, 
+                                                                       autocvar_g_balance_crylink_primary_joinexplode_edgedamage * n, 
+                                                                       autocvar_g_balance_crylink_primary_joinexplode_radius * n, e.realowner, 
+                                                                       autocvar_g_balance_crylink_primary_joinexplode_force * n, e.projectiledeathtype, other);
 
                                        pointparticles(particleeffectnum("crylink_joinexplode"), self.origin, '0 0 0', n);
                                }                               
@@ -228,10 +228,10 @@ void W_Crylink_Touch (void)
        if(finalhit)
                f = 1;
        else
-               f = cvar("g_balance_crylink_primary_bouncedamagefactor");
+               f = autocvar_g_balance_crylink_primary_bouncedamagefactor;
        if(a)
                f *= a;
-       if (RadiusDamage (self, self.realowner, cvar("g_balance_crylink_primary_damage") * f, cvar("g_balance_crylink_primary_edgedamage") * f, cvar("g_balance_crylink_primary_radius"), world, cvar("g_balance_crylink_primary_force") * f, self.projectiledeathtype, other) && cvar("g_balance_crylink_primary_linkexplode"))
+       if (RadiusDamage (self, self.realowner, autocvar_g_balance_crylink_primary_damage * f, autocvar_g_balance_crylink_primary_edgedamage * f, autocvar_g_balance_crylink_primary_radius, world, autocvar_g_balance_crylink_primary_force * f, self.projectiledeathtype, other) && autocvar_g_balance_crylink_primary_linkexplode)
        {
                if(self == self.realowner.crylink_lastgroup)
                        self.realowner.crylink_lastgroup = world;
@@ -278,10 +278,10 @@ void W_Crylink_Touch2 (void)
        if(finalhit)
                f = 1;
        else
-               f = cvar("g_balance_crylink_secondary_bouncedamagefactor");
+               f = autocvar_g_balance_crylink_secondary_bouncedamagefactor;
        if(a)
                f *= a;
-       if (RadiusDamage (self, self.realowner, cvar("g_balance_crylink_secondary_damage") * f, cvar("g_balance_crylink_secondary_edgedamage") * f, cvar("g_balance_crylink_secondary_radius"), world, cvar("g_balance_crylink_secondary_force") * f, self.projectiledeathtype, other) && cvar("g_balance_crylink_secondary_linkexplode"))
+       if (RadiusDamage (self, self.realowner, autocvar_g_balance_crylink_secondary_damage * f, autocvar_g_balance_crylink_secondary_edgedamage * f, autocvar_g_balance_crylink_secondary_radius, world, autocvar_g_balance_crylink_secondary_force * f, self.projectiledeathtype, other) && autocvar_g_balance_crylink_secondary_linkexplode)
        {
                if(self == self.realowner.crylink_lastgroup)
                        self.realowner.crylink_lastgroup = world;
@@ -320,19 +320,19 @@ void W_Crylink_Attack (void)
        float maxdmg;
 
        if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
-               self.ammo_cells = self.ammo_cells - cvar("g_balance_crylink_primary_ammo");
+               self.ammo_cells = self.ammo_cells - autocvar_g_balance_crylink_primary_ammo;
 
-       maxdmg = cvar("g_balance_crylink_primary_damage")*cvar("g_balance_crylink_primary_shots");
-       maxdmg *= 1 + cvar("g_balance_crylink_primary_bouncedamagefactor") * cvar("g_balance_crylink_primary_bounces");
-       if(cvar("g_balance_crylink_primary_joinexplode"))
-               maxdmg += cvar("g_balance_crylink_primary_joinexplode_damage");
+       maxdmg = autocvar_g_balance_crylink_primary_damage*autocvar_g_balance_crylink_primary_shots;
+       maxdmg *= 1 + autocvar_g_balance_crylink_primary_bouncedamagefactor * autocvar_g_balance_crylink_primary_bounces;
+       if(autocvar_g_balance_crylink_primary_joinexplode)
+               maxdmg += autocvar_g_balance_crylink_primary_joinexplode_damage;
 
        W_SetupShot (self, FALSE, 2, "weapons/crylink_fire.wav", CHAN_WEAPON, maxdmg);
        forward = v_forward;
        right = v_right;
        up = v_up;
 
-       shots = cvar("g_balance_crylink_primary_shots");
+       shots = autocvar_g_balance_crylink_primary_shots;
        pointparticles(particleeffectnum("crylink_muzzleflash"), w_shotorg, w_shotdir * 1000, shots);
        proj = world;
        while (counter < shots)
@@ -341,7 +341,7 @@ void W_Crylink_Attack (void)
                proj.realowner = proj.owner = self;
                proj.classname = "spike";
                proj.bot_dodge = TRUE;
-               proj.bot_dodgerating = cvar("g_balance_crylink_primary_damage");
+               proj.bot_dodgerating = autocvar_g_balance_crylink_primary_damage;
                if(shots == 1) {
                        proj.queuenext = proj;
                        proj.queueprev = proj;
@@ -380,24 +380,24 @@ void W_Crylink_Attack (void)
                        s_y = v_forward_x;
                        s_z = v_forward_y;
                }
-               s = s * cvar("g_balance_crylink_primary_spread") * g_weaponspreadfactor;
-               W_SetupProjectileVelocityEx(proj, w_shotdir + right * s_y + up * s_z, v_up, cvar("g_balance_crylink_primary_speed"), 0, 0, 0, FALSE);
+               s = s * autocvar_g_balance_crylink_primary_spread * g_weaponspreadfactor;
+               W_SetupProjectileVelocityEx(proj, w_shotdir + right * s_y + up * s_z, v_up, autocvar_g_balance_crylink_primary_speed, 0, 0, 0, FALSE);
                proj.touch = W_Crylink_Touch;
 
                proj.think = W_Crylink_Fadethink;
                if(counter == 0)
                {
-                       proj.fade_time = time + cvar("g_balance_crylink_primary_middle_lifetime");
-                       proj.fade_rate = 1 / cvar("g_balance_crylink_primary_middle_fadetime");
-                       proj.nextthink = time + cvar("g_balance_crylink_primary_middle_lifetime") + cvar("g_balance_crylink_primary_middle_fadetime");
+                       proj.fade_time = time + autocvar_g_balance_crylink_primary_middle_lifetime;
+                       proj.fade_rate = 1 / autocvar_g_balance_crylink_primary_middle_fadetime;
+                       proj.nextthink = time + autocvar_g_balance_crylink_primary_middle_lifetime + autocvar_g_balance_crylink_primary_middle_fadetime;
                }
                else
                {
-                       proj.fade_time = time + cvar("g_balance_crylink_primary_other_lifetime");
-                       proj.fade_rate = 1 / cvar("g_balance_crylink_primary_other_fadetime");
-                       proj.nextthink = time + cvar("g_balance_crylink_primary_other_lifetime") + cvar("g_balance_crylink_primary_other_fadetime");
+                       proj.fade_time = time + autocvar_g_balance_crylink_primary_other_lifetime;
+                       proj.fade_rate = 1 / autocvar_g_balance_crylink_primary_other_fadetime;
+                       proj.nextthink = time + autocvar_g_balance_crylink_primary_other_lifetime + autocvar_g_balance_crylink_primary_other_fadetime;
                }
-               proj.cnt = cvar("g_balance_crylink_primary_bounces");
+               proj.cnt = autocvar_g_balance_crylink_primary_bounces;
                //proj.scale = 1 + 1 * proj.cnt;
 
                proj.angles = vectoangles (proj.velocity);
@@ -422,16 +422,16 @@ void W_Crylink_Attack2 (void)
        float maxdmg;
 
        if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
-               self.ammo_cells = self.ammo_cells - cvar("g_balance_crylink_secondary_ammo");
+               self.ammo_cells = self.ammo_cells - autocvar_g_balance_crylink_secondary_ammo;
 
-       maxdmg = cvar("g_balance_crylink_secondary_damage")*cvar("g_balance_crylink_secondary_shots");
-       maxdmg *= 1 + cvar("g_balance_crylink_secondary_bouncedamagefactor") * cvar("g_balance_crylink_secondary_bounces");
-       if(cvar("g_balance_crylink_secondary_joinexplode"))
-               maxdmg += cvar("g_balance_crylink_secondary_joinexplode_damage");
+       maxdmg = autocvar_g_balance_crylink_secondary_damage*autocvar_g_balance_crylink_secondary_shots;
+       maxdmg *= 1 + autocvar_g_balance_crylink_secondary_bouncedamagefactor * autocvar_g_balance_crylink_secondary_bounces;
+       if(autocvar_g_balance_crylink_secondary_joinexplode)
+               maxdmg += autocvar_g_balance_crylink_secondary_joinexplode_damage;
 
        W_SetupShot (self, FALSE, 2, "weapons/crylink_fire2.wav", CHAN_WEAPON, maxdmg);
 
-       shots = cvar("g_balance_crylink_secondary_shots");
+       shots = autocvar_g_balance_crylink_secondary_shots;
        pointparticles(particleeffectnum("crylink_muzzleflash"), w_shotorg, w_shotdir * 1000, shots);
        proj = world;
        while (counter < shots)
@@ -440,7 +440,7 @@ void W_Crylink_Attack2 (void)
                proj.realowner = proj.owner = self;
                proj.classname = "spike";
                proj.bot_dodge = TRUE;
-               proj.bot_dodgerating = cvar("g_balance_crylink_secondary_damage");
+               proj.bot_dodgerating = autocvar_g_balance_crylink_secondary_damage;
                if(shots == 1) {
                        proj.queuenext = proj;
                        proj.queueprev = proj;
@@ -469,22 +469,22 @@ void W_Crylink_Attack2 (void)
                setorigin (proj, w_shotorg);
                setsize(proj, '0 0 0', '0 0 0');
 
-               W_SetupProjectileVelocityEx(proj, (w_shotdir + (((counter + 0.5) / shots) * 2 - 1) * v_right * cvar("g_balance_crylink_secondary_spread") * g_weaponspreadfactor), v_up, cvar("g_balance_crylink_secondary_speed"), 0, 0, 0, FALSE);
+               W_SetupProjectileVelocityEx(proj, (w_shotdir + (((counter + 0.5) / shots) * 2 - 1) * v_right * autocvar_g_balance_crylink_secondary_spread * g_weaponspreadfactor), v_up, autocvar_g_balance_crylink_secondary_speed, 0, 0, 0, FALSE);
                proj.touch = W_Crylink_Touch2;
                proj.think = W_Crylink_Fadethink;
                if(counter == (shots - 1) / 2)
                {
-                       proj.fade_time = time + cvar("g_balance_crylink_secondary_middle_lifetime");
-                       proj.fade_rate = 1 / cvar("g_balance_crylink_secondary_middle_fadetime");
-                       proj.nextthink = time + cvar("g_balance_crylink_secondary_middle_lifetime") + cvar("g_balance_crylink_secondary_middle_fadetime");
+                       proj.fade_time = time + autocvar_g_balance_crylink_secondary_middle_lifetime;
+                       proj.fade_rate = 1 / autocvar_g_balance_crylink_secondary_middle_fadetime;
+                       proj.nextthink = time + autocvar_g_balance_crylink_secondary_middle_lifetime + autocvar_g_balance_crylink_secondary_middle_fadetime;
                }
                else
                {
-                       proj.fade_time = time + cvar("g_balance_crylink_secondary_line_lifetime");
-                       proj.fade_rate = 1 / cvar("g_balance_crylink_secondary_line_fadetime");
-                       proj.nextthink = time + cvar("g_balance_crylink_secondary_line_lifetime") + cvar("g_balance_crylink_secondary_line_fadetime");
+                       proj.fade_time = time + autocvar_g_balance_crylink_secondary_line_lifetime;
+                       proj.fade_rate = 1 / autocvar_g_balance_crylink_secondary_line_fadetime;
+                       proj.nextthink = time + autocvar_g_balance_crylink_secondary_line_lifetime + autocvar_g_balance_crylink_secondary_line_fadetime;
                }
-               proj.cnt = cvar("g_balance_crylink_secondary_bounces");
+               proj.cnt = autocvar_g_balance_crylink_secondary_bounces;
                //proj.scale = 1 + 1 * proj.cnt;
 
                proj.angles = vectoangles (proj.velocity);
@@ -512,31 +512,31 @@ float w_crylink(float req)
        if (req == WR_AIM)
        {
                if (random() > 0.15)
-                       self.BUTTON_ATCK = bot_aim(cvar("g_balance_crylink_primary_speed"), 0, cvar("g_balance_crylink_primary_middle_lifetime"), FALSE);
+                       self.BUTTON_ATCK = bot_aim(autocvar_g_balance_crylink_primary_speed, 0, autocvar_g_balance_crylink_primary_middle_lifetime, FALSE);
                else
-                       self.BUTTON_ATCK2 = bot_aim(cvar("g_balance_crylink_secondary_speed"), 0, cvar("g_balance_crylink_secondary_middle_lifetime"), FALSE);
+                       self.BUTTON_ATCK2 = bot_aim(autocvar_g_balance_crylink_secondary_speed, 0, autocvar_g_balance_crylink_secondary_middle_lifetime, FALSE);
        }
        else if (req == WR_THINK)
        {
                if (self.BUTTON_ATCK)
                {
                        if (!self.crylink_waitrelease)
-                       if (weapon_prepareattack(0, cvar("g_balance_crylink_primary_refire")))
+                       if (weapon_prepareattack(0, autocvar_g_balance_crylink_primary_refire))
                        {
                                W_Crylink_Attack();
-                               weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_crylink_primary_animtime"), w_ready);
-                               if(cvar("g_balance_crylink_primary_joinspread") != 0 || cvar("g_balance_crylink_primary_jointime") != 0)
+                               weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_crylink_primary_animtime, w_ready);
+                               if(autocvar_g_balance_crylink_primary_joinspread != 0 || autocvar_g_balance_crylink_primary_jointime != 0)
                                        self.crylink_waitrelease = 1;
                        }
                }
-               else if(self.BUTTON_ATCK2 && cvar("g_balance_crylink_secondary"))
+               else if(self.BUTTON_ATCK2 && autocvar_g_balance_crylink_secondary)
                {
                        if (!self.crylink_waitrelease)
-                       if (weapon_prepareattack(1, cvar("g_balance_crylink_secondary_refire")))
+                       if (weapon_prepareattack(1, autocvar_g_balance_crylink_secondary_refire))
                        {
                                W_Crylink_Attack2();
-                               weapon_thinkf(WFRAME_FIRE2, cvar("g_balance_crylink_secondary_animtime"), w_ready);
-                               if(cvar("g_balance_crylink_secondary_joinspread") != 0 || cvar("g_balance_crylink_secondary_jointime") != 0)
+                               weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_crylink_secondary_animtime, w_ready);
+                               if(autocvar_g_balance_crylink_secondary_joinspread != 0 || autocvar_g_balance_crylink_secondary_jointime != 0)
                                        self.crylink_waitrelease = 2;
                        }
                }
@@ -553,12 +553,12 @@ float w_crylink(float req)
                                        
                                        if(self.crylink_waitrelease == 1)
                                        {
-                                               pos = W_Crylink_LinkJoin(self.crylink_lastgroup, cvar("g_balance_crylink_primary_joinspread") * cvar("g_balance_crylink_primary_speed"), cvar("g_balance_crylink_primary_jointime"));
+                                               pos = W_Crylink_LinkJoin(self.crylink_lastgroup, autocvar_g_balance_crylink_primary_joinspread * autocvar_g_balance_crylink_primary_speed, autocvar_g_balance_crylink_primary_jointime);
                                                
                                        }
                                        else
                                        {
-                                               pos = W_Crylink_LinkJoin(self.crylink_lastgroup, cvar("g_balance_crylink_secondary_joinspread") * cvar("g_balance_crylink_secondary_speed"), cvar("g_balance_crylink_secondary_jointime"));
+                                               pos = W_Crylink_LinkJoin(self.crylink_lastgroup, autocvar_g_balance_crylink_secondary_joinspread * autocvar_g_balance_crylink_secondary_speed, autocvar_g_balance_crylink_secondary_jointime);
                                        }
                                        
                                        linkjoineffect = spawn();
@@ -596,14 +596,14 @@ float w_crylink(float req)
                // don't "run out of ammo" and switch weapons while waiting for release
                if(self.crylink_lastgroup && self.crylink_waitrelease)
                        return TRUE;
-               return self.ammo_cells >= cvar("g_balance_crylink_primary_ammo");
+               return self.ammo_cells >= autocvar_g_balance_crylink_primary_ammo;
        }
        else if (req == WR_CHECKAMMO2)
        {
                // don't "run out of ammo" and switch weapons while waiting for release
                if(self.crylink_lastgroup && self.crylink_waitrelease)
                        return TRUE;
-               return self.ammo_cells >= cvar("g_balance_crylink_secondary_ammo");
+               return self.ammo_cells >= autocvar_g_balance_crylink_secondary_ammo;
        }
        return TRUE;
 };
index e7716feaf252051d90e0f9cc9c53d0256e071708..da29a441843d3f9122f683f0522276feb57d724d 100644 (file)
@@ -20,7 +20,7 @@ void W_Plasma_TriggerCombo(vector org, float rad, entity own)
                        e.takedamage = DAMAGE_NO;
                        e.classname = "plasma_chain";
                        e.think = W_Plasma_Explode_Combo;
-                       e.nextthink = time + vlen(e.WarpZone_findradius_dist) / cvar("g_balance_electro_combo_speed"); // delay combo chains, looks cooler
+                       e.nextthink = time + vlen(e.WarpZone_findradius_dist) / autocvar_g_balance_electro_combo_speed; // delay combo chains, looks cooler
                }
                e = e.chain;
        }
@@ -39,12 +39,12 @@ void W_Plasma_Explode (void)
        self.takedamage = DAMAGE_NO;
        if (self.movetype == MOVETYPE_BOUNCE)
        {
-               RadiusDamage (self, self.owner, cvar("g_balance_electro_secondary_damage"), cvar("g_balance_electro_secondary_edgedamage"), cvar("g_balance_electro_secondary_radius"), world, cvar("g_balance_electro_secondary_force"), self.projectiledeathtype, other);
+               RadiusDamage (self, self.owner, autocvar_g_balance_electro_secondary_damage, autocvar_g_balance_electro_secondary_edgedamage, autocvar_g_balance_electro_secondary_radius, world, autocvar_g_balance_electro_secondary_force, self.projectiledeathtype, other);
        }
        else
        {
-               W_Plasma_TriggerCombo(self.origin, cvar("g_balance_electro_primary_comboradius"), self.owner);
-               RadiusDamage (self, self.owner, cvar("g_balance_electro_primary_damage"), cvar("g_balance_electro_primary_edgedamage"), cvar("g_balance_electro_primary_radius"), world, cvar("g_balance_electro_primary_force"), self.projectiledeathtype, other);
+               W_Plasma_TriggerCombo(self.origin, autocvar_g_balance_electro_primary_comboradius, self.owner);
+               RadiusDamage (self, self.owner, autocvar_g_balance_electro_primary_damage, autocvar_g_balance_electro_primary_edgedamage, autocvar_g_balance_electro_primary_radius, world, autocvar_g_balance_electro_primary_force, self.projectiledeathtype, other);
        }
 
        remove (self);
@@ -52,10 +52,10 @@ void W_Plasma_Explode (void)
 
 void W_Plasma_Explode_Combo (void)
 {
-       W_Plasma_TriggerCombo(self.origin, cvar("g_balance_electro_combo_comboradius"), self.owner);
+       W_Plasma_TriggerCombo(self.origin, autocvar_g_balance_electro_combo_comboradius, self.owner);
 
        self.event_damage = SUB_Null;
-       RadiusDamage (self, self.owner, cvar("g_balance_electro_combo_damage"), cvar("g_balance_electro_combo_edgedamage"), cvar("g_balance_electro_combo_radius"), world, cvar("g_balance_electro_combo_force"), WEP_ELECTRO | HITTYPE_BOUNCE, world); // use THIS type for a combo because primary can't bounce
+       RadiusDamage (self, self.owner, autocvar_g_balance_electro_combo_damage, autocvar_g_balance_electro_combo_edgedamage, autocvar_g_balance_electro_combo_radius, world, autocvar_g_balance_electro_combo_force, WEP_ELECTRO | HITTYPE_BOUNCE, world); // use THIS type for a combo because primary can't bounce
        remove (self);
 }
 
@@ -95,7 +95,7 @@ void W_Plasma_Damage (entity inflictor, entity attacker, float damage, float dea
                        self.owner = inflictor.owner;
                        self.classname = "plasma_chain";
                        self.think = W_Plasma_Explode_Combo;
-                       self.nextthink = time + min(cvar("g_balance_electro_combo_radius"), vlen(self.origin - inflictor.origin)) / cvar("g_balance_electro_combo_speed"); // delay combo chains, looks cooler
+                       self.nextthink = time + min(autocvar_g_balance_electro_combo_radius, vlen(self.origin - inflictor.origin)) / autocvar_g_balance_electro_combo_speed; // delay combo chains, looks cooler
                                //                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bounding the length, because inflictor may be in a galaxy far far away (warpzones)
                }
                else
@@ -110,7 +110,7 @@ void W_Electro_Attack()
 {
        local entity proj;
 
-       W_SetupShot_ProjectileSize (self, '0 0 -3', '0 0 -3', FALSE, 2, "weapons/electro_fire.wav", CHAN_WEAPON, cvar("g_balance_electro_primary_damage"));
+       W_SetupShot_ProjectileSize (self, '0 0 -3', '0 0 -3', FALSE, 2, "weapons/electro_fire.wav", CHAN_WEAPON, autocvar_g_balance_electro_primary_damage);
 
        pointparticles(particleeffectnum("electro_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
 
@@ -118,16 +118,16 @@ void W_Electro_Attack()
        proj.classname = "plasma_prim";
        proj.owner = self;
        proj.bot_dodge = TRUE;
-       proj.bot_dodgerating = cvar("g_balance_electro_primary_damage");
+       proj.bot_dodgerating = autocvar_g_balance_electro_primary_damage;
        proj.use = W_Plasma_Explode;
        proj.think = adaptor_think2use_hittype_splash;
-       proj.nextthink = time + cvar("g_balance_electro_primary_lifetime");
+       proj.nextthink = time + autocvar_g_balance_electro_primary_lifetime;
        PROJECTILE_MAKETRIGGER(proj);
        proj.projectiledeathtype = WEP_ELECTRO;
        setorigin(proj, w_shotorg);
 
        if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
-               self.ammo_cells = self.ammo_cells - cvar("g_balance_electro_primary_ammo");
+               self.ammo_cells = self.ammo_cells - autocvar_g_balance_electro_primary_ammo;
        proj.movetype = MOVETYPE_FLY;
        W_SETUPPROJECTILEVELOCITY(proj, g_balance_electro_primary);
        proj.angles = vectoangles(proj.velocity);
@@ -147,7 +147,7 @@ void W_Electro_Attack2()
 {
        local entity proj;
 
-       W_SetupShot_ProjectileSize (self, '0 0 -4', '0 0 -4', FALSE, 2, "weapons/electro_fire2.wav", CHAN_WEAPON, cvar("g_balance_electro_secondary_damage"));
+       W_SetupShot_ProjectileSize (self, '0 0 -4', '0 0 -4', FALSE, 2, "weapons/electro_fire2.wav", CHAN_WEAPON, autocvar_g_balance_electro_secondary_damage);
 
        w_shotdir = v_forward; // no TrueAim for grenades please
 
@@ -159,14 +159,14 @@ void W_Electro_Attack2()
        proj.use = W_Plasma_Explode;
        proj.think = adaptor_think2use_hittype_splash;
        proj.bot_dodge = TRUE;
-       proj.bot_dodgerating = cvar("g_balance_electro_secondary_damage");
-       proj.nextthink = time + cvar("g_balance_electro_secondary_lifetime");
+       proj.bot_dodgerating = autocvar_g_balance_electro_secondary_damage;
+       proj.nextthink = time + autocvar_g_balance_electro_secondary_lifetime;
        PROJECTILE_MAKETRIGGER(proj);
        proj.projectiledeathtype = WEP_ELECTRO | HITTYPE_SECONDARY;
        setorigin(proj, w_shotorg);
 
        if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
-               self.ammo_cells = self.ammo_cells - cvar("g_balance_electro_secondary_ammo");
+               self.ammo_cells = self.ammo_cells - autocvar_g_balance_electro_secondary_ammo;
        //proj.glow_size = 50;
        //proj.glow_color = 45;
        proj.movetype = MOVETYPE_BOUNCE;
@@ -174,13 +174,13 @@ void W_Electro_Attack2()
        proj.touch = W_Plasma_Touch;
        setsize(proj, '0 0 -4', '0 0 -4');
        proj.takedamage = DAMAGE_YES;
-       proj.damageforcescale = cvar("g_balance_electro_secondary_damageforcescale");
-       proj.health = cvar("g_balance_electro_secondary_health");
+       proj.damageforcescale = autocvar_g_balance_electro_secondary_damageforcescale;
+       proj.health = autocvar_g_balance_electro_secondary_health;
        proj.event_damage = W_Plasma_Damage;
        proj.flags = FL_PROJECTILE;
        
-       proj.bouncefactor = cvar("g_balance_electro_secondary_bouncefactor");
-       proj.bouncestop = cvar("g_balance_electro_secondary_bouncestop");
+       proj.bouncefactor = autocvar_g_balance_electro_secondary_bouncefactor;
+       proj.bouncestop = autocvar_g_balance_electro_secondary_bouncestop;
        
 #if 0
        entity p2;
@@ -206,7 +206,7 @@ float lgbeam_send(entity to, float sf)
        if(sf & 1)
        {
                WriteByte(MSG_ENTITY, num_for_edict(self.owner));
-               WriteCoord(MSG_ENTITY, cvar("g_balance_electro_primary_range"));
+               WriteCoord(MSG_ENTITY, autocvar_g_balance_electro_primary_range);
        }
        if(sf & 2)
        {
@@ -248,29 +248,29 @@ void lgbeam_think()
        dt = frametime;
        if not(self.owner.items & IT_UNLIMITED_WEAPON_AMMO)
        {
-               if(cvar("g_balance_electro_primary_ammo"))
+               if(autocvar_g_balance_electro_primary_ammo)
                {
-                       dt = min(dt, self.owner.ammo_cells / cvar("g_balance_electro_primary_ammo"));
-                       self.owner.ammo_cells = max(0, self.owner.ammo_cells - cvar("g_balance_electro_primary_ammo") * frametime);
+                       dt = min(dt, self.owner.ammo_cells / autocvar_g_balance_electro_primary_ammo);
+                       self.owner.ammo_cells = max(0, self.owner.ammo_cells - autocvar_g_balance_electro_primary_ammo * frametime);
                }
        }
 
-       W_SetupShot_Range(self.owner, TRUE, 0, "", 0, cvar("g_balance_electro_primary_damage") * dt, cvar("g_balance_electro_primary_range"));
+       W_SetupShot_Range(self.owner, TRUE, 0, "", 0, autocvar_g_balance_electro_primary_damage * dt, autocvar_g_balance_electro_primary_range);
        WarpZone_traceline_antilag(self.owner, w_shotorg, w_shotend, MOVE_NORMAL, self.owner, ANTILAG_LATENCY(self.owner));
 
        // apply the damage
        if(trace_ent)
        {
                vector force;
-               force = w_shotdir * cvar("g_balance_electro_primary_force") + '0 0 1' * cvar("g_balance_electro_primary_force_up");
+               force = w_shotdir * autocvar_g_balance_electro_primary_force + '0 0 1' * autocvar_g_balance_electro_primary_force_up;
 
-               f = ExponentialFalloff(cvar("g_balance_electro_primary_falloff_mindist"), cvar("g_balance_electro_primary_falloff_maxdist"), cvar("g_balance_electro_primary_falloff_halflifedist"), vlen(WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos) - w_shotorg));
+               f = ExponentialFalloff(autocvar_g_balance_electro_primary_falloff_mindist, autocvar_g_balance_electro_primary_falloff_maxdist, autocvar_g_balance_electro_primary_falloff_halflifedist, vlen(WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos) - w_shotorg));
 
                if(accuracy_isgooddamage(self.owner, trace_ent))
-                       accuracy_add(self.owner, WEP_ELECTRO, 0, cvar("g_balance_electro_primary_damage") * dt * f);
-               Damage (trace_ent, self.owner, self.owner, cvar("g_balance_electro_primary_damage") * dt * f, WEP_ELECTRO, trace_endpos, force * dt);
+                       accuracy_add(self.owner, WEP_ELECTRO, 0, autocvar_g_balance_electro_primary_damage * dt * f);
+               Damage (trace_ent, self.owner, self.owner, autocvar_g_balance_electro_primary_damage * dt * f, WEP_ELECTRO, trace_endpos, force * dt);
        }
-       W_Plasma_TriggerCombo(trace_endpos, cvar("g_balance_electro_primary_comboradius"), self.owner);
+       W_Plasma_TriggerCombo(trace_endpos, autocvar_g_balance_electro_primary_comboradius, self.owner);
 
        // draw effect
        if(w_shotorg != self.hook_start)
@@ -301,7 +301,7 @@ void W_Electro_Attack3 (void)
        beam.movetype = MOVETYPE_NONE;
        beam.shot_spread = 0;
        beam.bot_dodge = TRUE;
-       beam.bot_dodgerating = cvar("g_balance_electro_primary_damage");
+       beam.bot_dodgerating = autocvar_g_balance_electro_primary_damage;
        Net_LinkEntity(beam, FALSE, 0, lgbeam_send);
 
        oldself = self;
@@ -332,7 +332,7 @@ void w_electro_checkattack()
        {
                W_Electro_Attack2();
                self.electro_count -= 1;
-               weapon_thinkf(WFRAME_FIRE2, cvar("g_balance_electro_secondary_animtime"), w_electro_checkattack);
+               weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_electro_secondary_animtime, w_electro_checkattack);
                return;
        }
 
@@ -351,7 +351,7 @@ float w_electro(float req)
                        self.bot_secondary_electromooth = 0;
                if(self.bot_secondary_electromooth == 0)
                {
-                       if(bot_aim(cvar("g_balance_electro_primary_speed"), 0, cvar("g_balance_electro_primary_lifetime"), FALSE))
+                       if(bot_aim(autocvar_g_balance_electro_primary_speed, 0, autocvar_g_balance_electro_primary_lifetime, FALSE))
                        {
                                self.BUTTON_ATCK = TRUE;
                                if(random() < 0.01) self.bot_secondary_electromooth = 1;
@@ -359,7 +359,7 @@ float w_electro(float req)
                }
                else
                {
-                       if(bot_aim(cvar("g_balance_electro_secondary_speed"), cvar("g_balance_grenadelauncher_secondary_speed_up"), cvar("g_balance_electro_secondary_lifetime"), TRUE))
+                       if(bot_aim(autocvar_g_balance_electro_secondary_speed, autocvar_g_balance_grenadelauncher_secondary_speed_up, autocvar_g_balance_electro_secondary_lifetime, TRUE))
                        {
                                self.BUTTON_ATCK2 = TRUE;
                                if(random() < 0.03) self.bot_secondary_electromooth = 0;
@@ -370,9 +370,9 @@ float w_electro(float req)
        {
                if (self.BUTTON_ATCK)
                {
-                       if (weapon_prepareattack(0, (cvar("g_balance_electro_lightning") ? 0 : cvar("g_balance_electro_primary_refire"))))
+                       if (weapon_prepareattack(0, (autocvar_g_balance_electro_lightning ? 0 : autocvar_g_balance_electro_primary_refire)))
                        {
-                               if(cvar("g_balance_electro_lightning"))
+                               if(autocvar_g_balance_electro_lightning)
                                {
                                        if ((!self.lgbeam) || wasfreed(self.lgbeam))
                                        {
@@ -384,14 +384,14 @@ float w_electro(float req)
                                {
                                        W_Electro_Attack();
                                }
-                               weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_electro_primary_animtime"), w_ready);
+                               weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_electro_primary_animtime, w_ready);
                        }
                } else {
-                       if(cvar("g_balance_electro_lightning"))
+                       if(autocvar_g_balance_electro_lightning)
                        {
                                if (self.BUTTON_ATCK_prev != 0)
                                {
-                                       ATTACK_FINISHED(self) = time + cvar("g_balance_electro_primary_refire") * W_WeaponRateFactor();
+                                       ATTACK_FINISHED(self) = time + autocvar_g_balance_electro_primary_refire * W_WeaponRateFactor();
                                }
                                self.BUTTON_ATCK_prev = 0;
                        }
@@ -399,12 +399,12 @@ float w_electro(float req)
 
                if (self.BUTTON_ATCK2)
                if (time >= self.electro_secondarytime)
-               if (weapon_prepareattack(1, cvar("g_balance_electro_secondary_refire")))
+               if (weapon_prepareattack(1, autocvar_g_balance_electro_secondary_refire))
                {
                        W_Electro_Attack2();
-                       self.electro_count = cvar("g_balance_electro_secondary_count");
-                       weapon_thinkf(WFRAME_FIRE2, cvar("g_balance_electro_secondary_animtime"), w_electro_checkattack);
-                       self.electro_secondarytime = time + cvar("g_balance_electro_secondary_refire2");
+                       self.electro_count = autocvar_g_balance_electro_secondary_count;
+                       weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_electro_secondary_animtime, w_electro_checkattack);
+                       self.electro_secondarytime = time + autocvar_g_balance_electro_secondary_refire2;
                }
        }
        else if (req == WR_PRECACHE)
@@ -417,7 +417,7 @@ float w_electro(float req)
                precache_sound ("weapons/electro_fire2.wav");
                precache_sound ("weapons/electro_impact.wav");
                precache_sound ("weapons/electro_impact_combo.wav");
-               if(cvar("g_balance_electro_lightning"))
+               if(autocvar_g_balance_electro_lightning)
                {
                        precache_sound ("weapons/lgbeam_fire.wav");
                }
@@ -426,13 +426,13 @@ float w_electro(float req)
                weapon_setup(WEP_ELECTRO);
        else if (req == WR_CHECKAMMO1)
        {
-               if(cvar("g_balance_electro_lightning"))
-                       return !cvar("g_balance_electro_primary_ammo") || (self.ammo_cells > 0);
+               if(autocvar_g_balance_electro_lightning)
+                       return !autocvar_g_balance_electro_primary_ammo || (self.ammo_cells > 0);
                else
-                       return self.ammo_cells >= cvar("g_balance_electro_primary_ammo");
+                       return self.ammo_cells >= autocvar_g_balance_electro_primary_ammo;
        }
        else if (req == WR_CHECKAMMO2)
-               return self.ammo_cells >= cvar("g_balance_electro_secondary_ammo");
+               return self.ammo_cells >= autocvar_g_balance_electro_secondary_ammo;
        else if (req == WR_RESETPLAYER)
        {
                self.electro_secondarytime = time;
index b0ccd4e6d7ee61118537199a89788372bd343096..98b2b7f740470548d857e10d243b04959d1233ee 100644 (file)
@@ -19,15 +19,15 @@ void W_Fireball_Explode (void)
 
        // 1. dist damage
        d = (self.owner.health + self.owner.armorvalue);
-       RadiusDamage (self, self.realowner, cvar("g_balance_fireball_primary_damage"), cvar("g_balance_fireball_primary_edgedamage"), cvar("g_balance_fireball_primary_radius"), world, cvar("g_balance_fireball_primary_force"), self.projectiledeathtype, other);
+       RadiusDamage (self, self.realowner, autocvar_g_balance_fireball_primary_damage, autocvar_g_balance_fireball_primary_edgedamage, autocvar_g_balance_fireball_primary_radius, world, autocvar_g_balance_fireball_primary_force, self.projectiledeathtype, other);
        if(self.realowner.health + self.realowner.armorvalue >= d)
        if(!self.cnt)
        {
-               modeleffect_spawn("models/sphere/sphere.md3", 0, 0, self.origin, '0 0 0', '0 0 0', '0 0 0', 0, cvar("g_balance_fireball_primary_bfgradius"), 0.2, 0.05, 0.25);
+               modeleffect_spawn("models/sphere/sphere.md3", 0, 0, self.origin, '0 0 0', '0 0 0', '0 0 0', 0, autocvar_g_balance_fireball_primary_bfgradius, 0.2, 0.05, 0.25);
 
                // 2. bfg effect
                // NOTE: this cannot be made warpzone aware by design. So, better intentionally ignore warpzones here.
-               for(e = findradius(self.origin, cvar("g_balance_fireball_primary_bfgradius")); e; e = e.chain)
+               for(e = findradius(self.origin, autocvar_g_balance_fireball_primary_bfgradius); e; e = e.chain)
                if(e != self.owner) if(e.takedamage == DAMAGE_AIM) if(e.classname != "player" || !self.owner || IsDifferentTeam(e, self))
                {
                        // can we see fireball?
@@ -40,15 +40,15 @@ void W_Fireball_Explode (void)
                        if(/* trace_startsolid || */ trace_fraction != 1)
                                continue;
                        dist = vlen(self.origin - e.origin - e.view_ofs);
-                       points = (1 - sqrt(dist / cvar("g_balance_fireball_primary_bfgradius")));
+                       points = (1 - sqrt(dist / autocvar_g_balance_fireball_primary_bfgradius));
                        if(points <= 0)
                                continue;
                        dir = normalize(e.origin + e.view_ofs - self.origin);
 
                        if(accuracy_isgooddamage(self.realowner, e))
-                               accuracy_add(self.realowner, WEP_FIREBALL, 0, cvar("g_balance_fireball_primary_bfgdamage") * points);
+                               accuracy_add(self.realowner, WEP_FIREBALL, 0, autocvar_g_balance_fireball_primary_bfgdamage * points);
 
-                       Damage(e, self, self.realowner, cvar("g_balance_fireball_primary_bfgdamage") * points, self.projectiledeathtype | HITTYPE_BOUNCE | HITTYPE_SPLASH, e.origin + e.view_ofs, cvar("g_balance_fireball_primary_bfgforce") * dir);
+                       Damage(e, self, self.realowner, autocvar_g_balance_fireball_primary_bfgdamage * points, self.projectiledeathtype | HITTYPE_BOUNCE | HITTYPE_SPLASH, e.origin + e.view_ofs, autocvar_g_balance_fireball_primary_bfgforce * dir);
                        pointparticles(particleeffectnum("fireball_bfgdamage"), e.origin, -1 * dir, 1);
                }
        }
@@ -106,7 +106,7 @@ void W_Fireball_Think()
                return;
        }
 
-       W_Fireball_LaserPlay(0.1, cvar("g_balance_fireball_primary_laserradius"), cvar("g_balance_fireball_primary_laserdamage"), cvar("g_balance_fireball_primary_laseredgedamage"), cvar("g_balance_fireball_primary_laserburntime"));
+       W_Fireball_LaserPlay(0.1, autocvar_g_balance_fireball_primary_laserradius, autocvar_g_balance_fireball_primary_laserdamage, autocvar_g_balance_fireball_primary_laseredgedamage, autocvar_g_balance_fireball_primary_laserburntime);
 
        self.nextthink = time + 0.1;
 }
@@ -127,7 +127,7 @@ void W_Fireball_Attack1()
 {
        local entity proj;
 
-       W_SetupShot_ProjectileSize (self, '-16 -16 -16', '16 16 16', FALSE, 2, "weapons/fireball_fire2.wav", CHAN_WEAPON, cvar("g_balance_fireball_primary_damage") + cvar("g_balance_fireball_primary_bfgdamage"));
+       W_SetupShot_ProjectileSize (self, '-16 -16 -16', '16 16 16', FALSE, 2, "weapons/fireball_fire2.wav", CHAN_WEAPON, autocvar_g_balance_fireball_primary_damage + autocvar_g_balance_fireball_primary_bfgdamage);
 
        pointparticles(particleeffectnum("fireball_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
 
@@ -135,16 +135,16 @@ void W_Fireball_Attack1()
        proj.classname = "plasma_prim";
        proj.owner = proj.realowner = self;
        proj.bot_dodge = TRUE;
-       proj.bot_dodgerating = cvar("g_balance_fireball_primary_damage");
-       proj.pushltime = time + cvar("g_balance_fireball_primary_lifetime");
+       proj.bot_dodgerating = autocvar_g_balance_fireball_primary_damage;
+       proj.pushltime = time + autocvar_g_balance_fireball_primary_lifetime;
        proj.use = W_Fireball_Explode;
        proj.think = W_Fireball_Think;
        proj.nextthink = time;
-       proj.health = cvar("g_balance_fireball_primary_health");
+       proj.health = autocvar_g_balance_fireball_primary_health;
        proj.team = self.team;
        proj.event_damage = W_Fireball_Damage;
        proj.takedamage = DAMAGE_YES;
-       proj.damageforcescale = cvar("g_balance_fireball_primary_damageforcescale");
+       proj.damageforcescale = autocvar_g_balance_fireball_primary_damageforcescale;
        PROJECTILE_MAKETRIGGER(proj);
        proj.projectiledeathtype = WEP_FIREBALL;
        setorigin(proj, w_shotorg);
@@ -171,35 +171,35 @@ void W_Fireball_AttackEffect(float i, vector f_diff)
 void W_Fireball_Attack1_Frame4()
 {
        W_Fireball_Attack1();
-       weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_fireball_primary_animtime"), w_ready);
+       weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_fireball_primary_animtime, w_ready);
 }
 
 void W_Fireball_Attack1_Frame3()
 {
        W_Fireball_AttackEffect(0, '+1.25 +3.75 0');
-       weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_fireball_primary_animtime"), W_Fireball_Attack1_Frame4);
+       weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_fireball_primary_animtime, W_Fireball_Attack1_Frame4);
 }
 
 void W_Fireball_Attack1_Frame2()
 {
        W_Fireball_AttackEffect(0, '-1.25 +3.75 0');
-       weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_fireball_primary_animtime"), W_Fireball_Attack1_Frame3);
+       weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_fireball_primary_animtime, W_Fireball_Attack1_Frame3);
 }
 
 void W_Fireball_Attack1_Frame1()
 {
        W_Fireball_AttackEffect(1, '+1.25 -3.75 0');
-       weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_fireball_primary_animtime"), W_Fireball_Attack1_Frame2);
+       weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_fireball_primary_animtime, W_Fireball_Attack1_Frame2);
 }
 
 void W_Fireball_Attack1_Frame0()
 {
        if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
-               self.ammo_fuel = self.ammo_fuel - cvar("g_balance_fireball_primary_ammo");
+               self.ammo_fuel = self.ammo_fuel - autocvar_g_balance_fireball_primary_ammo;
 
        W_Fireball_AttackEffect(0, '-1.25 -3.75 0');
        sound (self, CHAN_WEAPON, "weapons/fireball_prefire2.wav", VOL_BASE, ATTN_NORM);
-       weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_fireball_primary_animtime"), W_Fireball_Attack1_Frame1);
+       weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_fireball_primary_animtime, W_Fireball_Attack1_Frame1);
 }
 
 void W_Firemine_Think()
@@ -213,7 +213,7 @@ void W_Firemine_Think()
        // make it "hot" once it leaves its owner
        if(self.owner)
        {
-               if(vlen(self.origin - self.owner.origin - self.owner.view_ofs) > cvar("g_balance_fireball_secondary_laserradius"))
+               if(vlen(self.origin - self.owner.origin - self.owner.view_ofs) > autocvar_g_balance_fireball_secondary_laserradius)
                {
                        self.cnt += 1;
                        if(self.cnt == 3)
@@ -223,7 +223,7 @@ void W_Firemine_Think()
                        self.cnt = 0;
        }
 
-       W_Fireball_LaserPlay(0.1, cvar("g_balance_fireball_secondary_laserradius"), cvar("g_balance_fireball_secondary_laserdamage"), cvar("g_balance_fireball_secondary_laseredgedamage"), cvar("g_balance_fireball_secondary_laserburntime"));
+       W_Fireball_LaserPlay(0.1, autocvar_g_balance_fireball_secondary_laserradius, autocvar_g_balance_fireball_secondary_laserdamage, autocvar_g_balance_fireball_secondary_laseredgedamage, autocvar_g_balance_fireball_secondary_laserburntime);
 
        self.nextthink = time + 0.1;
 }
@@ -232,7 +232,7 @@ void W_Firemine_Touch (void)
 {
        PROJECTILE_TOUCH;
        if (other.takedamage == DAMAGE_AIM)
-       if(Fire_AddDamage(other, self.realowner, cvar("g_balance_fireball_secondary_damage"), cvar("g_balance_fireball_secondary_damagetime"), self.projectiledeathtype | HITTYPE_HEADSHOT) >= 0)
+       if(Fire_AddDamage(other, self.realowner, autocvar_g_balance_fireball_secondary_damage, autocvar_g_balance_fireball_secondary_damagetime, self.projectiledeathtype | HITTYPE_HEADSHOT) >= 0)
        {
                remove(self);
                return;
@@ -247,7 +247,7 @@ void W_Fireball_Attack2()
        float c;
 
        if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
-               self.ammo_fuel = self.ammo_fuel - cvar("g_balance_fireball_secondary_ammo");
+               self.ammo_fuel = self.ammo_fuel - autocvar_g_balance_fireball_secondary_ammo;
 
        c = mod(self.bulletcounter, 4);
        switch(c)
@@ -266,7 +266,7 @@ void W_Fireball_Attack2()
                        f_diff = '+1.25 +3.75 0';
                        break;
        }
-       W_SetupShot_ProjectileSize(self, '-4 -4 -4', '4 4 4', FALSE, 2, "weapons/fireball_fire.wav", CHAN_WEAPON, cvar("g_balance_fireball_secondary_damage"));
+       W_SetupShot_ProjectileSize(self, '-4 -4 -4', '4 4 4', FALSE, 2, "weapons/fireball_fire.wav", CHAN_WEAPON, autocvar_g_balance_fireball_secondary_damage);
        traceline(w_shotorg, w_shotorg + f_diff_x * v_up + f_diff_y * v_right, MOVE_NORMAL, self);
        w_shotorg = trace_endpos;
 
@@ -276,7 +276,7 @@ void W_Fireball_Attack2()
        proj.owner = proj.realowner = self;
        proj.classname = "grenade";
        proj.bot_dodge = TRUE;
-       proj.bot_dodgerating = cvar("g_balance_fireball_secondary_damage");
+       proj.bot_dodgerating = autocvar_g_balance_fireball_secondary_damage;
        proj.movetype = MOVETYPE_BOUNCE;
        proj.projectiledeathtype = WEP_FIREBALL | HITTYPE_SECONDARY;
        proj.touch = W_Firemine_Touch;
@@ -285,8 +285,8 @@ void W_Fireball_Attack2()
        setorigin(proj, w_shotorg);
        proj.think = W_Firemine_Think;
        proj.nextthink = time;
-       proj.damageforcescale = cvar("g_balance_fireball_secondary_damageforcescale");
-       proj.pushltime = time + cvar("g_balance_fireball_secondary_lifetime");
+       proj.damageforcescale = autocvar_g_balance_fireball_secondary_damageforcescale;
+       proj.pushltime = time + autocvar_g_balance_fireball_secondary_lifetime;
        W_SETUPPROJECTILEVELOCITY_UP(proj, g_balance_fireball_secondary);
 
        proj.angles = vectoangles(proj.velocity);
@@ -310,7 +310,7 @@ float w_fireball(float req)
                self.BUTTON_ATCK2 = FALSE;
                if (self.bot_primary_fireballmooth == 0)
                {
-                       if(bot_aim(cvar("g_balance_fireball_primary_speed"), 0, cvar("g_balance_fireball_primary_lifetime"), FALSE))
+                       if(bot_aim(autocvar_g_balance_fireball_primary_speed, 0, autocvar_g_balance_fireball_primary_lifetime, FALSE))
                        {
                                self.BUTTON_ATCK = TRUE;
                                if(random() < 0.02) self.bot_primary_fireballmooth = 0;
@@ -318,7 +318,7 @@ float w_fireball(float req)
                }
                else
                {
-                       if(bot_aim(cvar("g_balance_fireball_secondary_speed"), cvar("g_balance_fireball_secondary_speed_up"), cvar("g_balance_fireball_secondary_lifetime"), TRUE))
+                       if(bot_aim(autocvar_g_balance_fireball_secondary_speed, autocvar_g_balance_fireball_secondary_speed_up, autocvar_g_balance_fireball_secondary_lifetime, TRUE))
                        {
                                self.BUTTON_ATCK2 = TRUE;
                                if(random() < 0.01) self.bot_primary_fireballmooth = 1;
@@ -329,16 +329,16 @@ float w_fireball(float req)
        {
                if (self.BUTTON_ATCK)
                if (time >= self.fireball_primarytime)
-               if (weapon_prepareattack(0, cvar("g_balance_fireball_primary_refire")))
+               if (weapon_prepareattack(0, autocvar_g_balance_fireball_primary_refire))
                {
                        W_Fireball_Attack1_Frame0();
-                       self.fireball_primarytime = time + cvar("g_balance_fireball_primary_refire2");
+                       self.fireball_primarytime = time + autocvar_g_balance_fireball_primary_refire2;
                }
                if (self.BUTTON_ATCK2)
-               if (weapon_prepareattack(1, cvar("g_balance_fireball_secondary_refire")))
+               if (weapon_prepareattack(1, autocvar_g_balance_fireball_secondary_refire))
                {
                        W_Fireball_Attack2();
-                       weapon_thinkf(WFRAME_FIRE2, cvar("g_balance_fireball_secondary_animtime"), w_ready);
+                       weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_fireball_secondary_animtime, w_ready);
                }
        }
        else if (req == WR_PRECACHE)
@@ -354,9 +354,9 @@ float w_fireball(float req)
        else if (req == WR_SETUP)
                weapon_setup(WEP_FIREBALL);
        else if (req == WR_CHECKAMMO1)
-               return self.ammo_fuel >= cvar("g_balance_fireball_primary_ammo");
+               return self.ammo_fuel >= autocvar_g_balance_fireball_primary_ammo;
        else if (req == WR_CHECKAMMO2)
-               return self.ammo_fuel >= cvar("g_balance_fireball_secondary_ammo");
+               return self.ammo_fuel >= autocvar_g_balance_fireball_secondary_ammo;
        else if (req == WR_RESETPLAYER)
        {
                self.fireball_primarytime = time;
index cab8f49505c927d15a6325879a71c36e35191aa0..b46c091ce500bdb486b1a4d751dcbd0fc548f825 100644 (file)
@@ -20,7 +20,7 @@ void W_Grenade_Explode (void)
        if(self.movetype == MOVETYPE_NONE)
                self.velocity = self.oldvelocity;
 
-       RadiusDamage (self, self.owner, cvar("g_balance_grenadelauncher_primary_damage"), cvar("g_balance_grenadelauncher_primary_edgedamage"), cvar("g_balance_grenadelauncher_primary_radius"), world, cvar("g_balance_grenadelauncher_primary_force"), self.projectiledeathtype, other);
+       RadiusDamage (self, self.owner, autocvar_g_balance_grenadelauncher_primary_damage, autocvar_g_balance_grenadelauncher_primary_edgedamage, autocvar_g_balance_grenadelauncher_primary_radius, world, autocvar_g_balance_grenadelauncher_primary_force, self.projectiledeathtype, other);
 
        remove (self);
 }
@@ -39,7 +39,7 @@ void W_Grenade_Explode2 (void)
        if(self.movetype == MOVETYPE_NONE)
                self.velocity = self.oldvelocity;
 
-       RadiusDamage (self, self.owner, cvar("g_balance_grenadelauncher_secondary_damage"), cvar("g_balance_grenadelauncher_secondary_edgedamage"), cvar("g_balance_grenadelauncher_secondary_radius"), world, cvar("g_balance_grenadelauncher_secondary_force"), self.projectiledeathtype, other);
+       RadiusDamage (self, self.owner, autocvar_g_balance_grenadelauncher_secondary_damage, autocvar_g_balance_grenadelauncher_secondary_edgedamage, autocvar_g_balance_grenadelauncher_secondary_radius, world, autocvar_g_balance_grenadelauncher_secondary_force, self.projectiledeathtype, other);
 
        remove (self);
 }
@@ -65,18 +65,18 @@ void W_Grenade_Think1 (void)
                W_Grenade_Explode ();
                return;
        }
-       if(self.gl_detonate_later && self.gl_bouncecnt >= cvar("g_balance_grenadelauncher_primary_remote_minbouncecnt"))
+       if(self.gl_detonate_later && self.gl_bouncecnt >= autocvar_g_balance_grenadelauncher_primary_remote_minbouncecnt)
                W_Grenade_Explode();
 }
 
 void W_Grenade_Touch1 (void)
 {
        PROJECTILE_TOUCH;
-       if (other.takedamage == DAMAGE_AIM || cvar("g_balance_grenadelauncher_primary_type") == 0) // always explode when hitting a player, or if normal mortar projectile
+       if (other.takedamage == DAMAGE_AIM || autocvar_g_balance_grenadelauncher_primary_type == 0) // always explode when hitting a player, or if normal mortar projectile
        {
                self.use ();
        }
-       else if (cvar("g_balance_grenadelauncher_primary_type") == 1) // bounce
+       else if (autocvar_g_balance_grenadelauncher_primary_type == 1) // bounce
        {
                float r;
                r = random() * 6;
@@ -95,7 +95,7 @@ void W_Grenade_Touch1 (void)
                self.projectiledeathtype |= HITTYPE_BOUNCE;
                self.gl_bouncecnt += 1;
        }
-       else if(cvar("g_balance_grenadelauncher_primary_type") == 2 && (!other || (other.takedamage != DAMAGE_AIM && other.movetype == MOVETYPE_NONE))) // stick
+       else if(autocvar_g_balance_grenadelauncher_primary_type == 2 && (!other || (other.takedamage != DAMAGE_AIM && other.movetype == MOVETYPE_NONE))) // stick
        {
                spamsound (self, CHAN_PROJECTILE, "weapons/grenade_stick.wav", VOL_BASE, ATTN_NORM);
 
@@ -109,18 +109,18 @@ void W_Grenade_Touch1 (void)
                // do not respond to any more touches
                self.solid = SOLID_NOT;
 
-               self.nextthink = min(self.nextthink, time + cvar("g_balance_grenadelauncher_primary_lifetime2"));
+               self.nextthink = min(self.nextthink, time + autocvar_g_balance_grenadelauncher_primary_lifetime2);
        }
 }
 
 void W_Grenade_Touch2 (void)
 {
        PROJECTILE_TOUCH;
-       if (other.takedamage == DAMAGE_AIM || cvar("g_balance_grenadelauncher_secondary_type") == 0) // always explode when hitting a player, or if normal mortar projectile
+       if (other.takedamage == DAMAGE_AIM || autocvar_g_balance_grenadelauncher_secondary_type == 0) // always explode when hitting a player, or if normal mortar projectile
        {
                self.use ();
        }
-       else if (cvar("g_balance_grenadelauncher_secondary_type") == 1) // bounce
+       else if (autocvar_g_balance_grenadelauncher_secondary_type == 1) // bounce
        {
                float r;
                r = random() * 6;
@@ -139,7 +139,7 @@ void W_Grenade_Touch2 (void)
                self.projectiledeathtype |= HITTYPE_BOUNCE;
                self.gl_bouncecnt += 1;
        }
-       else if(cvar("g_balance_grenadelauncher_secondary_type") == 2 && (!other || (other.takedamage != DAMAGE_AIM && other.movetype == MOVETYPE_NONE))) // stick
+       else if(autocvar_g_balance_grenadelauncher_secondary_type == 2 && (!other || (other.takedamage != DAMAGE_AIM && other.movetype == MOVETYPE_NONE))) // stick
        {
                spamsound (self, CHAN_PROJECTILE, "weapons/grenade_stick.wav", VOL_BASE, ATTN_NORM);
 
@@ -153,7 +153,7 @@ void W_Grenade_Touch2 (void)
                // do not respond to any more touches
                self.solid = SOLID_NOT;
 
-               self.nextthink = min(self.nextthink, time + cvar("g_balance_grenadelauncher_secondary_lifetime2"));
+               self.nextthink = min(self.nextthink, time + autocvar_g_balance_grenadelauncher_secondary_lifetime2);
        }
 }
 
@@ -162,8 +162,8 @@ void W_Grenade_Attack (void)
        local entity gren;
 
        if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
-               self.ammo_rockets = self.ammo_rockets - cvar("g_balance_grenadelauncher_primary_ammo");
-       W_SetupShot_ProjectileSize (self, '-3 -3 -3', '3 3 3', FALSE, 4, "weapons/grenade_fire.wav", CHAN_WEAPON, cvar("g_balance_grenadelauncher_primary_damage"));
+               self.ammo_rockets = self.ammo_rockets - autocvar_g_balance_grenadelauncher_primary_ammo;
+       W_SetupShot_ProjectileSize (self, '-3 -3 -3', '3 3 3', FALSE, 4, "weapons/grenade_fire.wav", CHAN_WEAPON, autocvar_g_balance_grenadelauncher_primary_damage);
        w_shotdir = v_forward; // no TrueAim for grenades please
 
        pointparticles(particleeffectnum("grenadelauncher_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
@@ -172,31 +172,31 @@ void W_Grenade_Attack (void)
        gren.owner = self;
        gren.classname = "grenade";
        gren.bot_dodge = TRUE;
-       gren.bot_dodgerating = cvar("g_balance_grenadelauncher_primary_damage");
+       gren.bot_dodgerating = autocvar_g_balance_grenadelauncher_primary_damage;
        gren.movetype = MOVETYPE_BOUNCE;
-       gren.bouncefactor = cvar("g_balance_grenadelauncher_bouncefactor");
-       gren.bouncestop = cvar("g_balance_grenadelauncher_bouncestop");
+       gren.bouncefactor = autocvar_g_balance_grenadelauncher_bouncefactor;
+       gren.bouncestop = autocvar_g_balance_grenadelauncher_bouncestop;
        PROJECTILE_MAKETRIGGER(gren);
        gren.projectiledeathtype = WEP_GRENADE_LAUNCHER;
        setorigin(gren, w_shotorg);
        setsize(gren, '-3 -3 -3', '3 3 3');
 
-       gren.cnt = time + cvar("g_balance_grenadelauncher_primary_lifetime");
+       gren.cnt = time + autocvar_g_balance_grenadelauncher_primary_lifetime;
        gren.nextthink = time;
        gren.think = W_Grenade_Think1;
        gren.use = W_Grenade_Explode;
        gren.touch = W_Grenade_Touch1;
 
        gren.takedamage = DAMAGE_YES;
-       gren.health = cvar("g_balance_grenadelauncher_primary_health");
-       gren.damageforcescale = cvar("g_balance_grenadelauncher_primary_damageforcescale");
+       gren.health = autocvar_g_balance_grenadelauncher_primary_health;
+       gren.damageforcescale = autocvar_g_balance_grenadelauncher_primary_damageforcescale;
        gren.event_damage = W_Grenade_Damage;
        W_SETUPPROJECTILEVELOCITY_UP(gren, g_balance_grenadelauncher_primary);
 
        gren.angles = vectoangles (gren.velocity);
        gren.flags = FL_PROJECTILE;
 
-       if(cvar("g_balance_grenadelauncher_primary_type") == 0 || cvar("g_balance_grenadelauncher_primary_type") == 2)
+       if(autocvar_g_balance_grenadelauncher_primary_type == 0 || autocvar_g_balance_grenadelauncher_primary_type == 2)
                CSQCProjectile(gren, TRUE, PROJECTILE_GRENADE, TRUE);
        else
                CSQCProjectile(gren, TRUE, PROJECTILE_GRENADE_BOUNCING, TRUE);
@@ -209,8 +209,8 @@ void W_Grenade_Attack2 (void)
        local entity gren;
 
        if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
-               self.ammo_rockets = self.ammo_rockets - cvar("g_balance_grenadelauncher_secondary_ammo");
-       W_SetupShot_ProjectileSize (self, '-3 -3 -3', '3 3 3', FALSE, 4, "weapons/grenade_fire.wav", CHAN_WEAPON, cvar("g_balance_grenadelauncher_secondary_damage"));
+               self.ammo_rockets = self.ammo_rockets - autocvar_g_balance_grenadelauncher_secondary_ammo;
+       W_SetupShot_ProjectileSize (self, '-3 -3 -3', '3 3 3', FALSE, 4, "weapons/grenade_fire.wav", CHAN_WEAPON, autocvar_g_balance_grenadelauncher_secondary_damage);
        w_shotdir = v_forward; // no TrueAim for grenades please
 
        pointparticles(particleeffectnum("grenadelauncher_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
@@ -219,30 +219,30 @@ void W_Grenade_Attack2 (void)
        gren.owner = self;
        gren.classname = "grenade";
        gren.bot_dodge = TRUE;
-       gren.bot_dodgerating = cvar("g_balance_grenadelauncher_secondary_damage");
+       gren.bot_dodgerating = autocvar_g_balance_grenadelauncher_secondary_damage;
        gren.movetype = MOVETYPE_BOUNCE;
-       gren.bouncefactor = cvar("g_balance_grenadelauncher_bouncefactor");
-       gren.bouncestop = cvar("g_balance_grenadelauncher_bouncestop");
+       gren.bouncefactor = autocvar_g_balance_grenadelauncher_bouncefactor;
+       gren.bouncestop = autocvar_g_balance_grenadelauncher_bouncestop;
        PROJECTILE_MAKETRIGGER(gren);
        gren.projectiledeathtype = WEP_GRENADE_LAUNCHER | HITTYPE_SECONDARY;
        setorigin(gren, w_shotorg);
        setsize(gren, '-3 -3 -3', '3 3 3');
 
-       gren.nextthink = time + cvar("g_balance_grenadelauncher_secondary_lifetime");
+       gren.nextthink = time + autocvar_g_balance_grenadelauncher_secondary_lifetime;
        gren.think = adaptor_think2use_hittype_splash;
        gren.use = W_Grenade_Explode2;
        gren.touch = W_Grenade_Touch2;
 
        gren.takedamage = DAMAGE_YES;
-       gren.health = cvar("g_balance_grenadelauncher_secondary_health");
-       gren.damageforcescale = cvar("g_balance_grenadelauncher_secondary_damageforcescale");
+       gren.health = autocvar_g_balance_grenadelauncher_secondary_health;
+       gren.damageforcescale = autocvar_g_balance_grenadelauncher_secondary_damageforcescale;
        gren.event_damage = W_Grenade_Damage;
        W_SETUPPROJECTILEVELOCITY_UP(gren, g_balance_grenadelauncher_secondary);
 
        gren.angles = vectoangles (gren.velocity);
        gren.flags = FL_PROJECTILE;
 
-       if(cvar("g_balance_grenadelauncher_secondary_type") == 0 || cvar("g_balance_grenadelauncher_secondary_type") == 2)
+       if(autocvar_g_balance_grenadelauncher_secondary_type == 0 || autocvar_g_balance_grenadelauncher_secondary_type == 2)
                CSQCProjectile(gren, TRUE, PROJECTILE_GRENADE, TRUE);
        else
                CSQCProjectile(gren, TRUE, PROJECTILE_GRENADE_BOUNCING, TRUE);
@@ -267,7 +267,7 @@ float w_glauncher(float req)
                self.BUTTON_ATCK2 = FALSE;
                if (self.bot_secondary_grenademooth == 0)
                {
-                       if(bot_aim(cvar("g_balance_grenadelauncher_primary_speed"), cvar("g_balance_grenadelauncher_primary_speed_up"), cvar("g_balance_grenadelauncher_primary_lifetime"), TRUE))
+                       if(bot_aim(autocvar_g_balance_grenadelauncher_primary_speed, autocvar_g_balance_grenadelauncher_primary_speed_up, autocvar_g_balance_grenadelauncher_primary_lifetime, TRUE))
                        {
                                self.BUTTON_ATCK = TRUE;
                                if(random() < 0.01) self.bot_secondary_grenademooth = 1;
@@ -275,7 +275,7 @@ float w_glauncher(float req)
                }
                else
                {
-                       if(bot_aim(cvar("g_balance_grenadelauncher_secondary_speed"), cvar("g_balance_grenadelauncher_secondary_speed_up"), cvar("g_balance_grenadelauncher_secondary_lifetime"), TRUE))
+                       if(bot_aim(autocvar_g_balance_grenadelauncher_secondary_speed, autocvar_g_balance_grenadelauncher_secondary_speed_up, autocvar_g_balance_grenadelauncher_secondary_lifetime, TRUE))
                        {
                                self.BUTTON_ATCK2 = TRUE;
                                if(random() < 0.02) self.bot_secondary_grenademooth = 0;
@@ -285,10 +285,10 @@ float w_glauncher(float req)
        else if (req == WR_THINK)
        {
                if (self.BUTTON_ATCK)
-               if (weapon_prepareattack(0, cvar("g_balance_grenadelauncher_primary_refire")))
+               if (weapon_prepareattack(0, autocvar_g_balance_grenadelauncher_primary_refire))
                {
                        W_Grenade_Attack();
-                       weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_grenadelauncher_primary_animtime"), w_ready);
+                       weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_grenadelauncher_primary_animtime, w_ready);
                }
                if (self.BUTTON_ATCK2)
                {
@@ -306,10 +306,10 @@ float w_glauncher(float req)
                                if(nadefound)
                                        sound (self, CHAN_WEAPON2, "weapons/rocket_det.wav", VOL_BASE, ATTN_NORM);
                        }
-                       else if (weapon_prepareattack(1, cvar("g_balance_grenadelauncher_secondary_refire")))
+                       else if (weapon_prepareattack(1, autocvar_g_balance_grenadelauncher_secondary_refire))
                        {
                                W_Grenade_Attack2();
-                               weapon_thinkf(WFRAME_FIRE2, cvar("g_balance_grenadelauncher_secondary_animtime"), w_ready);
+                               weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_grenadelauncher_secondary_animtime, w_ready);
                        }
                }
        }
@@ -330,9 +330,9 @@ float w_glauncher(float req)
        else if (req == WR_SETUP)
                weapon_setup(WEP_GRENADE_LAUNCHER);
        else if (req == WR_CHECKAMMO1)
-               return self.ammo_rockets >= cvar("g_balance_grenadelauncher_primary_ammo");
+               return self.ammo_rockets >= autocvar_g_balance_grenadelauncher_primary_ammo;
        else if (req == WR_CHECKAMMO2)
-               return self.ammo_rockets >= cvar("g_balance_grenadelauncher_secondary_ammo");
+               return self.ammo_rockets >= autocvar_g_balance_grenadelauncher_secondary_ammo;
        return TRUE;
 };
 #endif
index d5b2592e2ed34fe1ea9f8e003fc04764ccc8e649..472a1e0d5154c8870c141d4466804be75ccc47d5 100644 (file)
@@ -6,7 +6,7 @@ REGISTER_WEAPON(HAGAR, w_hagar, IT_ROCKETS, 8, WEP_FLAG_NORMAL | WEP_FLAG_CANCLI
 void W_Hagar_Explode (void)
 {
        self.event_damage = SUB_Null;
-       RadiusDamage (self, self.realowner, cvar("g_balance_hagar_primary_damage"), cvar("g_balance_hagar_primary_edgedamage"), cvar("g_balance_hagar_primary_radius"), world, cvar("g_balance_hagar_primary_force"), self.projectiledeathtype, other);
+       RadiusDamage (self, self.realowner, autocvar_g_balance_hagar_primary_damage, autocvar_g_balance_hagar_primary_edgedamage, autocvar_g_balance_hagar_primary_radius, world, autocvar_g_balance_hagar_primary_force, self.projectiledeathtype, other);
 
        remove (self);
 }
@@ -14,7 +14,7 @@ void W_Hagar_Explode (void)
 void W_Hagar_Explode2 (void)
 {
        self.event_damage = SUB_Null;
-       RadiusDamage (self, self.realowner, cvar("g_balance_hagar_secondary_damage"), cvar("g_balance_hagar_secondary_edgedamage"), cvar("g_balance_hagar_secondary_radius"), world, cvar("g_balance_hagar_secondary_force"), self.projectiledeathtype, other);
+       RadiusDamage (self, self.realowner, autocvar_g_balance_hagar_secondary_damage, autocvar_g_balance_hagar_secondary_edgedamage, autocvar_g_balance_hagar_secondary_radius, world, autocvar_g_balance_hagar_secondary_force, self.projectiledeathtype, other);
 
        remove (self);
 }
@@ -45,8 +45,8 @@ void W_Hagar_Attack (void)
        local entity missile;
 
        if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
-               self.ammo_rockets = self.ammo_rockets - cvar("g_balance_hagar_primary_ammo");
-       W_SetupShot (self, FALSE, 2, "weapons/hagar_fire.wav", CHAN_WEAPON, cvar("g_balance_hagar_primary_damage"));
+               self.ammo_rockets = self.ammo_rockets - autocvar_g_balance_hagar_primary_ammo;
+       W_SetupShot (self, FALSE, 2, "weapons/hagar_fire.wav", CHAN_WEAPON, autocvar_g_balance_hagar_primary_damage);
 
        pointparticles(particleeffectnum("hagar_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
 
@@ -54,11 +54,11 @@ void W_Hagar_Attack (void)
        missile.owner = missile.realowner = self;
        missile.classname = "missile";
        missile.bot_dodge = TRUE;
-       missile.bot_dodgerating = cvar("g_balance_hagar_primary_damage");
+       missile.bot_dodgerating = autocvar_g_balance_hagar_primary_damage;
        missile.touch = W_Hagar_Touch;
        missile.use = W_Hagar_Explode;
        missile.think = adaptor_think2use_hittype_splash;
-       missile.nextthink = time + cvar("g_balance_hagar_primary_lifetime");
+       missile.nextthink = time + autocvar_g_balance_hagar_primary_lifetime;
        PROJECTILE_MAKETRIGGER(missile);
        missile.projectiledeathtype = WEP_HAGAR;
        setorigin (missile, w_shotorg);
@@ -80,8 +80,8 @@ void W_Hagar_Attack2 (void)
        local entity missile;
 
        if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
-               self.ammo_rockets = self.ammo_rockets - cvar("g_balance_hagar_secondary_ammo");
-       W_SetupShot (self, FALSE, 2, "weapons/hagar_fire.wav", CHAN_WEAPON, cvar("g_balance_hagar_secondary_damage"));
+               self.ammo_rockets = self.ammo_rockets - autocvar_g_balance_hagar_secondary_ammo;
+       W_SetupShot (self, FALSE, 2, "weapons/hagar_fire.wav", CHAN_WEAPON, autocvar_g_balance_hagar_secondary_damage);
 
        pointparticles(particleeffectnum("hagar_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
 
@@ -89,12 +89,12 @@ void W_Hagar_Attack2 (void)
        missile.owner = missile.realowner = self;
        missile.classname = "missile";
        missile.bot_dodge = TRUE;
-       missile.bot_dodgerating = cvar("g_balance_hagar_secondary_damage");
+       missile.bot_dodgerating = autocvar_g_balance_hagar_secondary_damage;
        missile.touch = W_Hagar_Touch2;
        missile.cnt = 0;
        missile.use = W_Hagar_Explode2;
        missile.think = adaptor_think2use_hittype_splash;
-       missile.nextthink = time + cvar("g_balance_hagar_secondary_lifetime_min") + random() * cvar("g_balance_hagar_secondary_lifetime_rand");
+       missile.nextthink = time + autocvar_g_balance_hagar_secondary_lifetime_min + random() * autocvar_g_balance_hagar_secondary_lifetime_rand;
        PROJECTILE_MAKETRIGGER(missile);
        missile.projectiledeathtype = WEP_HAGAR | HITTYPE_SECONDARY;
        setorigin (missile, w_shotorg);
@@ -120,25 +120,25 @@ float w_hagar(float req)
 {
        if (req == WR_AIM)
                if (random()>0.15)
-                       self.BUTTON_ATCK = bot_aim(cvar("g_balance_hagar_primary_speed"), 0, cvar("g_balance_hagar_primary_lifetime"), FALSE);
+                       self.BUTTON_ATCK = bot_aim(autocvar_g_balance_hagar_primary_speed, 0, autocvar_g_balance_hagar_primary_lifetime, FALSE);
                else
                {
                        // not using secondary_speed since these are only 15% and should cause some ricochets without re-aiming
-                       self.BUTTON_ATCK2 = bot_aim(cvar("g_balance_hagar_primary_speed"), 0, cvar("g_balance_hagar_primary_lifetime"), FALSE);
+                       self.BUTTON_ATCK2 = bot_aim(autocvar_g_balance_hagar_primary_speed, 0, autocvar_g_balance_hagar_primary_lifetime, FALSE);
                }
        else if (req == WR_THINK)
        {
                if (self.BUTTON_ATCK)
-               if (weapon_prepareattack(0, cvar("g_balance_hagar_primary_refire")))
+               if (weapon_prepareattack(0, autocvar_g_balance_hagar_primary_refire))
                {
                        W_Hagar_Attack();
-                       weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_hagar_primary_refire"), w_ready);
+                       weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_hagar_primary_refire, w_ready);
                }
-               if (self.BUTTON_ATCK2 && cvar("g_balance_hagar_secondary"))
-               if (weapon_prepareattack(1, cvar("g_balance_hagar_secondary_refire")))
+               if (self.BUTTON_ATCK2 && autocvar_g_balance_hagar_secondary)
+               if (weapon_prepareattack(1, autocvar_g_balance_hagar_secondary_refire))
                {
                        W_Hagar_Attack2();
-                       weapon_thinkf(WFRAME_FIRE2, cvar("g_balance_hagar_secondary_refire"), w_ready);
+                       weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_hagar_secondary_refire, w_ready);
                }
        }
        else if (req == WR_PRECACHE)
@@ -151,9 +151,9 @@ float w_hagar(float req)
        else if (req == WR_SETUP)
                weapon_setup(WEP_HAGAR);
        else if (req == WR_CHECKAMMO1)
-               return self.ammo_rockets >= cvar("g_balance_hagar_primary_ammo");
+               return self.ammo_rockets >= autocvar_g_balance_hagar_primary_ammo;
        else if (req == WR_CHECKAMMO2)
-               return self.ammo_rockets >= cvar("g_balance_hagar_secondary_ammo");
+               return self.ammo_rockets >= autocvar_g_balance_hagar_secondary_ammo;
        return TRUE;
 };
 #endif
index a92727fbeec7024c21f7a749e939a676ca53a845..e3d3cb991883e1f209cb666712a89a3110f3693e 100644 (file)
@@ -9,7 +9,7 @@ void W_HLAC_Touch (void)
 
        self.event_damage = SUB_Null;
 
-    RadiusDamage (self, self.owner, cvar("g_balance_hlac_primary_damage"), cvar("g_balance_hlac_primary_edgedamage"), cvar("g_balance_hlac_primary_radius"), world, cvar("g_balance_hlac_primary_force"), self.projectiledeathtype, other);
+    RadiusDamage (self, self.owner, autocvar_g_balance_hlac_primary_damage, autocvar_g_balance_hlac_primary_edgedamage, autocvar_g_balance_hlac_primary_radius, world, autocvar_g_balance_hlac_primary_force, self.projectiledeathtype, other);
 
        remove (self);
 }
@@ -20,7 +20,7 @@ void W_HLAC_Touch2 (void)
 
        self.event_damage = SUB_Null;
 
-    RadiusDamage (self, self.owner, cvar("g_balance_hlac_secondary_damage"), cvar("g_balance_hlac_secondary_edgedamage"), cvar("g_balance_hlac_secondary_radius"), world, cvar("g_balance_hlac_secondary_force"), self.projectiledeathtype, other);
+    RadiusDamage (self, self.owner, autocvar_g_balance_hlac_secondary_damage, autocvar_g_balance_hlac_secondary_edgedamage, autocvar_g_balance_hlac_secondary_radius, world, autocvar_g_balance_hlac_secondary_force, self.projectiledeathtype, other);
 
        remove (self);
 }
@@ -32,15 +32,15 @@ void W_HLAC_Attack (void)
 
     if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
     {
-        self.ammo_cells = self.ammo_cells - cvar("g_balance_hlac_primary_ammo");
+        self.ammo_cells = self.ammo_cells - autocvar_g_balance_hlac_primary_ammo;
     }
 
-    spread = cvar("g_balance_hlac_primary_spread_min") + (cvar("g_balance_hlac_primary_spread_add") * self.HLAC_bulletcounter);
-    spread = min(spread,cvar("g_balance_hlac_primary_spread_max"));
+    spread = autocvar_g_balance_hlac_primary_spread_min + (autocvar_g_balance_hlac_primary_spread_add * self.HLAC_bulletcounter);
+    spread = min(spread,autocvar_g_balance_hlac_primary_spread_max);
     if(self.crouch)
-        spread = spread * cvar("g_balance_hlac_primary_spread_crouchmod");
+        spread = spread * autocvar_g_balance_hlac_primary_spread_crouchmod;
 
-       W_SetupShot (self, FALSE, 3, "weapons/lasergun_fire.wav", CHAN_WEAPON, cvar("g_balance_hlac_primary_damage"));
+       W_SetupShot (self, FALSE, 3, "weapons/lasergun_fire.wav", CHAN_WEAPON, autocvar_g_balance_hlac_primary_damage);
        pointparticles(particleeffectnum("laser_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
        if (!g_norecoil)
        {
@@ -54,7 +54,7 @@ void W_HLAC_Attack (void)
        // missile.dmg = issecondary;
        missile.bot_dodge = TRUE;
 
-    missile.bot_dodgerating = cvar("g_balance_hlac_primary_damage");
+    missile.bot_dodgerating = autocvar_g_balance_hlac_primary_damage;
 
        missile.movetype = MOVETYPE_FLY;
        PROJECTILE_MAKETRIGGER(missile);
@@ -62,13 +62,13 @@ void W_HLAC_Attack (void)
        setorigin (missile, w_shotorg);
        setsize(missile, '0 0 0', '0 0 0');
 
-       W_SetupProjectileVelocity(missile, cvar("g_balance_hlac_primary_speed"), spread);
+       W_SetupProjectileVelocity(missile, autocvar_g_balance_hlac_primary_speed, spread);
        missile.angles = vectoangles (missile.velocity);
 
        missile.touch = W_HLAC_Touch;
        missile.think = SUB_Remove;
 
-    missile.nextthink = time + cvar("g_balance_hlac_primary_lifetime");
+    missile.nextthink = time + autocvar_g_balance_hlac_primary_lifetime;
 
        missile.flags = FL_PROJECTILE;
        missile.projectiledeathtype = WEP_HLAC;
@@ -83,13 +83,13 @@ void W_HLAC_Attack2f (void)
        local entity missile;
     float spread;
 
-    spread = cvar("g_balance_hlac_secondary_spread");
+    spread = autocvar_g_balance_hlac_secondary_spread;
 
 
     if(self.crouch)
-        spread = spread * cvar("g_balance_hlac_secondary_spread_crouchmod");
+        spread = spread * autocvar_g_balance_hlac_secondary_spread_crouchmod;
 
-       W_SetupShot (self, FALSE, 3, "weapons/lasergun_fire.wav", CHAN_WEAPON, cvar("g_balance_hlac_secondary_damage"));
+       W_SetupShot (self, FALSE, 3, "weapons/lasergun_fire.wav", CHAN_WEAPON, autocvar_g_balance_hlac_secondary_damage);
        pointparticles(particleeffectnum("laser_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
 
        missile = spawn ();
@@ -98,7 +98,7 @@ void W_HLAC_Attack2f (void)
        // missile.dmg = issecondary;
        missile.bot_dodge = TRUE;
 
-    missile.bot_dodgerating = cvar("g_balance_hlac_secondary_damage");
+    missile.bot_dodgerating = autocvar_g_balance_hlac_secondary_damage;
 
        missile.movetype = MOVETYPE_FLY;
        PROJECTILE_MAKETRIGGER(missile);
@@ -106,13 +106,13 @@ void W_HLAC_Attack2f (void)
        setorigin (missile, w_shotorg);
        setsize(missile, '0 0 0', '0 0 0');
 
-       W_SetupProjectileVelocity(missile, cvar("g_balance_hlac_secondary_speed"), spread);
+       W_SetupProjectileVelocity(missile, autocvar_g_balance_hlac_secondary_speed, spread);
        missile.angles = vectoangles (missile.velocity);
 
        missile.touch = W_HLAC_Touch2;
        missile.think = SUB_Remove;
 
-    missile.nextthink = time + cvar("g_balance_hlac_secondary_lifetime");
+    missile.nextthink = time + autocvar_g_balance_hlac_secondary_lifetime;
 
        missile.flags = FL_PROJECTILE;
        missile.projectiledeathtype = WEP_HLAC | HITTYPE_SECONDARY;
@@ -128,10 +128,10 @@ void W_HLAC_Attack2 (void)
 
     if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
     {
-        self.ammo_cells = self.ammo_cells - cvar("g_balance_hlac_secondary_ammo");
+        self.ammo_cells = self.ammo_cells - autocvar_g_balance_hlac_secondary_ammo;
     }
 
-    for(i=cvar("g_balance_hlac_secondary_shots");i>0;--i)
+    for(i=autocvar_g_balance_hlac_secondary_shots;i>0;--i)
         W_HLAC_Attack2f();
 
        if (!g_norecoil)
@@ -159,14 +159,14 @@ void HLAC_fire1_02()
                        return;
                }
 
-               ATTACK_FINISHED(self) = time + cvar("g_balance_hlac_primary_refire") * W_WeaponRateFactor();
+               ATTACK_FINISHED(self) = time + autocvar_g_balance_hlac_primary_refire * W_WeaponRateFactor();
                W_HLAC_Attack();
                self.HLAC_bulletcounter = self.HLAC_bulletcounter + 1;
-        weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_hlac_primary_refire"), HLAC_fire1_02);
+        weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_hlac_primary_refire, HLAC_fire1_02);
        }
        else
        {
-               weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_hlac_primary_animtime"), w_ready);
+               weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_hlac_primary_animtime, w_ready);
        }
 };
 
@@ -178,22 +178,22 @@ void spawnfunc_weapon_hlac (void)
 float w_hlac(float req)
 {
        if (req == WR_AIM)
-        self.BUTTON_ATCK = bot_aim(cvar("g_balance_hlac_primary_speed"), 0, cvar("g_balance_hlac_primary_lifetime"), FALSE);
+        self.BUTTON_ATCK = bot_aim(autocvar_g_balance_hlac_primary_speed, 0, autocvar_g_balance_hlac_primary_lifetime, FALSE);
        else if (req == WR_THINK)
        {
                if (self.BUTTON_ATCK)
-               if (weapon_prepareattack(0, cvar("g_balance_hlac_primary_refire")))
+               if (weapon_prepareattack(0, autocvar_g_balance_hlac_primary_refire))
                {
                        self.HLAC_bulletcounter = 0;
                        W_HLAC_Attack();
-                       weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_hlac_primary_refire"), HLAC_fire1_02);
+                       weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_hlac_primary_refire, HLAC_fire1_02);
                }
 
-               if (self.BUTTON_ATCK2 && cvar("g_balance_hlac_secondary"))
-               if (weapon_prepareattack(1, cvar("g_balance_hlac_secondary_refire")))
+               if (self.BUTTON_ATCK2 && autocvar_g_balance_hlac_secondary)
+               if (weapon_prepareattack(1, autocvar_g_balance_hlac_secondary_refire))
                {
                        W_HLAC_Attack2();
-                       weapon_thinkf(WFRAME_FIRE2, cvar("g_balance_hlac_secondary_animtime"), w_ready);
+                       weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_hlac_secondary_animtime, w_ready);
                }
 
        }
@@ -208,9 +208,9 @@ float w_hlac(float req)
        else if (req == WR_SETUP)
                weapon_setup(WEP_HLAC);
        else if (req == WR_CHECKAMMO1)
-               return self.ammo_cells >= cvar("g_balance_hlac_primary_ammo");
+               return self.ammo_cells >= autocvar_g_balance_hlac_primary_ammo;
        else if (req == WR_CHECKAMMO2)
-               return self.ammo_cells >= cvar("g_balance_hlac_secondary_ammo");
+               return self.ammo_cells >= autocvar_g_balance_hlac_secondary_ammo;
        return TRUE;
 };
 #endif
index 5b1cf61350a1421b379f2a5f52846bc253e3365b..e191077b31c28f1c1902beb668cfafd6d3db38d1 100644 (file)
@@ -41,12 +41,12 @@ void W_Hook_Explode2 (void)
 
        self.think = W_Hook_ExplodeThink;
        self.nextthink = time;
-       self.dmg = cvar("g_balance_hook_secondary_damage");
-       self.dmg_edge = cvar("g_balance_hook_secondary_edgedamage");
-       self.dmg_radius = cvar("g_balance_hook_secondary_radius");
-       self.dmg_force = cvar("g_balance_hook_secondary_force");
-       self.dmg_power = cvar("g_balance_hook_secondary_power");
-       self.dmg_duration = cvar("g_balance_hook_secondary_duration");
+       self.dmg = autocvar_g_balance_hook_secondary_damage;
+       self.dmg_edge = autocvar_g_balance_hook_secondary_edgedamage;
+       self.dmg_radius = autocvar_g_balance_hook_secondary_radius;
+       self.dmg_force = autocvar_g_balance_hook_secondary_force;
+       self.dmg_power = autocvar_g_balance_hook_secondary_power;
+       self.dmg_duration = autocvar_g_balance_hook_secondary_duration;
        self.teleport_time = time;
        self.dmg_last = 1;
        self.movetype = MOVETYPE_NONE;
@@ -63,30 +63,30 @@ void W_Hook_Attack2()
        local entity gren;
 
        if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
-               self.ammo_cells = self.ammo_cells - cvar("g_balance_hook_secondary_ammo");
-       W_SetupShot (self, FALSE, 4, "weapons/hookbomb_fire.wav", CHAN_WEAPON, cvar("g_balance_hook_secondary_damage"));
+               self.ammo_cells = self.ammo_cells - autocvar_g_balance_hook_secondary_ammo;
+       W_SetupShot (self, FALSE, 4, "weapons/hookbomb_fire.wav", CHAN_WEAPON, autocvar_g_balance_hook_secondary_damage);
 
        gren = spawn ();
        gren.owner = self;
        gren.classname = "hookbomb";
        gren.bot_dodge = TRUE;
-       gren.bot_dodgerating = cvar("g_balance_hook_secondary_damage");
+       gren.bot_dodgerating = autocvar_g_balance_hook_secondary_damage;
        gren.movetype = MOVETYPE_TOSS;
        PROJECTILE_MAKETRIGGER(gren);
        gren.projectiledeathtype = WEP_HOOK | HITTYPE_SECONDARY;
        setorigin(gren, w_shotorg);
        setsize(gren, '0 0 0', '0 0 0');
 
-       gren.nextthink = time + cvar("g_balance_hook_secondary_lifetime");
+       gren.nextthink = time + autocvar_g_balance_hook_secondary_lifetime;
        gren.think = adaptor_think2use_hittype_splash;
        gren.use = W_Hook_Explode2;
        gren.touch = W_Hook_Touch2;
 
-       gren.velocity = '0 0 1' * cvar("g_balance_hook_secondary_speed");
-       if(cvar("g_projectiles_newton_style"))
+       gren.velocity = '0 0 1' * autocvar_g_balance_hook_secondary_speed;
+       if(autocvar_g_projectiles_newton_style)
                gren.velocity = gren.velocity + self.velocity;
 
-       gren.gravity = cvar("g_balance_hook_secondary_gravity");
+       gren.gravity = autocvar_g_balance_hook_secondary_gravity;
        //W_SetupProjectileVelocity(gren); // just falling down!
 
        gren.angles = '0 0 0';
@@ -127,41 +127,41 @@ float w_hook(float req)
                        if (weapon_prepareattack(0, -1))
                        {
                                if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
-                                       self.ammo_fuel = self.ammo_fuel - cvar("g_balance_hook_primary_fuel");
+                                       self.ammo_fuel = self.ammo_fuel - autocvar_g_balance_hook_primary_fuel;
                                self.hook_state |= HOOK_FIRING;
-                               weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_hook_primary_animtime"), w_ready);                          
+                               weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_hook_primary_animtime, w_ready);                         
                        }
                }
 
                if (self.BUTTON_ATCK2)
                {
-                       if (weapon_prepareattack(1, cvar("g_balance_hook_secondary_refire")))
+                       if (weapon_prepareattack(1, autocvar_g_balance_hook_secondary_refire))
                        {
                                W_Hook_Attack2();
-                               weapon_thinkf(WFRAME_FIRE2, cvar("g_balance_hook_secondary_animtime"), w_ready);
+                               weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_hook_secondary_animtime, w_ready);
                        }
                }
 
                if(self.hook)
                {
                        // if hooked, no bombs, and increase the timer
-                       self.hook_refire = max(self.hook_refire, time + cvar("g_balance_hook_primary_refire"));
+                       self.hook_refire = max(self.hook_refire, time + autocvar_g_balance_hook_primary_refire);
 
                        // hook also inhibits health regeneration, but only for 1 second
                        if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
-                               self.pauseregen_finished = max(self.pauseregen_finished, time + cvar("g_balance_pause_fuel_regen"));
+                               self.pauseregen_finished = max(self.pauseregen_finished, time + autocvar_g_balance_pause_fuel_regen);
                }
 
                if(self.hook && self.hook.state == 1)
                {
-                       hooked_time_max = cvar("g_balance_hook_primary_hooked_time_max");                       
+                       hooked_time_max = autocvar_g_balance_hook_primary_hooked_time_max;                      
                        if (hooked_time_max > 0)
                        {
                                if ( time > self.hook_time_hooked + hooked_time_max )
                                        self.hook_state |= HOOK_REMOVING;
                        }
                        
-                       hooked_fuel = cvar("g_balance_hook_primary_hooked_fuel");
+                       hooked_fuel = autocvar_g_balance_hook_primary_hooked_fuel;
                        if (hooked_fuel > 0)
                        {
                                if ( time > self.hook_time_fueldecrease )
@@ -187,7 +187,7 @@ float w_hook(float req)
                else
                {
                        self.hook_time_hooked = time;                           
-                       self.hook_time_fueldecrease = time + cvar("g_balance_hook_primary_hooked_time_free");
+                       self.hook_time_fueldecrease = time + autocvar_g_balance_hook_primary_hooked_time_free;
                }
 
                if (self.BUTTON_CROUCH)
@@ -235,11 +235,11 @@ float w_hook(float req)
                if(self.hook)
                        return self.ammo_fuel > 0;
                else
-                       return self.ammo_fuel >= cvar("g_balance_hook_primary_fuel");
+                       return self.ammo_fuel >= autocvar_g_balance_hook_primary_fuel;
        }
        else if (req == WR_CHECKAMMO2)
        {
-               return self.ammo_cells >= cvar("g_balance_hook_secondary_ammo");
+               return self.ammo_cells >= autocvar_g_balance_hook_secondary_ammo;
        }
        else if (req == WR_RESETPLAYER)
        {
index f743c426dfb32e0e11e9a58150d36bfea1ee6430..5f680eb0811935072a312cd92423c3f838451761 100644 (file)
@@ -10,9 +10,9 @@ void W_Laser_Touch (void)
 
        self.event_damage = SUB_Null;
        if (self.dmg)
-               RadiusDamage (self, self.owner, cvar("g_balance_laser_secondary_damage"), cvar("g_balance_laser_secondary_edgedamage"), cvar("g_balance_laser_secondary_radius"), world, cvar("g_balance_laser_secondary_force"), self.projectiledeathtype, other);
+               RadiusDamage (self, self.owner, autocvar_g_balance_laser_secondary_damage, autocvar_g_balance_laser_secondary_edgedamage, autocvar_g_balance_laser_secondary_radius, world, autocvar_g_balance_laser_secondary_force, self.projectiledeathtype, other);
        else
-               RadiusDamage (self, self.owner, cvar("g_balance_laser_primary_damage"), cvar("g_balance_laser_primary_edgedamage"), cvar("g_balance_laser_primary_radius"), world, cvar("g_balance_laser_primary_force"), self.projectiledeathtype, other);
+               RadiusDamage (self, self.owner, autocvar_g_balance_laser_primary_damage, autocvar_g_balance_laser_primary_edgedamage, autocvar_g_balance_laser_primary_radius, world, autocvar_g_balance_laser_primary_force, self.projectiledeathtype, other);
 
        remove (self);
 }
@@ -22,9 +22,9 @@ void W_Laser_Think()
        self.movetype = MOVETYPE_FLY;
        self.think = SUB_Remove;
        if (self.dmg)
-               self.nextthink = time + cvar("g_balance_laser_secondary_lifetime");
+               self.nextthink = time + autocvar_g_balance_laser_secondary_lifetime;
        else
-               self.nextthink = time + cvar("g_balance_laser_primary_lifetime");
+               self.nextthink = time + autocvar_g_balance_laser_primary_lifetime;
        CSQCProjectile(self, TRUE, PROJECTILE_LASER, TRUE);
 }
 
@@ -40,15 +40,15 @@ void W_Laser_Attack (float issecondary)
        else
                nodamage = FALSE;
 
-       a = cvar("g_balance_laser_primary_shotangle");
+       a = autocvar_g_balance_laser_primary_shotangle;
        s_forward = v_forward * cos(a * DEG2RAD) + v_up * sin(a * DEG2RAD);
 
        if(nodamage)
                W_SetupShot_Dir (self, s_forward, FALSE, 3, "weapons/lasergun_fire.wav", CHAN_WEAPON2, 0);
        else if(issecondary == 1)
-               W_SetupShot_Dir (self, s_forward, FALSE, 3, "weapons/lasergun_fire.wav", CHAN_WEAPON2, cvar("g_balance_laser_secondary_damage"));
+               W_SetupShot_Dir (self, s_forward, FALSE, 3, "weapons/lasergun_fire.wav", CHAN_WEAPON2, autocvar_g_balance_laser_secondary_damage);
        else
-               W_SetupShot_Dir (self, s_forward, FALSE, 3, "weapons/lasergun_fire.wav", CHAN_WEAPON2, cvar("g_balance_laser_primary_damage"));
+               W_SetupShot_Dir (self, s_forward, FALSE, 3, "weapons/lasergun_fire.wav", CHAN_WEAPON2, autocvar_g_balance_laser_primary_damage);
        pointparticles(particleeffectnum("laser_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
 
        missile = spawn ();
@@ -58,7 +58,7 @@ void W_Laser_Attack (float issecondary)
        if(!nodamage)
        {
                missile.bot_dodge = TRUE;
-               missile.bot_dodgerating = cvar("g_balance_laser_primary_damage");
+               missile.bot_dodgerating = autocvar_g_balance_laser_primary_damage;
        }
 
        PROJECTILE_MAKETRIGGER(missile);
@@ -76,7 +76,7 @@ void W_Laser_Attack (float issecondary)
        missile.flags = FL_PROJECTILE;
 
        missile.think = W_Laser_Think;
-       missile.nextthink = time + cvar("g_balance_laser_primary_delay");
+       missile.nextthink = time + autocvar_g_balance_laser_primary_delay;
 
        other = missile; MUTATOR_CALLHOOK(EditProjectile);
 
@@ -121,9 +121,9 @@ float gauntletbeam_send(entity to, float sf)
 void gauntletbeam_think()
 {
        float damage, myforce, myradius;
-       damage = cvar("g_balance_laser_secondary_damage");
-       myforce = cvar("g_balance_laser_secondary_force");
-       myradius = cvar("g_balance_laser_secondary_radius");
+       damage = autocvar_g_balance_laser_secondary_damage;
+       myforce = autocvar_g_balance_laser_secondary_force;
+       myradius = autocvar_g_balance_laser_secondary_radius;
 
        self.owner.prevgauntletfire = time;
        if (self.owner.weaponentity.state != WS_INUSE || self != self.owner.gauntletbeam || self.owner.deadflag != DEAD_NO || !self.owner.BUTTON_ATCK2)
@@ -183,7 +183,7 @@ void W_Laser_Attack2 ()
        beam.movetype = MOVETYPE_NONE;
        beam.shot_spread = 0;
        beam.bot_dodge = TRUE;
-       beam.bot_dodgerating = cvar("g_balance_laser_primary_damage");
+       beam.bot_dodgerating = autocvar_g_balance_laser_primary_damage;
        Net_LinkEntity(beam, FALSE, 0, gauntletbeam_send);
 
        oldself = self;
@@ -212,34 +212,34 @@ float w_laser(float req)
        local float r2;
        if (req == WR_AIM)
        {
-               if(cvar("g_balance_laser_secondary"))
+               if(autocvar_g_balance_laser_secondary)
                {
-                       r1 = cvar("g_balance_laser_primary_damage");
-                       r2 = cvar("g_balance_laser_secondary_damage");
+                       r1 = autocvar_g_balance_laser_primary_damage;
+                       r2 = autocvar_g_balance_laser_secondary_damage;
                        if (random() * (r2 + r1) > r1)
-                               self.BUTTON_ATCK2 = bot_aim(cvar("g_balance_laser_secondary_speed"), 0, cvar("g_balance_laser_secondary_lifetime"), FALSE);
+                               self.BUTTON_ATCK2 = bot_aim(autocvar_g_balance_laser_secondary_speed, 0, autocvar_g_balance_laser_secondary_lifetime, FALSE);
                        else
-                               self.BUTTON_ATCK = bot_aim(cvar("g_balance_laser_primary_speed"), 0, cvar("g_balance_laser_primary_lifetime"), FALSE);
+                               self.BUTTON_ATCK = bot_aim(autocvar_g_balance_laser_primary_speed, 0, autocvar_g_balance_laser_primary_lifetime, FALSE);
                }
                else
-                       self.BUTTON_ATCK = bot_aim(cvar("g_balance_laser_primary_speed"), 0, cvar("g_balance_laser_primary_lifetime"), FALSE);
+                       self.BUTTON_ATCK = bot_aim(autocvar_g_balance_laser_primary_speed, 0, autocvar_g_balance_laser_primary_lifetime, FALSE);
        }
        else if (req == WR_THINK)
        {
                if (self.BUTTON_ATCK)
-               if (weapon_prepareattack(0, cvar("g_balance_laser_primary_refire")))
+               if (weapon_prepareattack(0, autocvar_g_balance_laser_primary_refire))
                {
                        W_Laser_Attack(0);
-                       weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_laser_primary_animtime"), w_ready);
+                       weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_laser_primary_animtime, w_ready);
                }
                if (self.BUTTON_ATCK2)
                {
-                       if(cvar("g_balance_laser_secondary"))
+                       if(autocvar_g_balance_laser_secondary)
                        {
                                if (weapon_prepareattack(0, 0))
                                {
                                        W_Laser_Attack2();
-                                       weapon_thinkf(WFRAME_FIRE2, cvar("g_balance_laser_secondary_animtime"), w_ready);
+                                       weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_laser_secondary_animtime, w_ready);
                                }
                        }
                        else
index 225fa5ebab22df27b768b26a0feacfb01ba25bfd..42c8ec3ececc565e599fec2ba0541ba45823942f 100644 (file)
@@ -62,11 +62,11 @@ void W_Mine_Explode ()
        self.event_damage = SUB_Null;
        self.takedamage = DAMAGE_NO;
 
-       RadiusDamage (self, self.owner, cvar("g_balance_minelayer_damage"), cvar("g_balance_minelayer_edgedamage"), cvar("g_balance_minelayer_radius"), world, cvar("g_balance_minelayer_force"), self.projectiledeathtype, other);
+       RadiusDamage (self, self.owner, autocvar_g_balance_minelayer_damage, autocvar_g_balance_minelayer_edgedamage, autocvar_g_balance_minelayer_radius, world, autocvar_g_balance_minelayer_force, self.projectiledeathtype, other);
 
        if (self.owner.weapon == WEP_MINE_LAYER)
        {
-               if(self.owner.ammo_rockets < cvar("g_balance_minelayer_ammo"))
+               if(self.owner.ammo_rockets < autocvar_g_balance_minelayer_ammo)
                {
                        self.owner.cnt = WEP_MINE_LAYER;
                        ATTACK_FINISHED(self.owner) = time;
@@ -81,11 +81,11 @@ void W_Mine_DoRemoteExplode ()
        self.event_damage = SUB_Null;
        self.takedamage = DAMAGE_NO;
 
-       RadiusDamage (self, self.owner, cvar("g_balance_minelayer_remote_damage"), cvar("g_balance_minelayer_remote_edgedamage"), cvar("g_balance_minelayer_remote_radius"), world, cvar("g_balance_minelayer_remote_force"), self.projectiledeathtype | HITTYPE_BOUNCE, world);
+       RadiusDamage (self, self.owner, autocvar_g_balance_minelayer_remote_damage, autocvar_g_balance_minelayer_remote_edgedamage, autocvar_g_balance_minelayer_remote_radius, world, autocvar_g_balance_minelayer_remote_force, self.projectiledeathtype | HITTYPE_BOUNCE, world);
 
        if (self.owner.weapon == WEP_MINE_LAYER)
        {
-               if(self.owner.ammo_rockets < cvar("g_balance_minelayer_ammo"))
+               if(self.owner.ammo_rockets < autocvar_g_balance_minelayer_ammo)
                {
                        self.owner.cnt = WEP_MINE_LAYER;
                        ATTACK_FINISHED(self.owner) = time;
@@ -100,7 +100,7 @@ void W_Mine_RemoteExplode ()
        if(self.owner.deadflag == DEAD_NO)
                if((self.spawnshieldtime >= 0)
                        ? (time >= self.spawnshieldtime) // timer
-                       : (vlen(NearestPointOnBox(self.owner, self.origin) - self.origin) > cvar("g_balance_minelayer_remote_radius")) // safety device
+                       : (vlen(NearestPointOnBox(self.owner, self.origin) - self.origin) > autocvar_g_balance_minelayer_remote_radius) // safety device
                )
                {
                        W_Mine_DoRemoteExplode();
@@ -110,10 +110,10 @@ void W_Mine_RemoteExplode ()
 void W_Mine_ProximityExplode ()
 {
        // make sure no friend is in the mine's radius. If there is any, explosion is delayed until he's at a safe distance
-       if(cvar("g_balance_minelayer_protection"))
+       if(autocvar_g_balance_minelayer_protection)
        {
                entity head;
-               head = findradius(self.origin, cvar("g_balance_minelayer_radius"));
+               head = findradius(self.origin, autocvar_g_balance_minelayer_radius);
                while(head)
                {
                        if(head == self.owner || !IsDifferentTeam(head, self.owner))
@@ -150,7 +150,7 @@ void W_Mine_Think (void)
        }
 
        // set the mine for detonation when a foe gets close enough
-       head = findradius(self.origin, cvar("g_balance_minelayer_proximityradius"));
+       head = findradius(self.origin, autocvar_g_balance_minelayer_proximityradius);
        while(head)
        {
                if(head.classname == "player" && head.deadflag == DEAD_NO)
@@ -158,7 +158,7 @@ void W_Mine_Think (void)
                if(!self.mine_time)
                {
                        spamsound (self, CHAN_PROJECTILE, "weapons/mine_trigger.wav", VOL_BASE, ATTN_NORM);
-                       self.mine_time = time + cvar("g_balance_minelayer_time");
+                       self.mine_time = time + autocvar_g_balance_minelayer_time;
                }
                head = head.chain;
        }
@@ -199,40 +199,40 @@ void W_Mine_Attack (void)
        entity flash;
 
        // scan how many mines we placed, and return if we reached our limit
-       if(cvar("g_balance_minelayer_limit"))
+       if(autocvar_g_balance_minelayer_limit)
        {
                self.minelayer_mines = 0;
                for(mine = world; (mine = find(mine, classname, "mine")); ) if(mine.owner == self)
                        self.minelayer_mines += 1;
 
-               if(self.minelayer_mines >= cvar("g_balance_minelayer_limit"))
+               if(self.minelayer_mines >= autocvar_g_balance_minelayer_limit)
                {
                        // the refire delay keeps this message from being spammed
-                       sprint(self, strcat("You cannot place more than ^2", cvar_string("g_balance_minelayer_limit"), " ^7mines at a time\n") );
+                       sprint(self, strcat("You cannot place more than ^2", ftos(autocvar_g_balance_minelayer_limit), " ^7mines at a time\n") );
                        play2(self, "weapons/unavailable.wav");
                        return;
                }
        }
 
        if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
-               self.ammo_rockets = self.ammo_rockets - cvar("g_balance_minelayer_ammo");
+               self.ammo_rockets = self.ammo_rockets - autocvar_g_balance_minelayer_ammo;
 
-       W_SetupShot_ProjectileSize (self, '-4 -4 -4', '4 4 4', FALSE, 5, "weapons/mine_fire.wav", CHAN_WEAPON, cvar("g_balance_minelayer_damage"));
+       W_SetupShot_ProjectileSize (self, '-4 -4 -4', '4 4 4', FALSE, 5, "weapons/mine_fire.wav", CHAN_WEAPON, autocvar_g_balance_minelayer_damage);
        pointparticles(particleeffectnum("rocketlauncher_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
 
        mine = WarpZone_RefSys_SpawnSameRefSys(self);
        mine.owner = self;
-       if(cvar("g_balance_minelayer_detonatedelay") >= 0)
-               mine.spawnshieldtime = time + cvar("g_balance_minelayer_detonatedelay");
+       if(autocvar_g_balance_minelayer_detonatedelay >= 0)
+               mine.spawnshieldtime = time + autocvar_g_balance_minelayer_detonatedelay;
        else
                mine.spawnshieldtime = -1;
        mine.classname = "mine";
        mine.bot_dodge = TRUE;
-       mine.bot_dodgerating = cvar("g_balance_minelayer_damage") * 2; // * 2 because it can detonate inflight which makes it even more dangerous
+       mine.bot_dodgerating = autocvar_g_balance_minelayer_damage * 2; // * 2 because it can detonate inflight which makes it even more dangerous
 
        mine.takedamage = DAMAGE_YES;
-       mine.damageforcescale = cvar("g_balance_minelayer_damageforcescale");
-       mine.health = cvar("g_balance_minelayer_health");
+       mine.damageforcescale = autocvar_g_balance_minelayer_damageforcescale;
+       mine.health = autocvar_g_balance_minelayer_health;
        mine.event_damage = W_Mine_Damage;
 
        mine.movetype = MOVETYPE_TOSS;
@@ -241,13 +241,13 @@ void W_Mine_Attack (void)
        setsize (mine, '-4 -4 -4', '4 4 4'); // give it some size so it can be shot
 
        setorigin (mine, w_shotorg - v_forward * 4); // move it back so it hits the wall at the right point
-       W_SetupProjectileVelocity(mine, cvar("g_balance_minelayer_speed"), 0);
+       W_SetupProjectileVelocity(mine, autocvar_g_balance_minelayer_speed, 0);
        mine.angles = vectoangles (mine.velocity);
 
        mine.touch = W_Mine_Touch;
        mine.think = W_Mine_Think;
        mine.nextthink = time;
-       mine.cnt = time + cvar("g_balance_minelayer_lifetime");
+       mine.cnt = time + autocvar_g_balance_minelayer_lifetime;
        mine.flags = FL_PROJECTILE;
 
        CSQCProjectile(mine, TRUE, PROJECTILE_MINE, TRUE);
@@ -273,16 +273,16 @@ float w_minelayer(float req)
        if (req == WR_AIM)
        {
                // aim and decide to fire if appropriate
-               self.BUTTON_ATCK = bot_aim(cvar("g_balance_minelayer_speed"), 0, cvar("g_balance_minelayer_lifetime"), FALSE);
+               self.BUTTON_ATCK = bot_aim(autocvar_g_balance_minelayer_speed, 0, autocvar_g_balance_minelayer_lifetime, FALSE);
                if(skill >= 2) // skill 0 and 1 bots won't detonate mines!
                {
                        // decide whether to detonate mines
                        entity targetlist, targ;
                        float edgedamage, coredamage, edgeradius, recipricoledgeradius, d;
                        float selfdamage, teamdamage, enemydamage;
-                       edgedamage = cvar("g_balance_minelayer_edgedamage");
-                       coredamage = cvar("g_balance_minelayer_damage");
-                       edgeradius = cvar("g_balance_minelayer_radius");
+                       edgedamage = autocvar_g_balance_minelayer_edgedamage;
+                       coredamage = autocvar_g_balance_minelayer_damage;
+                       edgeradius = autocvar_g_balance_minelayer_radius;
                        recipricoledgeradius = 1 / edgeradius;
                        selfdamage = 0;
                        teamdamage = 0;
@@ -315,7 +315,7 @@ float w_minelayer(float req)
                        float desirabledamage;
                        desirabledamage = enemydamage;
                        if (time > self.invincible_finished && time > self.spawnshieldtime)
-                               desirabledamage = desirabledamage - selfdamage * cvar("g_balance_selfdamagepercent");
+                               desirabledamage = desirabledamage - selfdamage * autocvar_g_balance_selfdamagepercent;
                        if (teams_matter && self.team)
                                desirabledamage = desirabledamage - teamdamage;
 
@@ -369,10 +369,10 @@ float w_minelayer(float req)
        {
                if (self.BUTTON_ATCK)
                {
-                       if(weapon_prepareattack(0, cvar("g_balance_minelayer_refire")))
+                       if(weapon_prepareattack(0, autocvar_g_balance_minelayer_refire))
                        {
                                W_Mine_Attack();
-                               weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_minelayer_animtime"), w_ready);
+                               weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_minelayer_animtime, w_ready);
                        }
                }
 
@@ -411,7 +411,7 @@ float w_minelayer(float req)
        {
                // don't switch while placing a mine
                if ((ATTACK_FINISHED(self) <= time || self.weapon != WEP_MINE_LAYER)
-                       && self.ammo_rockets < cvar("g_balance_minelayer_ammo"))
+                       && self.ammo_rockets < autocvar_g_balance_minelayer_ammo)
                        return FALSE;
        }
        else if (req == WR_CHECKAMMO2)
index 2c997cd39c7c4c6d17699ee7cd6d713007853293..f515d98b5a124b119f164e30e2d765691db6dc14 100644 (file)
@@ -85,7 +85,7 @@ void W_MinstaNex_Attack (void)
                if (g_minstagib)
                        self.ammo_cells = self.ammo_cells - 1;
                else
-                       self.ammo_cells = self.ammo_cells - cvar("g_balance_minstanex_ammo");
+                       self.ammo_cells = self.ammo_cells - autocvar_g_balance_minstanex_ammo;
        }
 }
 
@@ -178,23 +178,23 @@ float w_minstanex(float req)
                if(self.ammo_cells>0)
                        self.BUTTON_ATCK = bot_aim(1000000, 0, 1, FALSE);
                else
-                       self.BUTTON_ATCK2 = bot_aim(cvar("g_balance_laser_primary_speed"), 0, cvar("g_balance_laser_primary_lifetime"), FALSE);
+                       self.BUTTON_ATCK2 = bot_aim(autocvar_g_balance_laser_primary_speed, 0, autocvar_g_balance_laser_primary_lifetime, FALSE);
        }
        else if (req == WR_THINK)
        {
                if (self.BUTTON_ATCK)
                {
-                       if (weapon_prepareattack(0, cvar("g_balance_minstanex_refire")))
+                       if (weapon_prepareattack(0, autocvar_g_balance_minstanex_refire))
                        {
                                W_MinstaNex_Attack();
-                               weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_minstanex_animtime"), w_ready);
+                               weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_minstanex_animtime, w_ready);
                        }
                }
                else if (self.BUTTON_ATCK2)
                {
                        if (self.jump_interval <= time)
                        {
-                               self.jump_interval = time + cvar("g_balance_laser_primary_refire") * W_WeaponRateFactor();
+                               self.jump_interval = time + autocvar_g_balance_laser_primary_refire * W_WeaponRateFactor();
 
                                // ugly minstagib hack to reuse the fire mode of the laser
                                float w;
@@ -227,7 +227,7 @@ float w_minstanex(float req)
                if (g_minstagib)
                        return self.ammo_cells >= 1;
                else
-                       return self.ammo_cells >= cvar("g_balance_minstanex_ammo");
+                       return self.ammo_cells >= autocvar_g_balance_minstanex_ammo;
        }
        else if (req == WR_CHECKAMMO2)
                return TRUE;
index 3ff98808071056f0e724930d90426806c29aa069..3a8840f0a1bd1dd212272b7302cd8bd06541f29f 100644 (file)
@@ -21,32 +21,32 @@ void W_Nex_Attack (float issecondary)
        float mydmg, myforce, mymindist, mymaxdist, myhalflife, myforcehalflife, myammo, charge;
        if(issecondary)
        {
-               mydmg = cvar("g_balance_nex_secondary_damage");
-               myforce = cvar("g_balance_nex_secondary_force");
-               mymindist = cvar("g_balance_nex_secondary_damagefalloff_mindist");
-               mymaxdist = cvar("g_balance_nex_secondary_damagefalloff_maxdist");
-               myhalflife = cvar("g_balance_nex_secondary_damagefalloff_halflife");
-               myforcehalflife = cvar("g_balance_nex_secondary_damagefalloff_forcehalflife");
-               myammo = cvar("g_balance_nex_secondary_ammo");
+               mydmg = autocvar_g_balance_nex_secondary_damage;
+               myforce = autocvar_g_balance_nex_secondary_force;
+               mymindist = autocvar_g_balance_nex_secondary_damagefalloff_mindist;
+               mymaxdist = autocvar_g_balance_nex_secondary_damagefalloff_maxdist;
+               myhalflife = autocvar_g_balance_nex_secondary_damagefalloff_halflife;
+               myforcehalflife = autocvar_g_balance_nex_secondary_damagefalloff_forcehalflife;
+               myammo = autocvar_g_balance_nex_secondary_ammo;
        }
        else
        {
-               mydmg = cvar("g_balance_nex_primary_damage");
-               myforce = cvar("g_balance_nex_primary_force");
-               mymindist = cvar("g_balance_nex_primary_damagefalloff_mindist");
-               mymaxdist = cvar("g_balance_nex_primary_damagefalloff_maxdist");
-               myhalflife = cvar("g_balance_nex_primary_damagefalloff_halflife");
-               myforcehalflife = cvar("g_balance_nex_primary_damagefalloff_forcehalflife");
-               myammo = cvar("g_balance_nex_primary_ammo");
+               mydmg = autocvar_g_balance_nex_primary_damage;
+               myforce = autocvar_g_balance_nex_primary_force;
+               mymindist = autocvar_g_balance_nex_primary_damagefalloff_mindist;
+               mymaxdist = autocvar_g_balance_nex_primary_damagefalloff_maxdist;
+               myhalflife = autocvar_g_balance_nex_primary_damagefalloff_halflife;
+               myforcehalflife = autocvar_g_balance_nex_primary_damagefalloff_forcehalflife;
+               myammo = autocvar_g_balance_nex_primary_ammo;
        }
 
        float flying;
        flying = IsFlying(self); // do this BEFORE to make the trace values from FireRailgunBullet last
 
-       if(cvar("g_balance_nex_charge"))
+       if(autocvar_g_balance_nex_charge)
        {
-               charge = cvar("g_balance_nex_charge_mindmg") / mydmg + (1 - cvar("g_balance_nex_charge_mindmg") / mydmg) * self.nex_charge;
-               self.nex_charge *= cvar("g_balance_nex_charge_shot_multiplier"); // do this AFTER setting mydmg/myforce
+               charge = autocvar_g_balance_nex_charge_mindmg / mydmg + (1 - autocvar_g_balance_nex_charge_mindmg / mydmg) * self.nex_charge;
+               self.nex_charge *= autocvar_g_balance_nex_charge_shot_multiplier; // do this AFTER setting mydmg/myforce
                                                                                 // O RLY? -- divVerent
                                                                          // YA RLY -- FruitieX
        }
@@ -56,9 +56,9 @@ void W_Nex_Attack (float issecondary)
        myforce *= charge;
 
        W_SetupShot (self, TRUE, 5, "weapons/nexfire.wav", CHAN_WEAPON, mydmg);
-    if(charge > cvar("g_balance_nex_charge_limit") && cvar("g_balance_nex_charge_limit")) // if the Nex is overcharged, we play an extra sound
+    if(charge > autocvar_g_balance_nex_charge_limit && autocvar_g_balance_nex_charge_limit) // if the Nex is overcharged, we play an extra sound
     {
-        sound (self, CHAN_WEAPON2, "weapons/nexcharge.wav", VOL_BASE * (charge - 0.5 * cvar("g_balance_nex_charge_limit")) / (1 - 0.5 * cvar("g_balance_nex_charge_limit")), ATTN_NORM);
+        sound (self, CHAN_WEAPON2, "weapons/nexcharge.wav", VOL_BASE * (charge - 0.5 * autocvar_g_balance_nex_charge_limit) / (1 - 0.5 * autocvar_g_balance_nex_charge_limit), ATTN_NORM);
     }
 
        yoda = 0;
@@ -91,89 +91,89 @@ float w_nex(float req)
        }
        else if (req == WR_THINK)
        {
-               if(cvar("g_balance_nex_charge") && self.nex_charge < cvar("g_balance_nex_charge_limit"))
-                       self.nex_charge = min(1, self.nex_charge + cvar("g_balance_nex_charge_rate") * frametime / W_TICSPERFRAME);
+               if(autocvar_g_balance_nex_charge && self.nex_charge < autocvar_g_balance_nex_charge_limit)
+                       self.nex_charge = min(1, self.nex_charge + autocvar_g_balance_nex_charge_rate * frametime / W_TICSPERFRAME);
 
-        if(cvar("g_balance_nex_charge"))
+        if(autocvar_g_balance_nex_charge)
         {
             self.weaponentity.weaponentity.glowmod = '0 0 0'; // reset
 
-            self.weaponentity.weaponentity.glowmod_x = cvar("g_weapon_charge_colormod_hdrmultiplier") * cvar("g_weapon_charge_colormod_red_half") * bound(0, self.weaponentity.weaponentity.glowmod_y + self.nex_charge / cvar("g_balance_nex_charge_limit"), 1);
-            self.weaponentity.weaponentity.glowmod_y = cvar("g_weapon_charge_colormod_hdrmultiplier") * cvar("g_weapon_charge_colormod_green_half") * bound(0, self.weaponentity.weaponentity.glowmod_y + self.nex_charge / cvar("g_balance_nex_charge_limit"), 1);
-            self.weaponentity.weaponentity.glowmod_z = cvar("g_weapon_charge_colormod_hdrmultiplier") * cvar("g_weapon_charge_colormod_blue_half") * bound(0, self.weaponentity.weaponentity.glowmod_z + self.nex_charge / cvar("g_balance_nex_charge_limit"), 1);
+            self.weaponentity.weaponentity.glowmod_x = autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_red_half * bound(0, self.weaponentity.weaponentity.glowmod_y + self.nex_charge / autocvar_g_balance_nex_charge_limit, 1);
+            self.weaponentity.weaponentity.glowmod_y = autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_green_half * bound(0, self.weaponentity.weaponentity.glowmod_y + self.nex_charge / autocvar_g_balance_nex_charge_limit, 1);
+            self.weaponentity.weaponentity.glowmod_z = autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_blue_half * bound(0, self.weaponentity.weaponentity.glowmod_z + self.nex_charge / autocvar_g_balance_nex_charge_limit, 1);
 
-            if(self.nex_charge > cvar("g_balance_nex_charge_limit"))
+            if(self.nex_charge > autocvar_g_balance_nex_charge_limit)
             {
-                self.weaponentity.weaponentity.glowmod_x = self.weaponentity.weaponentity.glowmod_x + cvar("g_weapon_charge_colormod_hdrmultiplier") * cvar("g_weapon_charge_colormod_red_full") * (self.nex_charge - cvar("g_balance_nex_charge_limit")) / (1 - cvar("g_balance_nex_charge_limit"));
-                self.weaponentity.weaponentity.glowmod_y = self.weaponentity.weaponentity.glowmod_y + cvar("g_weapon_charge_colormod_hdrmultiplier") * cvar("g_weapon_charge_colormod_green_full") * (self.nex_charge - cvar("g_balance_nex_charge_limit")) / (1 - cvar("g_balance_nex_charge_limit"));
-                self.weaponentity.weaponentity.glowmod_z = self.weaponentity.weaponentity.glowmod_z + cvar("g_weapon_charge_colormod_hdrmultiplier") * cvar("g_weapon_charge_colormod_blue_full") * (self.nex_charge - cvar("g_balance_nex_charge_limit")) / (1 - cvar("g_balance_nex_charge_limit"));
+                self.weaponentity.weaponentity.glowmod_x = self.weaponentity.weaponentity.glowmod_x + autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_red_full * (self.nex_charge - autocvar_g_balance_nex_charge_limit) / (1 - autocvar_g_balance_nex_charge_limit);
+                self.weaponentity.weaponentity.glowmod_y = self.weaponentity.weaponentity.glowmod_y + autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_green_full * (self.nex_charge - autocvar_g_balance_nex_charge_limit) / (1 - autocvar_g_balance_nex_charge_limit);
+                self.weaponentity.weaponentity.glowmod_z = self.weaponentity.weaponentity.glowmod_z + autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_blue_full * (self.nex_charge - autocvar_g_balance_nex_charge_limit) / (1 - autocvar_g_balance_nex_charge_limit);
             }
             self.exteriorweaponentity.glowmod = self.weaponentity.weaponentity.glowmod;
         }
 
-               if(cvar("g_balance_nex_secondary_chargepool"))
+               if(autocvar_g_balance_nex_secondary_chargepool)
                if(self.nex_chargepool_ammo < 1)
                {
                        if(self.nex_chargepool_pauseregen_finished < time)
-                               self.nex_chargepool_ammo = min(1, self.nex_chargepool_ammo + cvar("g_balance_nex_secondary_chargepool_regen") * frametime / W_TICSPERFRAME);
-                       self.pauseregen_finished = max(self.pauseregen_finished, time + cvar("g_balance_nex_secondary_chargepool_pause_health_regen"));
+                               self.nex_chargepool_ammo = min(1, self.nex_chargepool_ammo + autocvar_g_balance_nex_secondary_chargepool_regen * frametime / W_TICSPERFRAME);
+                       self.pauseregen_finished = max(self.pauseregen_finished, time + autocvar_g_balance_nex_secondary_chargepool_pause_health_regen);
                }
 
                if (self.BUTTON_ATCK)
                {
-                       if (weapon_prepareattack(0, cvar("g_balance_nex_primary_refire")))
+                       if (weapon_prepareattack(0, autocvar_g_balance_nex_primary_refire))
                        {
                                W_Nex_Attack(0);
-                               weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_nex_primary_animtime"), w_ready);
+                               weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_nex_primary_animtime, w_ready);
                        }
                }
                if (self.BUTTON_ATCK2)
                {
-                       if(cvar("g_balance_nex_secondary_charge"))
+                       if(autocvar_g_balance_nex_secondary_charge)
                        {
-                               self.nex_charge_rottime = time + cvar("g_balance_nex_charge_rot_pause");
+                               self.nex_charge_rottime = time + autocvar_g_balance_nex_charge_rot_pause;
                                dt = frametime / W_TICSPERFRAME;
 
-                               if(cvar("g_balance_nex_secondary_chargepool"))
+                               if(autocvar_g_balance_nex_secondary_chargepool)
                                {
-                                       if(cvar("g_balance_nex_secondary_ammo"))
+                                       if(autocvar_g_balance_nex_secondary_ammo)
                                        {
                                                // always deplete if secondary is held
-                                               self.nex_chargepool_ammo = max(0, self.nex_chargepool_ammo - cvar("g_balance_nex_secondary_ammo") * dt);
+                                               self.nex_chargepool_ammo = max(0, self.nex_chargepool_ammo - autocvar_g_balance_nex_secondary_ammo * dt);
 
-                                               dt = min(dt, (1 - self.nex_charge) / cvar("g_balance_nex_secondary_charge_rate"));
-                                               self.nex_chargepool_pauseregen_finished = time + cvar("g_balance_nex_secondary_chargepool_pause_regen");
+                                               dt = min(dt, (1 - self.nex_charge) / autocvar_g_balance_nex_secondary_charge_rate);
+                                               self.nex_chargepool_pauseregen_finished = time + autocvar_g_balance_nex_secondary_chargepool_pause_regen;
                                                dt = min(dt, self.nex_chargepool_ammo);
                                                dt = max(0, dt);
 
-                                               self.nex_charge += dt * cvar("g_balance_nex_secondary_charge_rate");
+                                               self.nex_charge += dt * autocvar_g_balance_nex_secondary_charge_rate;
                                        }
                                }
 
-                               else if(cvar("g_balance_nex_secondary_ammo"))
+                               else if(autocvar_g_balance_nex_secondary_ammo)
                                {
                                        if(self.nex_charge < 1)
                                        {
-                                               dt = min(dt, (1 - self.nex_charge) / cvar("g_balance_nex_secondary_charge_rate"));
+                                               dt = min(dt, (1 - self.nex_charge) / autocvar_g_balance_nex_secondary_charge_rate);
                                                if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
                                                {
-                                                       dt = min(dt, (self.ammo_cells - cvar("g_balance_nex_primary_ammo")) / cvar("g_balance_nex_secondary_ammo"));
+                                                       dt = min(dt, (self.ammo_cells - autocvar_g_balance_nex_primary_ammo) / autocvar_g_balance_nex_secondary_ammo);
                                                        dt = max(0, dt);
                                                        if(dt > 0)
                                                        {
-                                                               self.ammo_cells = max(cvar("g_balance_nex_secondary_ammo"), self.ammo_cells - cvar("g_balance_nex_secondary_ammo") * dt);
+                                                               self.ammo_cells = max(autocvar_g_balance_nex_secondary_ammo, self.ammo_cells - autocvar_g_balance_nex_secondary_ammo * dt);
                                                        }
                                                }
-                                               self.nex_charge += dt * cvar("g_balance_nex_secondary_charge_rate");
+                                               self.nex_charge += dt * autocvar_g_balance_nex_secondary_charge_rate;
                                        }
                                }
                        }
-                       else if(cvar("g_balance_nex_secondary"))
+                       else if(autocvar_g_balance_nex_secondary)
                        {
-                               if (weapon_prepareattack(0, cvar("g_balance_nex_secondary_refire")))
+                               if (weapon_prepareattack(0, autocvar_g_balance_nex_secondary_refire))
                                {
                                        W_Nex_Attack(1);
-                                       weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_nex_secondary_animtime"), w_ready);
+                                       weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_nex_secondary_animtime, w_ready);
                                }
                        }
                }
@@ -193,9 +193,9 @@ float w_nex(float req)
        else if (req == WR_SETUP)
                weapon_setup(WEP_NEX);
        else if (req == WR_CHECKAMMO1)
-               return self.ammo_cells >= cvar("g_balance_nex_primary_ammo");
+               return self.ammo_cells >= autocvar_g_balance_nex_primary_ammo;
        else if (req == WR_CHECKAMMO2)
-               return self.ammo_cells >= cvar("g_balance_nex_primary_ammo"); // don't allow charging if we don't have enough ammo
+               return self.ammo_cells >= autocvar_g_balance_nex_primary_ammo; // don't allow charging if we don't have enough ammo
        return TRUE;
 };
 #endif
index fc7fde3fb8d0e623991cfb4c95df67d6f389e9d2..8083a79685d3a17e862514d73491f418888d4b51 100644 (file)
@@ -180,13 +180,13 @@ void W_Porto_Attack (void)
        setorigin(gren, w_shotorg);
        setsize(gren, '0 0 0', '0 0 0');
 
-       gren.nextthink = time + cvar("g_balance_porto_primary_lifetime");
+       gren.nextthink = time + autocvar_g_balance_porto_primary_lifetime;
        gren.think = W_Porto_Think;
        gren.touch = W_Porto_Touch;
        if(self.items & IT_STRENGTH)
-               W_SetupProjectileVelocity(gren, cvar("g_balance_porto_primary_speed") * cvar("g_balance_powerup_strength_force"), 0);
+               W_SetupProjectileVelocity(gren, autocvar_g_balance_porto_primary_speed * autocvar_g_balance_powerup_strength_force, 0);
        else
-               W_SetupProjectileVelocity(gren, cvar("g_balance_porto_primary_speed"), 0);
+               W_SetupProjectileVelocity(gren, autocvar_g_balance_porto_primary_speed, 0);
 
        gren.angles = vectoangles (gren.velocity);
        gren.flags = FL_PROJECTILE;
@@ -219,7 +219,7 @@ float w_porto(float req)
        {
                self.BUTTON_ATCK = FALSE;
                self.BUTTON_ATCK2 = FALSE;
-               if(bot_aim(cvar("g_balance_porto_primary_speed"), 0, cvar("g_balance_grenadelauncher_primary_lifetime"), FALSE))
+               if(bot_aim(autocvar_g_balance_porto_primary_speed, 0, autocvar_g_balance_grenadelauncher_primary_lifetime, FALSE))
                        self.BUTTON_ATCK = TRUE;
        }
        else if (req == WR_THINK)
@@ -250,10 +250,10 @@ float w_porto(float req)
                if (self.BUTTON_ATCK)
                if (!self.porto_current)
                if (!self.porto_forbidden)
-               if (weapon_prepareattack(0, cvar("g_balance_porto_primary_refire")))
+               if (weapon_prepareattack(0, autocvar_g_balance_porto_primary_refire))
                {
                        W_Porto_Attack();
-                       weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_porto_primary_animtime"), w_ready);
+                       weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_porto_primary_animtime, w_ready);
                }
        }
        else if (req == WR_PRECACHE)
index 969f54bdbe8a4cda2521280df35b303f02b8d5d3..a5b64c4bf0ecf9b76bed402d651750c871e08b13 100644 (file)
@@ -27,11 +27,11 @@ void W_Rocket_Explode ()
        self.event_damage = SUB_Null;
        self.takedamage = DAMAGE_NO;
 
-       RadiusDamage (self, self.owner, cvar("g_balance_rocketlauncher_damage"), cvar("g_balance_rocketlauncher_edgedamage"), cvar("g_balance_rocketlauncher_radius"), world, cvar("g_balance_rocketlauncher_force"), self.projectiledeathtype, other);
+       RadiusDamage (self, self.owner, autocvar_g_balance_rocketlauncher_damage, autocvar_g_balance_rocketlauncher_edgedamage, autocvar_g_balance_rocketlauncher_radius, world, autocvar_g_balance_rocketlauncher_force, self.projectiledeathtype, other);
 
        if (self.owner.weapon == WEP_ROCKET_LAUNCHER)
        {
-               if(self.owner.ammo_rockets < cvar("g_balance_rocketlauncher_ammo"))
+               if(self.owner.ammo_rockets < autocvar_g_balance_rocketlauncher_ammo)
                {
                        self.owner.cnt = WEP_ROCKET_LAUNCHER;
                        ATTACK_FINISHED(self.owner) = time;
@@ -48,11 +48,11 @@ void W_Rocket_DoRemoteExplode ()
        self.event_damage = SUB_Null;
        self.takedamage = DAMAGE_NO;
 
-       RadiusDamage (self, self.owner, cvar("g_balance_rocketlauncher_remote_damage"), cvar("g_balance_rocketlauncher_remote_edgedamage"), cvar("g_balance_rocketlauncher_remote_radius"), world, cvar("g_balance_rocketlauncher_remote_force"), self.projectiledeathtype | HITTYPE_BOUNCE, world);
+       RadiusDamage (self, self.owner, autocvar_g_balance_rocketlauncher_remote_damage, autocvar_g_balance_rocketlauncher_remote_edgedamage, autocvar_g_balance_rocketlauncher_remote_radius, world, autocvar_g_balance_rocketlauncher_remote_force, self.projectiledeathtype | HITTYPE_BOUNCE, world);
 
        if (self.owner.weapon == WEP_ROCKET_LAUNCHER)
        {
-               if(self.owner.ammo_rockets < cvar("g_balance_rocketlauncher_ammo"))
+               if(self.owner.ammo_rockets < autocvar_g_balance_rocketlauncher_ammo)
                {
                        self.owner.cnt = WEP_ROCKET_LAUNCHER;
                        ATTACK_FINISHED(self.owner) = time;
@@ -121,7 +121,7 @@ void W_Rocket_RemoteExplode()
        {
                if((self.spawnshieldtime >= 0)
                        ? (time >= self.spawnshieldtime) // timer
-                       : (vlen(NearestPointOnBox(self.owner, self.origin) - self.origin) > cvar("g_balance_rocketlauncher_remote_radius")) // safety device
+                       : (vlen(NearestPointOnBox(self.owner, self.origin) - self.origin) > autocvar_g_balance_rocketlauncher_remote_radius) // safety device
                )
                {
                        W_Rocket_DoRemoteExplode();
@@ -169,9 +169,9 @@ void W_Rocket_Think (void)
 
        // accelerate
        makevectors(self.angles_x * '-1 0 0' + self.angles_y * '0 1 0');
-       velspeed = cvar("g_balance_rocketlauncher_speed") * g_weaponspeedfactor - (self.velocity * v_forward);
+       velspeed = autocvar_g_balance_rocketlauncher_speed * g_weaponspeedfactor - (self.velocity * v_forward);
        if (velspeed > 0)
-               self.velocity = self.velocity + v_forward * min(cvar("g_balance_rocketlauncher_speedaccel") * g_weaponspeedfactor * frametime, velspeed);
+               self.velocity = self.velocity + v_forward * min(autocvar_g_balance_rocketlauncher_speedaccel * g_weaponspeedfactor * frametime, velspeed);
 
        // laser guided, or remote detonation
        if (self.owner.weapon == WEP_ROCKET_LAUNCHER)
@@ -179,11 +179,11 @@ void W_Rocket_Think (void)
                if(self == self.owner.lastrocket)
                if not(self.owner.rl_release)
                if not(self.BUTTON_ATCK2)
-               if(cvar("g_balance_rocketlauncher_guiderate"))
+               if(autocvar_g_balance_rocketlauncher_guiderate)
                if(time > self.pushltime)
                if(self.owner.deadflag == DEAD_NO)
                {
-                       f = cvar("g_balance_rocketlauncher_guideratedelay");
+                       f = autocvar_g_balance_rocketlauncher_guideratedelay;
                        if(f)
                                f = bound(0, (time - self.pushltime) / f, 1);
                        else
@@ -198,8 +198,8 @@ void W_Rocket_Think (void)
 
                        // now it gets tricky... we want to move like some curve to approximate the target direction
                        // but we are limiting the rate at which we can turn!
-                       goal = desiredorigin + ((self.origin - desiredorigin) * desireddir + cvar("g_balance_rocketlauncher_guidegoal")) * desireddir;
-                       newdir = rocket_steerto(olddir, normalize(goal - self.origin), cos(cvar("g_balance_rocketlauncher_guiderate") * f * frametime * DEG2RAD));
+                       goal = desiredorigin + ((self.origin - desiredorigin) * desireddir + autocvar_g_balance_rocketlauncher_guidegoal) * desireddir;
+                       newdir = rocket_steerto(olddir, normalize(goal - self.origin), cos(autocvar_g_balance_rocketlauncher_guiderate * f * frametime * DEG2RAD));
 
                        self.velocity = newdir * velspeed;
                        self.angles = vectoangles(self.velocity);
@@ -249,26 +249,26 @@ void W_Rocket_Attack (void)
        local entity flash;
 
        if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
-               self.ammo_rockets = self.ammo_rockets - cvar("g_balance_rocketlauncher_ammo");
+               self.ammo_rockets = self.ammo_rockets - autocvar_g_balance_rocketlauncher_ammo;
 
-       W_SetupShot_ProjectileSize (self, '-3 -3 -3', '3 3 3', FALSE, 5, "weapons/rocket_fire.wav", CHAN_WEAPON, cvar("g_balance_rocketlauncher_damage"));
+       W_SetupShot_ProjectileSize (self, '-3 -3 -3', '3 3 3', FALSE, 5, "weapons/rocket_fire.wav", CHAN_WEAPON, autocvar_g_balance_rocketlauncher_damage);
        pointparticles(particleeffectnum("rocketlauncher_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
 
        missile = WarpZone_RefSys_SpawnSameRefSys(self);
        missile.owner = self;
        self.lastrocket = missile;
-       if(cvar("g_balance_rocketlauncher_detonatedelay") >= 0)
-               missile.spawnshieldtime = time + cvar("g_balance_rocketlauncher_detonatedelay");
+       if(autocvar_g_balance_rocketlauncher_detonatedelay >= 0)
+               missile.spawnshieldtime = time + autocvar_g_balance_rocketlauncher_detonatedelay;
        else
                missile.spawnshieldtime = -1;
-       missile.pushltime = time + cvar("g_balance_rocketlauncher_guidedelay");
+       missile.pushltime = time + autocvar_g_balance_rocketlauncher_guidedelay;
        missile.classname = "rocket";
        missile.bot_dodge = TRUE;
-       missile.bot_dodgerating = cvar("g_balance_rocketlauncher_damage") * 2; // * 2 because it can be detonated inflight which makes it even more dangerous
+       missile.bot_dodgerating = autocvar_g_balance_rocketlauncher_damage * 2; // * 2 because it can be detonated inflight which makes it even more dangerous
 
        missile.takedamage = DAMAGE_YES;
-       missile.damageforcescale = cvar("g_balance_rocketlauncher_damageforcescale");
-       missile.health = cvar("g_balance_rocketlauncher_health");
+       missile.damageforcescale = autocvar_g_balance_rocketlauncher_damageforcescale;
+       missile.health = autocvar_g_balance_rocketlauncher_health;
        missile.event_damage = W_Rocket_Damage;
 
        missile.movetype = MOVETYPE_FLY;
@@ -277,16 +277,16 @@ void W_Rocket_Attack (void)
        setsize (missile, '-3 -3 -3', '3 3 3'); // give it some size so it can be shot
 
        setorigin (missile, w_shotorg - v_forward * 3); // move it back so it hits the wall at the right point
-       W_SetupProjectileVelocity(missile, cvar("g_balance_rocketlauncher_speedstart"), 0);
+       W_SetupProjectileVelocity(missile, autocvar_g_balance_rocketlauncher_speedstart, 0);
        missile.angles = vectoangles (missile.velocity);
 
        missile.touch = W_Rocket_Touch;
        missile.think = W_Rocket_Think;
        missile.nextthink = time;
-       missile.cnt = time + cvar("g_balance_rocketlauncher_lifetime");
+       missile.cnt = time + autocvar_g_balance_rocketlauncher_lifetime;
        missile.flags = FL_PROJECTILE;
 
-       CSQCProjectile(missile, cvar("g_balance_rocketlauncher_guiderate") == 0 && cvar("g_balance_rocketlauncher_speedaccel") == 0, PROJECTILE_ROCKET, FALSE); // because of fly sound
+       CSQCProjectile(missile, autocvar_g_balance_rocketlauncher_guiderate == 0 && autocvar_g_balance_rocketlauncher_speedaccel == 0, PROJECTILE_ROCKET, FALSE); // because of fly sound
 
        // muzzle flash for 1st person view
        flash = spawn ();
@@ -308,16 +308,16 @@ float w_rlauncher(float req)
        if (req == WR_AIM)
        {
                // aim and decide to fire if appropriate
-               self.BUTTON_ATCK = bot_aim(cvar("g_balance_rocketlauncher_speed"), 0, cvar("g_balance_rocketlauncher_lifetime"), FALSE);
+               self.BUTTON_ATCK = bot_aim(autocvar_g_balance_rocketlauncher_speed, 0, autocvar_g_balance_rocketlauncher_lifetime, FALSE);
                if(skill >= 2) // skill 0 and 1 bots won't detonate rockets!
                {
                        // decide whether to detonate rockets
                        local entity missile, targetlist, targ;
                        local float edgedamage, coredamage, edgeradius, recipricoledgeradius, d;
                        local float selfdamage, teamdamage, enemydamage;
-                       edgedamage = cvar("g_balance_rocketlauncher_edgedamage");
-                       coredamage = cvar("g_balance_rocketlauncher_damage");
-                       edgeradius = cvar("g_balance_rocketlauncher_radius");
+                       edgedamage = autocvar_g_balance_rocketlauncher_edgedamage;
+                       coredamage = autocvar_g_balance_rocketlauncher_damage;
+                       edgeradius = autocvar_g_balance_rocketlauncher_radius;
                        recipricoledgeradius = 1 / edgeradius;
                        selfdamage = 0;
                        teamdamage = 0;
@@ -350,7 +350,7 @@ float w_rlauncher(float req)
                        local float desirabledamage;
                        desirabledamage = enemydamage;
                        if (time > self.invincible_finished && time > self.spawnshieldtime)
-                               desirabledamage = desirabledamage - selfdamage * cvar("g_balance_selfdamagepercent");
+                               desirabledamage = desirabledamage - selfdamage * autocvar_g_balance_selfdamagepercent;
                        if (teams_matter && self.team)
                                desirabledamage = desirabledamage - teamdamage;
 
@@ -404,11 +404,11 @@ float w_rlauncher(float req)
        {
                if (self.BUTTON_ATCK)
                {
-                       if(self.rl_release || cvar("g_balance_rocketlauncher_guidestop"))
-                       if(weapon_prepareattack(0, cvar("g_balance_rocketlauncher_refire")))
+                       if(self.rl_release || autocvar_g_balance_rocketlauncher_guidestop)
+                       if(weapon_prepareattack(0, autocvar_g_balance_rocketlauncher_refire))
                        {
                                W_Rocket_Attack();
-                               weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_rocketlauncher_animtime"), w_ready);
+                               weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_rocketlauncher_animtime, w_ready);
                                self.rl_release = 0;
                        }
                }
@@ -449,7 +449,7 @@ float w_rlauncher(float req)
        {
                // don't switch while guiding a missile
                if ((ATTACK_FINISHED(self) <= time || self.weapon != WEP_ROCKET_LAUNCHER)
-                       && self.ammo_rockets < cvar("g_balance_rocketlauncher_ammo"))
+                       && self.ammo_rockets < autocvar_g_balance_rocketlauncher_ammo)
                        return FALSE;
        }
        else if (req == WR_CHECKAMMO2)
index 60c960d28a3649d4b211add1f198f9a7798df02c..4ab7f4f22e34dc0a215bb8c54cc5bf4967a6c4ed 100644 (file)
@@ -8,7 +8,7 @@ REGISTER_WEAPON(SEEKER, w_seeker, IT_ROCKETS, 9, WEP_FLAG_NORMAL | WEP_TYPE_SPLA
 void Seeker_Missile_Explode ()
 {
        self.event_damage = SUB_Null;
-       RadiusDamage (self, self.owner, cvar("g_balance_seeker_missile_damage"), cvar("g_balance_seeker_missile_edgedamage"), cvar("g_balance_seeker_missile_radius"), world, cvar("g_balance_seeker_missile_force"), self.projectiledeathtype, other);
+       RadiusDamage (self, self.owner, autocvar_g_balance_seeker_missile_damage, autocvar_g_balance_seeker_missile_edgedamage, autocvar_g_balance_seeker_missile_radius, world, autocvar_g_balance_seeker_missile_force, self.projectiledeathtype, other);
 
        remove (self);
 }
@@ -36,9 +36,9 @@ void Seeker_Missile_Think()
 
        spd = vlen(self.velocity);
        spd = bound(
-               spd - cvar("g_balance_seeker_missile_decel") * frametime,
-               cvar("g_balance_seeker_missile_speed_max"),
-               spd + cvar("g_balance_seeker_missile_accel") * frametime
+               spd - autocvar_g_balance_seeker_missile_decel * frametime,
+               autocvar_g_balance_seeker_missile_speed_max,
+               spd + autocvar_g_balance_seeker_missile_accel * frametime
        );
 
        if (self.enemy != world)
@@ -49,13 +49,13 @@ void Seeker_Missile_Think()
        {
                e               = self.enemy;
                eorg            = 0.5 * (e.absmin + e.absmax);
-               turnrate        = cvar("g_balance_seeker_missile_turnrate"); // how fast to turn
+               turnrate        = autocvar_g_balance_seeker_missile_turnrate; // how fast to turn
                desireddir      = normalize(eorg - self.origin);
                olddir          = normalize(self.velocity); // get my current direction
                dist            = vlen(eorg - self.origin);
 
                // Do evasive maneuvers for world objects? ( this should be a cpu hog. :P )
-               if (cvar("g_balance_seeker_missile_smart") && (dist > cvar("g_balance_seeker_missile_smart_mindist")))
+               if (autocvar_g_balance_seeker_missile_smart && (dist > autocvar_g_balance_seeker_missile_smart_mindist))
                {
                        // Is it a better idea (shorter distance) to trace to the target itself?
                        if ( vlen(self.origin + olddir * self.wait) < dist)
@@ -64,7 +64,7 @@ void Seeker_Missile_Think()
                                traceline(self.origin, eorg, FALSE, self);
 
                        // Setup adaptive tracelength
-                       self.wait = bound(cvar("g_balance_seeker_missile_smart_trace_min"), vlen(self.origin - trace_endpos), self.wait = cvar("g_balance_seeker_missile_smart_trace_max"));
+                       self.wait = bound(autocvar_g_balance_seeker_missile_smart_trace_min, vlen(self.origin - trace_endpos), self.wait = autocvar_g_balance_seeker_missile_smart_trace_max);
 
                        // Calc how important it is that we turn and add this to the desierd (enemy) dir.
                        desireddir  = normalize(((trace_plane_normal * (1 - trace_fraction)) + (desireddir * trace_fraction)) * 0.5);
@@ -75,13 +75,13 @@ void Seeker_Missile_Think()
        }
 
        // Proxy
-       if (cvar("g_balance_seeker_missile_proxy"))
+       if (autocvar_g_balance_seeker_missile_proxy)
        {
-               if ( dist <= cvar("g_balance_seeker_missile_proxy_maxrange"))
+               if ( dist <= autocvar_g_balance_seeker_missile_proxy_maxrange)
                {
                        if (self.autoswitch == 0)
                        {
-                               self.autoswitch = time + cvar("g_balance_seeker_missile_proxy_delay");
+                               self.autoswitch = time + autocvar_g_balance_seeker_missile_proxy_delay;
                        }
                        else
                        {
@@ -144,7 +144,7 @@ void Seeker_Missile_Animate()
                self.think           = Seeker_Missile_Think;
                self.nextthink       = time;// + cvar("g_balance_seeker_missile_activate_delay"); // cant dealy with csqc projectiles
 
-               if (cvar("g_balance_seeker_missile_proxy"))
+               if (autocvar_g_balance_seeker_missile_proxy)
                        self.movetype    = MOVETYPE_BOUNCEMISSILE;
                else
                        self.movetype    = MOVETYPE_FLYMISSILE;
@@ -159,7 +159,7 @@ void Seeker_Fire_Missile(vector f_diff)
        local entity missile;
 
        if not(self.owner.items & IT_UNLIMITED_WEAPON_AMMO)
-               self.ammo_rockets = self.ammo_rockets - cvar("g_balance_seeker_missile_ammo");
+               self.ammo_rockets = self.ammo_rockets - autocvar_g_balance_seeker_missile_ammo;
 
        makevectors(self.v_angle);
        W_SetupShot_ProjectileSize (self, '-2 -2 -2', '2 2 2', FALSE, 2, "weapons/seeker_fire.wav", CHAN_WEAPON, 0);
@@ -172,19 +172,19 @@ void Seeker_Fire_Missile(vector f_diff)
        missile.owner           = self;
        missile.classname       = "seeker_missile";
        missile.bot_dodge       = TRUE;
-       missile.bot_dodgerating = cvar("g_balance_seeker_missile_damage");
+       missile.bot_dodgerating = autocvar_g_balance_seeker_missile_damage;
 
        missile.think           = Seeker_Missile_Think;
        missile.touch           = Seeker_Missile_Touch;
        missile.event_damage    = Seeker_Missile_Damage;
        missile.nextthink       = time;// + 0.2;// + cvar("g_balance_seeker_missile_activate_delay");
-       missile.cnt             = time + cvar("g_balance_seeker_missile_lifetime");
+       missile.cnt             = time + autocvar_g_balance_seeker_missile_lifetime;
        missile.enemy           = self.enemy;
        missile.solid           = SOLID_BBOX;
        missile.scale           = 2;
        missile.takedamage      = DAMAGE_YES;
-       missile.health          = cvar("g_balance_seeker_missile_health");
-       missile.damageforcescale = cvar("g_balance_seeker_missile_damageforcescale");
+       missile.health          = autocvar_g_balance_seeker_missile_health;
+       missile.damageforcescale = autocvar_g_balance_seeker_missile_damageforcescale;
        missile.projectiledeathtype = WEP_SEEKER;
        //missile.think           = Seeker_Missile_Animate; // csqc projectiles.
 
@@ -208,13 +208,13 @@ void Seeker_Vollycontroler_Think()
        entity oldself,oldenemy;
        self.cnt = self.cnt - 1;
 
-       if((!(self.owner.items & IT_UNLIMITED_AMMO) && self.owner.ammo_rockets < cvar("g_balance_seeker_missile_ammo")) || (self.cnt <= -1) || (self.owner.deadflag != DEAD_NO) || (self.owner.switchweapon != WEP_SEEKER))
+       if((!(self.owner.items & IT_UNLIMITED_AMMO) && self.owner.ammo_rockets < autocvar_g_balance_seeker_missile_ammo) || (self.cnt <= -1) || (self.owner.deadflag != DEAD_NO) || (self.owner.switchweapon != WEP_SEEKER))
        {
                remove(self);
                return;
        }
 
-       self.nextthink = time + cvar("g_balance_seeker_missile_delay");
+       self.nextthink = time + autocvar_g_balance_seeker_missile_delay;
 
        oldself = self;
        self = self.owner;
@@ -280,7 +280,7 @@ void Seeker_Tag_Touch()
        if (other.takedamage == DAMAGE_AIM && other.deadflag == DEAD_NO)
        {               
                e           = spawn();
-               e.cnt       = cvar("g_balance_seeker_missile_count");
+               e.cnt       = autocvar_g_balance_seeker_missile_count;
                e.owner     = self.owner;
                e.enemy     = other;
                e.think     = Seeker_Vollycontroler_Think;
@@ -295,9 +295,9 @@ void Seeker_Fire_Tag()
 {
        local entity missile;
        if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
-               self.ammo_rockets = self.ammo_rockets - cvar("g_balance_seeker_tag_ammo");
+               self.ammo_rockets = self.ammo_rockets - autocvar_g_balance_seeker_tag_ammo;
 
-       W_SetupShot_ProjectileSize (self, '-2 -2 -2', '2 2 2', FALSE, 2, "weapons/tag_fire.wav", CHAN_WEAPON, cvar("g_balance_seeker_missile_damage") * cvar("g_balance_seeker_missile_count"));
+       W_SetupShot_ProjectileSize (self, '-2 -2 -2', '2 2 2', FALSE, 2, "weapons/tag_fire.wav", CHAN_WEAPON, autocvar_g_balance_seeker_missile_damage * autocvar_g_balance_seeker_missile_count);
 
        missile                 = spawn();
        missile.owner           = self;
@@ -306,15 +306,15 @@ void Seeker_Fire_Tag()
        missile.bot_dodgerating = 50;
        missile.touch           = Seeker_Tag_Touch;
        missile.think           = SUB_Remove;
-       missile.nextthink       = time + cvar("g_balance_seeker_tag_lifetime");
+       missile.nextthink       = time + autocvar_g_balance_seeker_tag_lifetime;
        missile.movetype        = MOVETYPE_FLY;
        missile.solid           = SOLID_BBOX;
        missile.owner           = self;
 
        missile.takedamage       = DAMAGE_YES;
        missile.event_damage    = Seeker_Tag_Explode;
-       missile.health          = cvar("g_balance_seeker_tag_health");
-       missile.damageforcescale = cvar("g_balance_seeker_tag_damageforcescale");
+       missile.health          = autocvar_g_balance_seeker_tag_health;
+       missile.damageforcescale = autocvar_g_balance_seeker_tag_damageforcescale;
 
        setorigin (missile, w_shotorg);
        setsize (missile, '-2 -2 -2', '2 2 2');
@@ -335,7 +335,7 @@ void Seeker_Flac_Explode ()
 {
        self.event_damage = SUB_Null;
 
-       RadiusDamage (self, self.owner, cvar("g_balance_seeker_flac_damage"), cvar("g_balance_seeker_flac_edgedamage"), cvar("g_balance_seeker_flac_radius"), world, cvar("g_balance_seeker_flac_force"), self.projectiledeathtype, other);
+       RadiusDamage (self, self.owner, autocvar_g_balance_seeker_flac_damage, autocvar_g_balance_seeker_flac_edgedamage, autocvar_g_balance_seeker_flac_radius, world, autocvar_g_balance_seeker_flac_force, self.projectiledeathtype, other);
 
        remove (self);
 }
@@ -354,7 +354,7 @@ void Seeker_Fire_Flac()
        float c;
 
        if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
-               self.ammo_rockets = self.ammo_rockets - cvar("g_balance_seeker_flac_ammo");
+               self.ammo_rockets = self.ammo_rockets - autocvar_g_balance_seeker_flac_ammo;
 
        c = mod(self.bulletcounter, 4);
        switch(c)
@@ -373,7 +373,7 @@ void Seeker_Fire_Flac()
                        f_diff = '+1.25 +3.75 0';
                        break;
        }
-       W_SetupShot_ProjectileSize (self, '-2 -2 -2', '2 2 2', FALSE, 2, "weapons/flac_fire.wav", CHAN_WEAPON, cvar("g_balance_seeker_flac_damage"));
+       W_SetupShot_ProjectileSize (self, '-2 -2 -2', '2 2 2', FALSE, 2, "weapons/flac_fire.wav", CHAN_WEAPON, autocvar_g_balance_seeker_flac_damage);
        w_shotorg += f_diff;
 
        pointparticles(particleeffectnum("hagar_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
@@ -382,11 +382,11 @@ void Seeker_Fire_Flac()
        missile.owner                   = missile.realowner = self;
        missile.classname               = "missile";
        missile.bot_dodge               = TRUE;
-       missile.bot_dodgerating = cvar("g_balance_seeker_flac_damage");
+       missile.bot_dodgerating = autocvar_g_balance_seeker_flac_damage;
        missile.touch                   = Seeker_Flac_Explode;
        missile.use                     = Seeker_Flac_Explode; 
        missile.think                   = adaptor_think2use_hittype_splash;
-       missile.nextthink               = time + cvar("g_balance_seeker_flac_lifetime") + cvar("g_balance_seeker_flac_lifetime_rand");
+       missile.nextthink               = time + autocvar_g_balance_seeker_flac_lifetime + autocvar_g_balance_seeker_flac_lifetime_rand;
        missile.solid                   = SOLID_BBOX;
        missile.movetype                = MOVETYPE_FLY; 
        missile.projectiledeathtype = WEP_SEEKER;
@@ -414,22 +414,22 @@ void spawnfunc_weapon_seeker (void)
 float w_seeker(float req)
 {
        if (req == WR_AIM)
-               self.BUTTON_ATCK = bot_aim(cvar("g_balance_seeker_tag_speed"), 0, 20, FALSE);
+               self.BUTTON_ATCK = bot_aim(autocvar_g_balance_seeker_tag_speed, 0, 20, FALSE);
 
        else if (req == WR_THINK)
        {
                if (self.BUTTON_ATCK)
-                       if (weapon_prepareattack(0, cvar("g_balance_seeker_tag_refire")))
+                       if (weapon_prepareattack(0, autocvar_g_balance_seeker_tag_refire))
                        {
                                Seeker_Fire_Tag();
-                               weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_seeker_tag_animtime"), w_ready);
+                               weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_seeker_tag_animtime, w_ready);
                        }
 
                if (self.BUTTON_ATCK2)
-                       if (weapon_prepareattack(1, cvar("g_balance_seeker_flac_refire")))
+                       if (weapon_prepareattack(1, autocvar_g_balance_seeker_flac_refire))
                        {
                                Seeker_Fire_Flac();
-                               weapon_thinkf(WFRAME_FIRE2, cvar("g_balance_seeker_flac_animtime"), w_ready);
+                               weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_seeker_flac_animtime, w_ready);
                        }
 
        }
@@ -445,9 +445,9 @@ float w_seeker(float req)
        else if (req == WR_SETUP)
                weapon_setup(WEP_SEEKER);
        else if (req == WR_CHECKAMMO1)
-               return self.ammo_rockets >= cvar("g_balance_seeker_tag_ammo") + cvar("g_balance_seeker_missile_ammo");
+               return self.ammo_rockets >= autocvar_g_balance_seeker_tag_ammo + autocvar_g_balance_seeker_missile_ammo;
        else if (req == WR_CHECKAMMO2)
-               return self.ammo_rockets >= cvar("g_balance_seeker_flac_ammo");
+               return self.ammo_rockets >= autocvar_g_balance_seeker_flac_ammo;
        return TRUE;
 };
 #endif
index 17bce7f77aa497020ff33486f38b47e0e30d834c..d9bb056ee6c6c8e65678509ba6c4ff1b91041411 100644 (file)
@@ -14,25 +14,25 @@ void W_Shotgun_Attack (void)
        float   bulletconstant;
        local entity flash;
 
-       ammoamount = cvar("g_balance_shotgun_primary_ammo");
-       bullets = cvar("g_balance_shotgun_primary_bullets");
-       d = cvar("g_balance_shotgun_primary_damage");
-       f = cvar("g_balance_shotgun_primary_force");
-       spread = cvar("g_balance_shotgun_primary_spread");
-       bulletspeed = cvar("g_balance_shotgun_primary_speed");
-       bulletconstant = cvar("g_balance_shotgun_primary_bulletconstant");
-
-       W_SetupShot (self, cvar("g_antilag_bullets") && bulletspeed >= cvar("g_antilag_bullets"), 5, "weapons/shotgun_fire.wav", CHAN_WEAPON, d * bullets);
+       ammoamount = autocvar_g_balance_shotgun_primary_ammo;
+       bullets = autocvar_g_balance_shotgun_primary_bullets;
+       d = autocvar_g_balance_shotgun_primary_damage;
+       f = autocvar_g_balance_shotgun_primary_force;
+       spread = autocvar_g_balance_shotgun_primary_spread;
+       bulletspeed = autocvar_g_balance_shotgun_primary_speed;
+       bulletconstant = autocvar_g_balance_shotgun_primary_bulletconstant;
+
+       W_SetupShot (self, autocvar_g_antilag_bullets && bulletspeed >= autocvar_g_antilag_bullets, 5, "weapons/shotgun_fire.wav", CHAN_WEAPON, d * bullets);
        for (sc = 0;sc < bullets;sc = sc + 1)
                fireBallisticBullet(w_shotorg, w_shotdir, spread, bulletspeed, 5, d, 0, f, WEP_SHOTGUN, 0, 1, bulletconstant);
        endFireBallisticBullet();
        if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
                self.ammo_shells = self.ammo_shells - ammoamount;
 
-       pointparticles(particleeffectnum("shotgun_muzzleflash"), w_shotorg, w_shotdir * 1000, cvar("g_balance_shotgun_primary_ammo"));
+       pointparticles(particleeffectnum("shotgun_muzzleflash"), w_shotorg, w_shotdir * 1000, autocvar_g_balance_shotgun_primary_ammo);
 
        // casing code
-       if (cvar("g_casings") >= 1)
+       if (autocvar_g_casings >= 1)
                for (sc = 0;sc < ammoamount;sc = sc + 1)
                        SpawnCasing (((random () * 50 + 50) * v_right) - (v_forward * (random () * 25 + 25)) - ((random () * 5 - 30) * v_up), 2, vectoangles(v_forward),'0 250 0', 100, 1, self);
 
@@ -58,9 +58,9 @@ void shotgun_meleethink (void)
 
        // perform trace
        float f;
-       f = (self.cnt + cvar("g_balance_shotgun_secondary_melee_time") - time) / cvar("g_balance_shotgun_secondary_melee_time") * 2 - 1;
+       f = (self.cnt + autocvar_g_balance_shotgun_secondary_melee_time - time) / autocvar_g_balance_shotgun_secondary_melee_time * 2 - 1;
        vector targpos;
-       targpos = self.owner.origin + self.owner.view_ofs + angle * cvar("g_balance_shotgun_secondary_melee_range") + v_right * f * cvar("g_balance_shotgun_secondary_melee_swing") + v_up * f * cvar("g_balance_shotgun_secondary_melee_swing");
+       targpos = self.owner.origin + self.owner.view_ofs + angle * autocvar_g_balance_shotgun_secondary_melee_range + v_right * f * autocvar_g_balance_shotgun_secondary_melee_swing + v_up * f * autocvar_g_balance_shotgun_secondary_melee_swing;
 
        WarpZone_traceline_antilag(self.owner, self.owner.origin + self.owner.view_ofs, targpos, FALSE, self.owner, ANTILAG_LATENCY(self.owner));
 
@@ -68,13 +68,13 @@ void shotgun_meleethink (void)
        if(trace_fraction < 1 && trace_ent.takedamage == DAMAGE_AIM && (trace_ent.classname == "player" || trace_ent.classname == "body"))
        {
                vector force;
-               force = angle * cvar("g_balance_shotgun_secondary_force");
+               force = angle * autocvar_g_balance_shotgun_secondary_force;
                if(accuracy_isgooddamage(self.owner, trace_ent))
-                       accuracy_add(self.owner, WEP_SHOTGUN, 0, cvar("g_balance_shotgun_secondary_damage") * min(1, f + 1));
-               Damage (trace_ent, self.owner, self.owner, cvar("g_balance_shotgun_secondary_damage") * min(1, f + 1), WEP_SHOTGUN | HITTYPE_SECONDARY , self.owner.origin + self.owner.view_ofs, force);
+                       accuracy_add(self.owner, WEP_SHOTGUN, 0, autocvar_g_balance_shotgun_secondary_damage * min(1, f + 1));
+               Damage (trace_ent, self.owner, self.owner, autocvar_g_balance_shotgun_secondary_damage * min(1, f + 1), WEP_SHOTGUN | HITTYPE_SECONDARY , self.owner.origin + self.owner.view_ofs, force);
                remove(self);
        }
-       else if(time >= self.cnt + cvar("g_balance_shotgun_secondary_melee_time")) // missed, remove ent
+       else if(time >= self.cnt + autocvar_g_balance_shotgun_secondary_melee_time) // missed, remove ent
                remove(self);
        else // continue swinging the weapon in hope of hitting someone :)
                self.nextthink = time;
@@ -83,14 +83,14 @@ void shotgun_meleethink (void)
 void W_Shotgun_Attack2 (void)
 {
        sound (self, CHAN_PROJECTILE, "weapons/shotgun_melee.wav", VOL_BASE, ATTN_NORM);
-       weapon_thinkf(WFRAME_FIRE2, cvar("g_balance_shotgun_secondary_animtime"), w_ready);
+       weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_shotgun_secondary_animtime, w_ready);
 
        entity meleetemp;
        meleetemp = spawn();
        meleetemp.owner = self;
        meleetemp.think = shotgun_meleethink;
-       meleetemp.nextthink = time + cvar("g_balance_shotgun_secondary_melee_delay");
-       W_SetupShot_Range(self, TRUE, 0, "", 0, cvar("g_balance_shotgun_secondary_damage"), cvar("g_balance_shotgun_secondary_melee_range"));
+       meleetemp.nextthink = time + autocvar_g_balance_shotgun_secondary_melee_delay;
+       W_SetupShot_Range(self, TRUE, 0, "", 0, autocvar_g_balance_shotgun_secondary_damage, autocvar_g_balance_shotgun_secondary_melee_range);
 }
 
 void spawnfunc_weapon_shotgun(); // defined in t_items.qc
@@ -110,16 +110,16 @@ float w_shotgun(float req)
                {
                        if (time >= self.shotgun_primarytime) // handle refire separately so the secondary can be fired straight after a primary
                        {
-                               if(weapon_prepareattack(0, cvar("g_balance_shotgun_primary_animtime")))
+                               if(weapon_prepareattack(0, autocvar_g_balance_shotgun_primary_animtime))
                                {
                                        W_Shotgun_Attack();
-                                       self.shotgun_primarytime = time + cvar("g_balance_shotgun_primary_refire");
-                                       weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_shotgun_primary_animtime"), w_ready);
+                                       self.shotgun_primarytime = time + autocvar_g_balance_shotgun_primary_refire;
+                                       weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_shotgun_primary_animtime, w_ready);
                                }
                        }
                }
-               if (self.BUTTON_ATCK2 && cvar("g_balance_shotgun_secondary"))
-               if (weapon_prepareattack(1, cvar("g_balance_shotgun_secondary_refire")))
+               if (self.BUTTON_ATCK2 && autocvar_g_balance_shotgun_secondary)
+               if (weapon_prepareattack(1, autocvar_g_balance_shotgun_secondary_refire))
                {
                        // attempt forcing playback of the anim by switching to another anim (that we never play) here...
                        weapon_thinkf(WFRAME_FIRE1, 0, W_Shotgun_Attack2);
@@ -138,7 +138,7 @@ float w_shotgun(float req)
        else if (req == WR_SETUP)
                weapon_setup(WEP_SHOTGUN);
        else if (req == WR_CHECKAMMO1)
-               return self.ammo_shells >= cvar("g_balance_shotgun_primary_ammo");
+               return self.ammo_shells >= autocvar_g_balance_shotgun_primary_ammo;
        else if (req == WR_CHECKAMMO2)
        {
                return TRUE;
index c9cfdc4a49951c1f848394f1c727132717bb5490..1ea9cec973cbc8f7d789c92fc6426bc39c43b082 100644 (file)
@@ -102,7 +102,7 @@ void W_Tuba_NoteThink()
                return;
        }
        self.nextthink = time;
-       dist_mult = cvar("g_balance_tuba_attenuation") / cvar("snd_soundradius");
+       dist_mult = autocvar_g_balance_tuba_attenuation / autocvar_snd_soundradius;
        FOR_EACH_REALCLIENT(e)
        if(e != self.owner)
        {
@@ -131,7 +131,7 @@ void W_Tuba_Attack(float hittype)
 {
        vector o;
        float c, n;
-       W_SetupShot(self, FALSE, 2, "", 0, cvar("g_balance_tuba_damage"));
+       W_SetupShot(self, FALSE, 2, "", 0, autocvar_g_balance_tuba_damage);
        if(self.tuba_notecount)
        {
                self.tuba_notecount = FALSE;
@@ -168,10 +168,10 @@ void W_Tuba_Attack(float hittype)
                Net_LinkEntity(self.tuba_note, FALSE, 0, W_Tuba_NoteSendEntity);
        }
 
-       self.tuba_note.teleport_time = time + cvar("g_balance_tuba_refire") * 2; // so it can get prolonged safely
+       self.tuba_note.teleport_time = time + autocvar_g_balance_tuba_refire * 2; // so it can get prolonged safely
 
-       //sound(self, c, TUBA_NOTE(n), bound(0, VOL_BASE * cvar("g_balance_tuba_volume"), 1), cvar("g_balance_tuba_attenuation"));
-       RadiusDamage(self, self, cvar("g_balance_tuba_damage"), cvar("g_balance_tuba_edgedamage"), cvar("g_balance_tuba_radius"), world, cvar("g_balance_tuba_force"), hittype | WEP_TUBA, world);
+       //sound(self, c, TUBA_NOTE(n), bound(0, VOL_BASE * cvar("g_balance_tuba_volume"), 1), autocvar_g_balance_tuba_attenuation);
+       RadiusDamage(self, self, autocvar_g_balance_tuba_damage, autocvar_g_balance_tuba_edgedamage, autocvar_g_balance_tuba_radius, world, autocvar_g_balance_tuba_force, hittype | WEP_TUBA, world);
 
        o = gettaginfo(self.exteriorweaponentity, 0);
        if(time > self.tuba_smoketime)
@@ -192,7 +192,7 @@ float w_tuba(float req)
        {
                // bots cannot play the Tuba well yet
                // I think they should start with the recorder first
-               if(vlen(self.origin - self.enemy.origin) < cvar("g_balance_tuba_radius"))
+               if(vlen(self.origin - self.enemy.origin) < autocvar_g_balance_tuba_radius)
                {
                        if(random() > 0.5)
                                self.BUTTON_ATCK = 1;
@@ -203,18 +203,18 @@ float w_tuba(float req)
        else if (req == WR_THINK)
        {
                if (self.BUTTON_ATCK)
-               if (weapon_prepareattack(0, cvar("g_balance_tuba_refire")))
+               if (weapon_prepareattack(0, autocvar_g_balance_tuba_refire))
                {
                        W_Tuba_Attack(0);
-                       //weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_tuba_animtime"), w_ready);
-                       weapon_thinkf(WFRAME_IDLE, cvar("g_balance_tuba_animtime"), w_ready);
+                       //weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_tuba_animtime, w_ready);
+                       weapon_thinkf(WFRAME_IDLE, autocvar_g_balance_tuba_animtime, w_ready);
                }
                if (self.BUTTON_ATCK2)
-               if (weapon_prepareattack(1, cvar("g_balance_tuba_refire")))
+               if (weapon_prepareattack(1, autocvar_g_balance_tuba_refire))
                {
                        W_Tuba_Attack(HITTYPE_SECONDARY);
-                       //weapon_thinkf(WFRAME_FIRE2, cvar("g_balance_tuba_animtime"), w_ready);
-                       weapon_thinkf(WFRAME_IDLE, cvar("g_balance_tuba_animtime"), w_ready);
+                       //weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_tuba_animtime, w_ready);
+                       weapon_thinkf(WFRAME_IDLE, autocvar_g_balance_tuba_animtime, w_ready);
                }
                if(self.tuba_note)
                {
index 1b1ab55a211798be1c18930c55d3dad1cd7331ca..2d50143deed1ddad0ca5623cca74363ed66ab9aa 100644 (file)
@@ -46,11 +46,11 @@ void W_Uzi_Attack (float deathtype)
        if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
        {
                if (self.uzi_bulletcounter == 1)
-                       self.ammo_nails = self.ammo_nails - cvar("g_balance_uzi_first_ammo");
+                       self.ammo_nails = self.ammo_nails - autocvar_g_balance_uzi_first_ammo;
                else
-                       self.ammo_nails = self.ammo_nails - cvar("g_balance_uzi_sustained_ammo");
+                       self.ammo_nails = self.ammo_nails - autocvar_g_balance_uzi_sustained_ammo;
        }
-       W_SetupShot (self, cvar("g_antilag_bullets") && cvar("g_balance_uzi_speed") >= cvar("g_antilag_bullets"), 0, "weapons/uzi_fire.wav", CHAN_WEAPON, ((self.uzi_bulletcounter == 1) ? cvar("g_balance_uzi_first_damage") : cvar("g_balance_uzi_sustained_damage")));
+       W_SetupShot (self, autocvar_g_antilag_bullets && autocvar_g_balance_uzi_speed >= autocvar_g_antilag_bullets, 0, "weapons/uzi_fire.wav", CHAN_WEAPON, ((self.uzi_bulletcounter == 1) ? autocvar_g_balance_uzi_first_damage : autocvar_g_balance_uzi_sustained_damage));
        if (!g_norecoil)
        {
                self.punchangle_x = random () - 0.5;
@@ -58,12 +58,12 @@ void W_Uzi_Attack (float deathtype)
        }
 
        // this attack_finished just enforces a cooldown at the end of a burst
-       ATTACK_FINISHED(self) = time + cvar("g_balance_uzi_first_refire") * W_WeaponRateFactor();
+       ATTACK_FINISHED(self) = time + autocvar_g_balance_uzi_first_refire * W_WeaponRateFactor();
 
        if (self.uzi_bulletcounter == 1)
-               fireBallisticBullet(w_shotorg, w_shotdir, cvar("g_balance_uzi_first_spread"), cvar("g_balance_uzi_speed"), 5, cvar("g_balance_uzi_first_damage"), 0, cvar("g_balance_uzi_first_force"), deathtype, 0, 1, cvar("g_balance_uzi_bulletconstant"));
+               fireBallisticBullet(w_shotorg, w_shotdir, autocvar_g_balance_uzi_first_spread, autocvar_g_balance_uzi_speed, 5, autocvar_g_balance_uzi_first_damage, 0, autocvar_g_balance_uzi_first_force, deathtype, 0, 1, autocvar_g_balance_uzi_bulletconstant);
        else
-               fireBallisticBullet(w_shotorg, w_shotdir, cvar("g_balance_uzi_sustained_spread"), cvar("g_balance_uzi_speed"), 5, cvar("g_balance_uzi_sustained_damage"), 0, cvar("g_balance_uzi_sustained_force"), deathtype, 0, 1, cvar("g_balance_uzi_bulletconstant"));
+               fireBallisticBullet(w_shotorg, w_shotdir, autocvar_g_balance_uzi_sustained_spread, autocvar_g_balance_uzi_speed, 5, autocvar_g_balance_uzi_sustained_damage, 0, autocvar_g_balance_uzi_sustained_force, deathtype, 0, 1, autocvar_g_balance_uzi_bulletconstant);
        endFireBallisticBullet();
 
        pointparticles(particleeffectnum("uzi_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
@@ -72,7 +72,7 @@ void W_Uzi_Attack (float deathtype)
        W_AttachToShotorg(self.muzzle_flash, '5 0 0');
 
        // casing code
-       if (cvar("g_casings") >= 2)
+       if (autocvar_g_casings >= 2)
                SpawnCasing (((random () * 50 + 50) * v_right) - (v_forward * (random () * 25 + 25)) - ((random () * 5 - 70) * v_up), 2, vectoangles(v_forward),'0 250 0', 100, 3, self);
 }
 
@@ -94,10 +94,10 @@ void uzi_fire1_02()
                }
                self.uzi_bulletcounter = self.uzi_bulletcounter + 1;
                W_Uzi_Attack(WEP_UZI);
-               weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_uzi_sustained_refire"), uzi_fire1_02);
+               weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_uzi_sustained_refire, uzi_fire1_02);
        }
        else
-               weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_uzi_sustained_refire"), w_ready);
+               weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_uzi_sustained_refire, w_ready);
 }
 
 
@@ -106,11 +106,11 @@ void uzi_mode1_fire_auto()
        float uzi_spread;
        
        if (self.BUTTON_ATCK)
-               weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_uzi_sustained_refire"), uzi_mode1_fire_auto);
+               weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_uzi_sustained_refire, uzi_mode1_fire_auto);
        else
        {
-               ATTACK_FINISHED(self) = time + cvar("g_balance_uzi_first_refire") * W_WeaponRateFactor();
-               weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_uzi_sustained_refire"), w_ready);
+               ATTACK_FINISHED(self) = time + autocvar_g_balance_uzi_first_refire * W_WeaponRateFactor();
+               weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_uzi_sustained_refire, w_ready);
                return;
        }
 
@@ -121,15 +121,15 @@ void uzi_mode1_fire_auto()
                return;
        }
        
-       W_SetupShot (self, cvar("g_antilag_bullets") && cvar("g_balance_uzi_speed") >= cvar("g_antilag_bullets"), 0, "weapons/uzi_fire.wav", CHAN_WEAPON, cvar("g_balance_uzi_sustained_damage"));
+       W_SetupShot (self, autocvar_g_antilag_bullets && autocvar_g_balance_uzi_speed >= autocvar_g_antilag_bullets, 0, "weapons/uzi_fire.wav", CHAN_WEAPON, autocvar_g_balance_uzi_sustained_damage);
        if (!g_norecoil)
        {
                self.punchangle_x = random () - 0.5;
                self.punchangle_y = random () - 0.5;
        }
        
-       uzi_spread = bound(cvar("g_balance_uzi_spread_min"), cvar("g_balance_uzi_spread_min") + (cvar("g_balance_uzi_spread_add") * self.uzi_bulletcounter), cvar("g_balance_uzi_spread_max"));
-       fireBallisticBullet(w_shotorg, w_shotdir, uzi_spread, cvar("g_balance_uzi_speed"), 5, cvar("g_balance_uzi_sustained_damage"), 0, cvar("g_balance_uzi_sustained_force"), WEP_UZI, 0, 1, cvar("g_balance_uzi_bulletconstant"));
+       uzi_spread = bound(autocvar_g_balance_uzi_spread_min, autocvar_g_balance_uzi_spread_min + (autocvar_g_balance_uzi_spread_add * self.uzi_bulletcounter), autocvar_g_balance_uzi_spread_max);
+       fireBallisticBullet(w_shotorg, w_shotdir, uzi_spread, autocvar_g_balance_uzi_speed, 5, autocvar_g_balance_uzi_sustained_damage, 0, autocvar_g_balance_uzi_sustained_force, WEP_UZI, 0, 1, autocvar_g_balance_uzi_bulletconstant);
        endFireBallisticBullet();
        
        self.uzi_bulletcounter = self.uzi_bulletcounter + 1;
@@ -139,24 +139,24 @@ void uzi_mode1_fire_auto()
        UziFlash();
        W_AttachToShotorg(self.muzzle_flash, '5 0 0');
        
-       if (cvar("g_casings") >= 2) // casing code
+       if (autocvar_g_casings >= 2) // casing code
                SpawnCasing (((random () * 50 + 50) * v_right) - (v_forward * (random () * 25 + 25)) - ((random () * 5 - 70) * v_up), 2, vectoangles(v_forward),'0 250 0', 100, 3, self);
        
        if not(self.items & IT_UNLIMITED_WEAPON_AMMO)   
-               self.ammo_nails = self.ammo_nails - cvar("g_balance_uzi_sustained_ammo");
+               self.ammo_nails = self.ammo_nails - autocvar_g_balance_uzi_sustained_ammo;
        
 }
 
 void uzi_mode1_fire_burst()
 {
-       W_SetupShot (self, cvar("g_antilag_bullets") && cvar("g_balance_uzi_speed") >= cvar("g_antilag_bullets"), 0, "weapons/uzi_fire.wav", CHAN_WEAPON, cvar("g_balance_uzi_sustained_damage"));
+       W_SetupShot (self, autocvar_g_antilag_bullets && autocvar_g_balance_uzi_speed >= autocvar_g_antilag_bullets, 0, "weapons/uzi_fire.wav", CHAN_WEAPON, autocvar_g_balance_uzi_sustained_damage);
        if (!g_norecoil)
        {
                self.punchangle_x = random () - 0.5;
                self.punchangle_y = random () - 0.5;
        }
        
-       fireBallisticBullet(w_shotorg, w_shotdir, cvar("g_balance_uzi_burst_spread"), cvar("g_balance_uzi_speed"), 5, cvar("g_balance_uzi_sustained_damage"), 0, cvar("g_balance_uzi_sustained_force"), WEP_UZI, 0, 1, cvar("g_balance_uzi_bulletconstant"));
+       fireBallisticBullet(w_shotorg, w_shotdir, autocvar_g_balance_uzi_burst_spread, autocvar_g_balance_uzi_speed, 5, autocvar_g_balance_uzi_sustained_damage, 0, autocvar_g_balance_uzi_sustained_force, WEP_UZI, 0, 1, autocvar_g_balance_uzi_bulletconstant);
        endFireBallisticBullet();
        
        
@@ -165,15 +165,15 @@ void uzi_mode1_fire_burst()
        UziFlash();
        W_AttachToShotorg(self.muzzle_flash, '5 0 0');
        
-       if (cvar("g_casings") >= 2) // casing code
+       if (autocvar_g_casings >= 2) // casing code
                SpawnCasing (((random () * 50 + 50) * v_right) - (v_forward * (random () * 25 + 25)) - ((random () * 5 - 70) * v_up), 2, vectoangles(v_forward),'0 250 0', 100, 3, self);
 
        self.uzi_bulletcounter = self.uzi_bulletcounter + 1;
        if (self.uzi_bulletcounter == 0)
-               weapon_thinkf(WFRAME_FIRE2, cvar("g_balance_uzi_burst_refire2"), w_ready);
+               weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_uzi_burst_refire2, w_ready);
        else
        {
-               weapon_thinkf(WFRAME_FIRE2, cvar("g_balance_uzi_burst_refire"), uzi_mode1_fire_burst);
+               weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_uzi_burst_refire, uzi_mode1_fire_burst);
                dprint("bullets:", ftos(self.uzi_bulletcounter),"\n");
        }
                
@@ -192,7 +192,7 @@ float w_uzi(float req)
                }
        else if (req == WR_THINK)
        {
-               if(cvar("g_balance_uzi_mode") == 1)
+               if(autocvar_g_balance_uzi_mode == 1)
                {
                        if (self.BUTTON_ATCK)
                        if (weapon_prepareattack(0, 0))
@@ -212,9 +212,9 @@ float w_uzi(float req)
                                }
                                
                                if not(self.items & IT_UNLIMITED_WEAPON_AMMO)   
-                                       self.ammo_nails = self.ammo_nails - cvar("g_balance_uzi_burst_ammo");
+                                       self.ammo_nails = self.ammo_nails - autocvar_g_balance_uzi_burst_ammo;
 
-                               self.uzi_bulletcounter = cvar("g_balance_uzi_burst") * -1;
+                               self.uzi_bulletcounter = autocvar_g_balance_uzi_burst * -1;
                                uzi_mode1_fire_burst();
                        }
                }
@@ -226,15 +226,15 @@ float w_uzi(float req)
                        {
                                self.uzi_bulletcounter = 1;
                                W_Uzi_Attack(WEP_UZI); // sets attack_finished
-                               weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_uzi_sustained_refire"), uzi_fire1_02);
+                               weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_uzi_sustained_refire, uzi_fire1_02);
                        }
 
-                       if (self.BUTTON_ATCK2 && cvar("g_balance_uzi_first"))
+                       if (self.BUTTON_ATCK2 && autocvar_g_balance_uzi_first)
                        if (weapon_prepareattack(1, 0))
                        {
                                self.uzi_bulletcounter = 1;
                                W_Uzi_Attack(WEP_UZI | HITTYPE_SECONDARY); // sets attack_finished
-                               weapon_thinkf(WFRAME_FIRE2, cvar("g_balance_uzi_first_refire"), w_ready);
+                               weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_uzi_first_refire, w_ready);
                        }
                }
        }
@@ -249,15 +249,15 @@ float w_uzi(float req)
        else if (req == WR_SETUP)
                weapon_setup(WEP_UZI);
        else if (req == WR_CHECKAMMO1)
-               if(cvar("g_balance_uzi_mode") == 1)
-                       return self.ammo_nails >= cvar("g_balance_uzi_sustained_ammo");
+               if(autocvar_g_balance_uzi_mode == 1)
+                       return self.ammo_nails >= autocvar_g_balance_uzi_sustained_ammo;
                else
-                       return self.ammo_nails >= cvar("g_balance_uzi_first_ammo");
+                       return self.ammo_nails >= autocvar_g_balance_uzi_first_ammo;
        else if (req == WR_CHECKAMMO2)
-               if(cvar("g_balance_uzi_mode") == 1)
-                       return self.ammo_nails >= cvar("g_balance_uzi_burst_ammo");
+               if(autocvar_g_balance_uzi_mode == 1)
+                       return self.ammo_nails >= autocvar_g_balance_uzi_burst_ammo;
                else
-                       return self.ammo_nails >= cvar("g_balance_uzi_first_ammo");
+                       return self.ammo_nails >= autocvar_g_balance_uzi_first_ammo;
        return TRUE;
 };
 #endif
index 3605b3a82f00148dc8053d15b476fccea0e56946..5bbf02676f7a16e29a6b1e7dbbd19a0d80bf65d1 100644 (file)
@@ -113,9 +113,9 @@ void WaypointSprite_FadeOutIn(entity e, float t)
 float waypointsprite_limitedrange, waypointsprite_deployed_lifetime, waypointsprite_deadlifetime;
 void WaypointSprite_Init()
 {
-       waypointsprite_limitedrange = cvar("g_waypointsprite_limitedrange");
-       waypointsprite_deployed_lifetime = cvar("g_waypointsprite_deployed_lifetime");
-       waypointsprite_deadlifetime = cvar("g_waypointsprite_deadlifetime");
+       waypointsprite_limitedrange = autocvar_g_waypointsprite_limitedrange;
+       waypointsprite_deployed_lifetime = autocvar_g_waypointsprite_deployed_lifetime;
+       waypointsprite_deadlifetime = autocvar_g_waypointsprite_deadlifetime;
 }
 void WaypointSprite_InitClient(entity e)
 {
@@ -401,8 +401,8 @@ entity WaypointSprite_AttachCarrier(
        e = WaypointSprite_Spawn(spr, 0, 0, carrier, '0 0 64', world, carrier.team, carrier, waypointsprite_attachedforcarrier, FALSE);
        if(e)
        {
-               WaypointSprite_UpdateMaxHealth(e, '1 0 0' * healtharmor_maxdamage(start_health, start_armorvalue, cvar("g_balance_armor_blockpercent")) * 2);
-               WaypointSprite_UpdateHealth(e, '1 0 0' * healtharmor_maxdamage(carrier.health, carrier.armorvalue, cvar("g_balance_armor_blockpercent")));
+               WaypointSprite_UpdateMaxHealth(e, '1 0 0' * healtharmor_maxdamage(start_health, start_armorvalue, autocvar_g_balance_armor_blockpercent) * 2);
+               WaypointSprite_UpdateHealth(e, '1 0 0' * healtharmor_maxdamage(carrier.health, carrier.armorvalue, autocvar_g_balance_armor_blockpercent));
        }
        return e;
 }