]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge remote branch 'origin/master' into samual/keepaway
authorSamual <samual@xonotic.org>
Sun, 12 Dec 2010 20:52:06 +0000 (15:52 -0500)
committerSamual <samual@xonotic.org>
Sun, 12 Dec 2010 20:52:06 +0000 (15:52 -0500)
Hope to god that this works.

199 files changed:
Makefile
balance25.cfg
balanceLeeStricklin.cfg
balanceSamual.cfg
balanceXonotic.cfg
balancetZork.cfg
defaultXPM.cfg
defaultXonotic.cfg
gfx/hud/default/weaponminelayer.tga
gfx/hud/luminos/weaponminelayer.tga
gfx/hud/old/weaponminelayer.tga
gfx/loading.tga
gfx/winner.tga
hud_luminos_xhair_minimal.cfg
models/player/erebus.iqm.framegroups
models/player/erebus_lod1.iqm.framegroups
models/player/erebus_lod2.iqm.framegroups
models/player/gak.iqm.framegroups
models/player/gakarmored.iqm.framegroups
models/player/gakmasked.iqm.framegroups
models/player/ignis.iqm.framegroups
models/player/ignis_lod1.iqm.framegroups
models/player/ignis_lod2.iqm.framegroups
models/player/ignishalfmasked.iqm.framegroups
models/player/ignishalfmasked_lod1.iqm.framegroups
models/player/ignishalfmasked_lod2.iqm.framegroups
models/player/ignismasked.iqm.framegroups
models/player/ignismasked_lod1.iqm.framegroups
models/player/ignismasked_lod2.iqm.framegroups
models/player/nyx.iqm.framegroups
models/player/pyria.iqm.framegroups
models/player/seraphina.iqm.framegroups
models/player/seraphina_lod1.iqm.framegroups
models/player/seraphina_lod2.iqm.framegroups
models/player/seraphinamasked.iqm.framegroups
models/player/seraphinamasked_lod1.iqm.framegroups
models/player/seraphinamasked_lod2.iqm.framegroups
models/player/umbra.iqm.framegroups
models/sprites/make-sprites.sh
models/sprites/wpn-minelayer_frame0.tga [new file with mode: 0644]
physicsCPMA.cfg
physicsFruit.cfg
physicsHavoc.cfg
physicsLeeStricklin-ModdedFruit.cfg
physicsLeeStricklin.cfg
physicsLeeStricklinOld.cfg
physicsLzd.cfg
physicsNexuiz10.cfg
physicsNexuiz11.cfg
physicsNexuiz151.cfg
physicsNexuiz151b.cfg
physicsNexuiz16rc1.cfg
physicsNexuiz20.cfg
physicsNexuiz25.cfg
physicsNexuiz26.cfg
physicsNoQWBunny-nexbased.cfg
physicsQ.cfg
physicsQ2.cfg
physicsQ2a.cfg
physicsQ3.cfg
physicsQBF.cfg
physicsQBFplus.cfg
physicsSamual.cfg
physicsWarsow.cfg
physicsWarsowClassicBunny.cfg
physicsWarsowDev.cfg
physicsX0.cfg
physicsXPM.cfg
physicsXPMLight.cfg
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/common/constants.qh
qcsrc/common/items.qc
qcsrc/common/util.qc
qcsrc/common/util.qh
qcsrc/menu/item/inputbox.c
qcsrc/menu/xonotic/cvarlist.c
qcsrc/menu/xonotic/dialog_multiplayer_playersetup.c
qcsrc/menu/xonotic/util.qc
qcsrc/server/accuracy.qh
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/bot.qh
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/cheats.qh
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/ai.qc
qcsrc/server/monsters/defs.qc
qcsrc/server/monsters/m_monsters.qc
qcsrc/server/monsters/mode_management.qc [deleted file]
qcsrc/server/monsters/monster_zombie.qc
qcsrc/server/movelib.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_aimprocs.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
qcsrc/warpzonelib/common.qc
qcsrc/warpzonelib/common.qh
quake.rc
serverbench.cfg
turrets.cfg
xonotic-credits.txt

index e71d9d1c10d656da49ad3a9901544c6646907149..caab47a809b19cdc078626da15943e619515b5a8 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -5,7 +5,7 @@ ZIP ?= 7za a -tzip -mx=9
 ZIPEXCLUDE ?= -x\!*.pk3 -xr\!\.svn -x\!qcsrc
 DIFF ?= diff
 
-FTEQCCFLAGS_WATERMARK ?= -DWATERMARK='"^1$(shell git describe) TEST BUILD"'
+FTEQCCFLAGS_WATERMARK ?= -DWATERMARK='"^1$(shell git describe) TEST BUILD"' -DCVAR_POPCON
 FTEQCCFLAGS ?= -Werror -Wno-Q302 -O3 -Ono-c -Ono-cs $(FTEQCCFLAGS_EXTRA) $(FTEQCCFLAGS_WATERMARK)
 FTEQCCFLAGS_PROGS ?=
 FTEQCCFLAGS_MENU ?=
@@ -38,17 +38,17 @@ skin: gfx/menu/default/skinvalues.txt
 clean:
        rm -f progs.dat menu.dat csprogs.dat
 
-FILES_CSPROGS = qcsrc/client/progs.src $(shell sed '/\.dat/d; s,//.*,,; s,[^   ],qcsrc/client/&,' < qcsrc/client/progs.src)
+FILES_CSPROGS = $(shell find qcsrc/client qcsrc/common qcsrc/warpzonelib -type f -not -name fteqcc.log -not -name qc.asm) qcsrc/server/w_*.qc
 csprogs.dat: $(FILES_CSPROGS)
        @echo make[1]: Entering directory \`$(PWD)/qcsrc/client\'
        cd qcsrc/client && $(FTEQCC) $(FTEQCCFLAGS) $(FTEQCCFLAGS_CSPROGS)
 
-FILES_PROGS = qcsrc/server/progs.src $(shell sed '/\.dat/d; s,//.*,,; s,[^     ],qcsrc/server/&,' < qcsrc/server/progs.src)
+FILES_PROGS = $(shell find qcsrc/server qcsrc/common qcsrc/warpzonelib -type f -not -name fteqcc.log -not -name qc.asm) qcsrc/server/w_*.qc
 progs.dat: $(FILES_PROGS)
        @echo make[1]: Entering directory \`$(PWD)/qcsrc/server\'
        cd qcsrc/server && $(FTEQCC) $(FTEQCCFLAGS) $(FTEQCCFLAGS_PROGS)
 
-FILES_MENU = qcsrc/menu/progs.src $(shell sed '/\.dat/d; s,//.*,,; s,[^        ],qcsrc/menu/&,' < qcsrc/menu/progs.src)
+FILES_MENU = $(shell find qcsrc/menu qcsrc/common qcsrc/warpzonelib -type f -not -name fteqcc.log -not -name qc.asm) qcsrc/server/w_*.qc
 menu.dat: $(FILES_MENU)
        @echo make[1]: Entering directory \`$(PWD)/qcsrc/menu\'
        cd qcsrc/menu && $(FTEQCC) $(FTEQCCFLAGS) $(FTEQCCFLAGS_MENU)
index a5d3b68f10739859db58f0a2a57511ccfa538f7e..3806e8b122650d7a676ef68ed743c46d654f81f1 100644 (file)
@@ -461,10 +461,10 @@ set g_balance_nex_primary_damagefalloff_forcehalflife 0
 set g_balance_nex_secondary 0
 set g_balance_nex_secondary_charge 0
 set g_balance_nex_secondary_charge_rate 0.1
-set g_balance_nex_secondary_charge_pool 0
-set g_balance_nex_secondary_charge_pool_regen 0.15
-set g_balance_nex_secondary_charge_pool_pause_regen 1
-set g_balance_nex_secondary_charge_pool_pause_health_regen 1
+set g_balance_nex_secondary_chargepool 0
+set g_balance_nex_secondary_chargepool_regen 0.15
+set g_balance_nex_secondary_chargepool_pause_regen 1
+set g_balance_nex_secondary_chargepool_pause_health_regen 1
 set g_balance_nex_secondary_damage 100
 set g_balance_nex_secondary_force 600
 set g_balance_nex_secondary_refire 1.5
@@ -603,7 +603,7 @@ set g_balance_hlac_secondary_shots 6
 // {{{ campingrifle
 set g_balance_campingrifle_magazinecapacity 8
 set g_balance_campingrifle_reloadtime 2 // matches reload anim
-set g_balance_campingrifle_auto_reload_after_changing_weapons 0
+set g_balance_campingrifle_auto_reload_on_switch 0
 set g_balance_campingrifle_bursttime 0
 set g_balance_campingrifle_primary_tracer 0
 set g_balance_campingrifle_primary_damage 60
@@ -696,13 +696,13 @@ set g_balance_seeker_flac_speed 3000
 set g_balance_seeker_flac_speed_up 1000
 set g_balance_seeker_flac_speed_z 0
 set g_balance_seeker_flac_spread 0.4
-set g_balance_seeker_missile_accel 1.05
+set g_balance_seeker_missile_accel 3000
 set g_balance_seeker_missile_ammo 2
 set g_balance_seeker_missile_animtime 0.3
 set g_balance_seeker_missile_count 4
 set g_balance_seeker_missile_damage 40
 set g_balance_seeker_missile_damageforcescale 4
-set g_balance_seeker_missile_decel 0.9
+set g_balance_seeker_missile_decel 6000
 set g_balance_seeker_missile_delay 0.25
 set g_balance_seeker_missile_edgedamage 10
 set g_balance_seeker_missile_force 250
@@ -718,7 +718,6 @@ set g_balance_seeker_missile_smart_mindist 800
 set g_balance_seeker_missile_smart_trace_max 2500
 set g_balance_seeker_missile_smart_trace_min 1000
 set g_balance_seeker_missile_speed 700
-set g_balance_seeker_missile_speed_accel 0
 set g_balance_seeker_missile_speed_up 300
 set g_balance_seeker_missile_speed_z 0
 set g_balance_seeker_missile_speed_max 1250
index baca6f9f31b9f80f828633156d656feb65a78043..37a589fd36d6a2bc46de506576c92ee2317afcd4 100644 (file)
@@ -461,10 +461,10 @@ set g_balance_nex_primary_damagefalloff_forcehalflife 9999999
 set g_balance_nex_secondary 0
 set g_balance_nex_secondary_charge 0
 set g_balance_nex_secondary_charge_rate 0.1
-set g_balance_nex_secondary_charge_pool 0
-set g_balance_nex_secondary_charge_pool_regen 0.15
-set g_balance_nex_secondary_charge_pool_pause_regen 1
-set g_balance_nex_secondary_charge_pool_pause_health_regen 1
+set g_balance_nex_secondary_chargepool 0
+set g_balance_nex_secondary_chargepool_regen 0.15
+set g_balance_nex_secondary_chargepool_pause_regen 1
+set g_balance_nex_secondary_chargepool_pause_health_regen 1
 set g_balance_nex_secondary_damage 80
 set g_balance_nex_secondary_force -500
 set g_balance_nex_secondary_refire 1.25
@@ -603,7 +603,7 @@ set g_balance_hlac_secondary_shots 6
 // {{{ campingrifle
 set g_balance_campingrifle_magazinecapacity 8
 set g_balance_campingrifle_reloadtime 2 // matches reload anim
-set g_balance_campingrifle_auto_reload_after_changing_weapons 0
+set g_balance_campingrifle_auto_reload_on_switch 0
 set g_balance_campingrifle_bursttime 0.85 // 0.35 - 0.1 + 0.35 - 0.1 + 0.35 = three secondaries
 set g_balance_campingrifle_primary_tracer 0
 set g_balance_campingrifle_primary_damage 75
@@ -696,13 +696,13 @@ set g_balance_seeker_flac_speed 3000
 set g_balance_seeker_flac_speed_up 1000
 set g_balance_seeker_flac_speed_z 0
 set g_balance_seeker_flac_spread 0.4
-set g_balance_seeker_missile_accel 1.05
+set g_balance_seeker_missile_accel 3000
 set g_balance_seeker_missile_ammo 2
 set g_balance_seeker_missile_animtime 0.3
 set g_balance_seeker_missile_count 8
 set g_balance_seeker_missile_damage 25
 set g_balance_seeker_missile_damageforcescale 4
-set g_balance_seeker_missile_decel 0.9
+set g_balance_seeker_missile_decel 6000
 set g_balance_seeker_missile_delay 0.25
 set g_balance_seeker_missile_edgedamage 10
 set g_balance_seeker_missile_force 250
@@ -718,7 +718,6 @@ set g_balance_seeker_missile_smart_mindist 800
 set g_balance_seeker_missile_smart_trace_max 2500
 set g_balance_seeker_missile_smart_trace_min 1000
 set g_balance_seeker_missile_speed 700
-set g_balance_seeker_missile_speed_accel 0
 set g_balance_seeker_missile_speed_up 300
 set g_balance_seeker_missile_speed_z 0
 set g_balance_seeker_missile_speed_max 1250
index 2935a2cca0b687624298f154419e80dc7ed29256..d7e64bb4f2412709b33d26390ebbfa666eeb9f26 100644 (file)
@@ -461,10 +461,10 @@ set g_balance_nex_primary_damagefalloff_forcehalflife 1500
 set g_balance_nex_secondary 0
 set g_balance_nex_secondary_charge 0
 set g_balance_nex_secondary_charge_rate 0.1
-set g_balance_nex_secondary_charge_pool 0
-set g_balance_nex_secondary_charge_pool_regen 0.15
-set g_balance_nex_secondary_charge_pool_pause_regen 1
-set g_balance_nex_secondary_charge_pool_pause_health_regen 1
+set g_balance_nex_secondary_chargepool 0
+set g_balance_nex_secondary_chargepool_regen 0.15
+set g_balance_nex_secondary_chargepool_pause_regen 1
+set g_balance_nex_secondary_chargepool_pause_health_regen 1
 set g_balance_nex_secondary_damage 0
 set g_balance_nex_secondary_force 0
 set g_balance_nex_secondary_refire 0
@@ -603,7 +603,7 @@ set g_balance_hlac_secondary_shots 6
 // {{{ campingrifle
 set g_balance_campingrifle_magazinecapacity 8 // make it pretty much useless in close combat
 set g_balance_campingrifle_reloadtime 2 // matches reload anim
-set g_balance_campingrifle_auto_reload_after_changing_weapons 0
+set g_balance_campingrifle_auto_reload_on_switch 0
 set g_balance_campingrifle_bursttime 0
 set g_balance_campingrifle_primary_tracer 1
 set g_balance_campingrifle_primary_damage 65
@@ -696,13 +696,13 @@ set g_balance_seeker_flac_speed 3000
 set g_balance_seeker_flac_speed_up 1000
 set g_balance_seeker_flac_speed_z 0
 set g_balance_seeker_flac_spread 0.4
-set g_balance_seeker_missile_accel 1.05
+set g_balance_seeker_missile_accel 3000
 set g_balance_seeker_missile_ammo 2
 set g_balance_seeker_missile_animtime 0.3
 set g_balance_seeker_missile_count 4
 set g_balance_seeker_missile_damage 40
 set g_balance_seeker_missile_damageforcescale 4
-set g_balance_seeker_missile_decel 0.9
+set g_balance_seeker_missile_decel 6000
 set g_balance_seeker_missile_delay 0.25
 set g_balance_seeker_missile_edgedamage 10
 set g_balance_seeker_missile_force 250
@@ -718,7 +718,6 @@ set g_balance_seeker_missile_smart_mindist 800
 set g_balance_seeker_missile_smart_trace_max 2500
 set g_balance_seeker_missile_smart_trace_min 1000
 set g_balance_seeker_missile_speed 700
-set g_balance_seeker_missile_speed_accel 0
 set g_balance_seeker_missile_speed_up 300
 set g_balance_seeker_missile_speed_z 0
 set g_balance_seeker_missile_speed_max 1250
index 1dc5e511b58817dd80890283ecdac54fb10303ef..72283286f3831fc29beff6cad238f71069b9da31 100644 (file)
@@ -99,7 +99,7 @@ set g_pickup_respawntime_short 15
 set g_pickup_respawntime_medium 20
 set g_pickup_respawntime_long 30
 set g_pickup_respawntime_powerup 120
-set g_pickup_respawntime_weapon 5
+set g_pickup_respawntime_weapon 10
 set g_pickup_respawntime_ammo 25
 set g_pickup_respawntimejitter_short 0
 set g_pickup_respawntimejitter_medium 0
@@ -216,7 +216,7 @@ set g_balance_laser_primary_damage 20 // dps 33, hope that's not too high
 set g_balance_laser_primary_edgedamage 20
 set g_balance_laser_primary_force 150 // this looks insanely low, but actually isn't with zscale and velocitybias
 set g_balance_laser_primary_radius 60
-set g_balance_laser_primary_speed 4000
+set g_balance_laser_primary_speed 5000
 set g_balance_laser_primary_spread 0
 set g_balance_laser_primary_refire 0.6
 set g_balance_laser_primary_animtime 0.6
@@ -294,7 +294,7 @@ set g_balance_uzi_bulletconstant 115 // 13.1qu
 // }}}
 // {{{ mortar
 set g_balance_grenadelauncher_primary_type 0
-set g_balance_grenadelauncher_primary_damage 50
+set g_balance_grenadelauncher_primary_damage 44
 set g_balance_grenadelauncher_primary_edgedamage 32
 set g_balance_grenadelauncher_primary_force 300
 set g_balance_grenadelauncher_primary_radius 115
@@ -312,7 +312,7 @@ set g_balance_grenadelauncher_primary_damageforcescale 0
 set g_balance_grenadelauncher_primary_remote_minbouncecnt 0
 
 set g_balance_grenadelauncher_secondary_type 1
-set g_balance_grenadelauncher_secondary_damage 70
+set g_balance_grenadelauncher_secondary_damage 62
 set g_balance_grenadelauncher_secondary_edgedamage 32
 set g_balance_grenadelauncher_secondary_force 300
 set g_balance_grenadelauncher_secondary_radius 150
@@ -333,7 +333,7 @@ set g_balance_grenadelauncher_bouncefactor 0.5
 set g_balance_grenadelauncher_bouncestop 0.12
 // }}}
 // {{{ minelayer
-set g_balance_minelayer_damage 35
+set g_balance_minelayer_damage 42
 set g_balance_minelayer_edgedamage 30
 set g_balance_minelayer_force 250
 set g_balance_minelayer_radius 175
@@ -402,7 +402,7 @@ set g_balance_crylink_primary_damage 10
 set g_balance_crylink_primary_edgedamage 6
 set g_balance_crylink_primary_force 40
 set g_balance_crylink_primary_radius 80
-set g_balance_crylink_primary_speed 1250
+set g_balance_crylink_primary_speed 1500
 set g_balance_crylink_primary_spread 0.05
 set g_balance_crylink_primary_shots 7
 set g_balance_crylink_primary_bounces 2
@@ -452,7 +452,7 @@ set g_balance_crylink_secondary_line_lifetime 2 // range: 4000 full, fades to 80
 set g_balance_crylink_secondary_line_fadetime 2
 // }}}
 // {{{ nex
-set g_balance_nex_primary_damage 100
+set g_balance_nex_primary_damage 90
 set g_balance_nex_primary_force 500
 set g_balance_nex_primary_refire 1
 set g_balance_nex_primary_animtime 0.4
@@ -465,10 +465,10 @@ set g_balance_nex_primary_damagefalloff_forcehalflife 0
 set g_balance_nex_secondary 1
 set g_balance_nex_secondary_charge 1
 set g_balance_nex_secondary_charge_rate 0.4
-set g_balance_nex_secondary_charge_pool 1
-set g_balance_nex_secondary_charge_pool_regen 0.15
-set g_balance_nex_secondary_charge_pool_pause_regen 1
-set g_balance_nex_secondary_charge_pool_pause_health_regen 1
+set g_balance_nex_secondary_chargepool 1
+set g_balance_nex_secondary_chargepool_regen 0.15
+set g_balance_nex_secondary_chargepool_pause_regen 1
+set g_balance_nex_secondary_chargepool_pause_health_regen 1
 set g_balance_nex_secondary_damage 0
 set g_balance_nex_secondary_force 0
 set g_balance_nex_secondary_refire 0
@@ -519,10 +519,10 @@ set g_balance_hagar_secondary_refire 0.12
 set g_balance_hagar_secondary_ammo 1
 // }}}
 // {{{ rocketlauncher
-set g_balance_rocketlauncher_damage 90
-set g_balance_rocketlauncher_edgedamage 30
+set g_balance_rocketlauncher_damage 82
+set g_balance_rocketlauncher_edgedamage 32
 set g_balance_rocketlauncher_force 350
-set g_balance_rocketlauncher_radius 125
+set g_balance_rocketlauncher_radius 130
 set g_balance_rocketlauncher_speed 1400
 set g_balance_rocketlauncher_speedaccel 1400
 set g_balance_rocketlauncher_speedstart 800
@@ -533,7 +533,7 @@ set g_balance_rocketlauncher_ammo 3
 set g_balance_rocketlauncher_health 0
 set g_balance_rocketlauncher_damageforcescale 0
 set g_balance_rocketlauncher_detonatedelay 0.05 // positive: timer till detonation is allowed, negative: "security device" that prevents ANY remote detonation if it could hurt its owner, zero: detonatable at any time
-set g_balance_rocketlauncher_guiderate 40 // max degrees per second
+set g_balance_rocketlauncher_guiderate 42 // max degrees per second
 set g_balance_rocketlauncher_guideratedelay 0.01 // immediate
 set g_balance_rocketlauncher_guidegoal 512 // goal distance for (non-laser) guiding (higher = less control, lower = erratic)
 set g_balance_rocketlauncher_guidedelay 0.15 // delay before guiding kicks in
@@ -581,7 +581,7 @@ set g_balance_hlac_primary_damage 15
 set g_balance_hlac_primary_edgedamage 10
 set g_balance_hlac_primary_force 70
 set g_balance_hlac_primary_radius 40
-set g_balance_hlac_primary_speed 2500
+set g_balance_hlac_primary_speed 9000
 set g_balance_hlac_primary_lifetime 5
 
 set g_balance_hlac_primary_refire 0.1
@@ -596,7 +596,7 @@ set g_balance_hlac_secondary_damage 20
 set g_balance_hlac_secondary_edgedamage 13
 set g_balance_hlac_secondary_force 100
 set g_balance_hlac_secondary_radius 45
-set g_balance_hlac_secondary_speed 2500
+set g_balance_hlac_secondary_speed 9000
 set g_balance_hlac_secondary_lifetime 5
 
 set g_balance_hlac_secondary_refire 0.8
@@ -607,11 +607,11 @@ set g_balance_hlac_secondary_shots 6
 // {{{ campingrifle
 set g_balance_campingrifle_magazinecapacity 8 // make it pretty much useless in close combat
 set g_balance_campingrifle_reloadtime 2 // matches reload anim
-set g_balance_campingrifle_auto_reload_after_changing_weapons 0
+set g_balance_campingrifle_auto_reload_on_switch 0
 set g_balance_campingrifle_bursttime 0
 set g_balance_campingrifle_primary_tracer 1
-set g_balance_campingrifle_primary_damage 70
-set g_balance_campingrifle_primary_headshotaddeddamage 110
+set g_balance_campingrifle_primary_damage 60
+set g_balance_campingrifle_primary_headshotaddeddamage 100
 set g_balance_campingrifle_primary_spread 0
 set g_balance_campingrifle_primary_force 2
 set g_balance_campingrifle_primary_speed 40000
@@ -624,8 +624,8 @@ set g_balance_campingrifle_primary_burstcost 0
 set g_balance_campingrifle_primary_bullethail 0 // empty magazine on shot
 set g_balance_campingrifle_secondary 1
 set g_balance_campingrifle_secondary_tracer 0
-set g_balance_campingrifle_secondary_damage 50
-set g_balance_campingrifle_secondary_headshotaddeddamage 75
+set g_balance_campingrifle_secondary_damage 42
+set g_balance_campingrifle_secondary_headshotaddeddamage 70
 set g_balance_campingrifle_secondary_spread 0
 set g_balance_campingrifle_secondary_force 2
 set g_balance_campingrifle_secondary_speed 20000
@@ -700,13 +700,13 @@ set g_balance_seeker_flac_speed 3000
 set g_balance_seeker_flac_speed_up 1000
 set g_balance_seeker_flac_speed_z 0
 set g_balance_seeker_flac_spread 0.4
-set g_balance_seeker_missile_accel 1.05
+set g_balance_seeker_missile_accel 1400
 set g_balance_seeker_missile_ammo 2
 set g_balance_seeker_missile_animtime 0.3
 set g_balance_seeker_missile_count 8
 set g_balance_seeker_missile_damage 15
 set g_balance_seeker_missile_damageforcescale 4
-set g_balance_seeker_missile_decel 0.9
+set g_balance_seeker_missile_decel 1400
 set g_balance_seeker_missile_delay 0.25
 set g_balance_seeker_missile_edgedamage 10
 set g_balance_seeker_missile_force 250
@@ -722,10 +722,9 @@ set g_balance_seeker_missile_smart_mindist 800
 set g_balance_seeker_missile_smart_trace_max 2500
 set g_balance_seeker_missile_smart_trace_min 1000
 set g_balance_seeker_missile_speed 700
-set g_balance_seeker_missile_speed_accel 0
 set g_balance_seeker_missile_speed_up 300
 set g_balance_seeker_missile_speed_z 0
-set g_balance_seeker_missile_speed_max 1250
+set g_balance_seeker_missile_speed_max 1400
 set g_balance_seeker_missile_spread 0
 set g_balance_seeker_missile_turnrate 0.65
 set g_balance_seeker_tag_ammo 1
@@ -734,6 +733,6 @@ set g_balance_seeker_tag_damageforcescale 4
 set g_balance_seeker_tag_health 5
 set g_balance_seeker_tag_lifetime 15
 set g_balance_seeker_tag_refire 0.7
-set g_balance_seeker_tag_speed 9000
+set g_balance_seeker_tag_speed 5000
 set g_balance_seeker_tag_spread 0
 // End new seeker
index 58b3e3c276a4c1eb2d0b466b99c8925850efe6c9..bff56f2338ad346fa758ec12c549681cde7c50af 100644 (file)
@@ -482,10 +482,10 @@ set g_balance_nex_primary_damagefalloff_forcehalflife 0
 set g_balance_nex_secondary 1
 set g_balance_nex_secondary_charge 1
 set g_balance_nex_secondary_charge_rate 0.55
-set g_balance_nex_secondary_charge_pool 0
-set g_balance_nex_secondary_charge_pool_regen 0.15
-set g_balance_nex_secondary_charge_pool_pause_regen 1
-set g_balance_nex_secondary_charge_pool_pause_health_regen 1
+set g_balance_nex_secondary_chargepool 0
+set g_balance_nex_secondary_chargepool_regen 0.15
+set g_balance_nex_secondary_chargepool_pause_regen 1
+set g_balance_nex_secondary_chargepool_pause_health_regen 1
 set g_balance_nex_secondary_damage 100
 set g_balance_nex_secondary_force 600
 set g_balance_nex_secondary_refire 1.5
@@ -598,7 +598,7 @@ set g_balance_hlac_primary_damage 22
 set g_balance_hlac_primary_edgedamage 2
 set g_balance_hlac_primary_force -100
 set g_balance_hlac_primary_radius 100
-set g_balance_hlac_primary_speed 5000
+set g_balance_hlac_primary_speed 15000
 set g_balance_hlac_primary_lifetime 3
 
 set g_balance_hlac_primary_refire 0.1
@@ -613,7 +613,7 @@ set g_balance_hlac_secondary_damage 20
 set g_balance_hlac_secondary_edgedamage 3
 set g_balance_hlac_secondary_force 100
 set g_balance_hlac_secondary_radius 50
-set g_balance_hlac_secondary_speed 9000
+set g_balance_hlac_secondary_speed 15000
 set g_balance_hlac_secondary_lifetime 3
 set g_balance_hlac_secondary_refire 1
 set g_balance_hlac_secondary_animtime 0.7
@@ -623,7 +623,7 @@ set g_balance_hlac_secondary_shots 6
 // {{{ campingrifle
 set g_balance_campingrifle_magazinecapacity 8 // make it pretty much useless in close combat
 set g_balance_campingrifle_reloadtime 2 // matches reload anim
-set g_balance_campingrifle_auto_reload_after_changing_weapons 0
+set g_balance_campingrifle_auto_reload_on_switch 0
 set g_balance_campingrifle_bursttime 0
 set g_balance_campingrifle_primary_tracer 1
 set g_balance_campingrifle_primary_damage 40
@@ -717,13 +717,13 @@ set g_balance_seeker_flac_speed_up 500
 set g_balance_seeker_flac_speed_z 0
 set g_balance_seeker_flac_spread 0.25
 
-set g_balance_seeker_missile_accel 1.05
+set g_balance_seeker_missile_accel 1400
 set g_balance_seeker_missile_ammo 2
 set g_balance_seeker_missile_animtime 0.3
 set g_balance_seeker_missile_count 4
 set g_balance_seeker_missile_damage 50
 set g_balance_seeker_missile_damageforcescale 2
-set g_balance_seeker_missile_decel 0.9
+set g_balance_seeker_missile_decel 1400
 set g_balance_seeker_missile_delay 0.25
 set g_balance_seeker_missile_edgedamage 10
 set g_balance_seeker_missile_force 250
@@ -739,10 +739,9 @@ set g_balance_seeker_missile_smart_mindist 800
 set g_balance_seeker_missile_smart_trace_max 2500
 set g_balance_seeker_missile_smart_trace_min 1000
 set g_balance_seeker_missile_speed 700
-set g_balance_seeker_missile_speed_accel 0
 set g_balance_seeker_missile_speed_up 300
 set g_balance_seeker_missile_speed_z 0
-set g_balance_seeker_missile_speed_max 1250
+set g_balance_seeker_missile_speed_max 1400
 set g_balance_seeker_missile_spread 0
 set g_balance_seeker_missile_turnrate 0.65
 
index 37aee96d07a9f96acdff42e9cccfae4441f29119..35d5da985993d7ad40c8d974ebf7620ba60ac08b 100644 (file)
@@ -1,22 +1,32 @@
+// Xonotic ProMode
 exec defaultXonotic.cfg
-exec physicsXPM.cfg
 
-set g_start_weapon_laser 0
-set g_balance_weaponswitchdelay 0
+//==============
+// pure changes
+//==============
 
-set g_shootfromcenter 1
+// players
+sv_fbskin_green // visible playermodel forced on everyone
 
-set g_forced_respawn 1
+//================
+// impure changes
+//================
 
-set g_mirrordamage 0
-set g_friendlyfire 1
+// players
+g_jump_grunt 1 // make enemies even easier to hear when they're jumping around
 
-set timelimit_overtimes 1
+// physics
+exec physicsXPM.cfg // XPM physics. Similar to vanilla Xonotic physics, with a different way to accelerate: through strafejumping
 
-set sv_fragmessage_information_stats 0
+// balance
+set g_balance_weaponswitchdelay 0 // no switch animation, this is standard in "pro modes" ;)
+set g_shootfromcenter 1 // hit where you point at with the crosshair (almost so, no shooteye because it's really ugly)
 
-// force a visible playermodel!
-set sv_defaultcharacter 1
-set sv_defaultplayermodel "models/player/nyx.iqm"
-set sv_defaultplayercolors 60
-set g_fullbrightplayers 1
+// match rules
+set timelimit_overtimes 1 // overtimes on, draw matches are less interesting! :)
+set g_forced_respawn 1 // no delaying/cheating a match by not spawning
+set g_mirrordamage 0 // hurting teammates does not hurt you...
+set g_friendlyfire 1 // ...it hurts them.
+
+// info
+set sv_fragmessage_information_stats 0 // don't reveal how much health/armor the attacker had
index f7ba5a05fdd1df14127a822f28a1ea0e523a7112..6c8905004ca56826fa6a921858e7deb176ecf4fb 100644 (file)
@@ -25,6 +25,9 @@ gameversion_max 65535 // git builds see all versions
 // server about changes)
 alias setreport "set \"$1\" \"$2\" ; sendcvar \"$1\""
 
+seta cl_firststart "" "how many times the client has been run"
+seta cl_startcount 0 "how many times the client has been run"
+
 // detect dedicated server or client
 alias "_detect_dedicated_$qport" "${* asis}"
 alias "_detect_dedicated_0" ""
@@ -100,8 +103,7 @@ seta crosshair_dot_color "1 0 0" "when != 0, use custom color for the crosshair
 seta crosshair_pickup 0.25
 seta crosshair_pickup_speed 4
 seta crosshair_per_weapon 0    "when 1, each gun will display a different crosshair"
-seta crosshair_color_override 0        "when 1, crosshair_color_* overrides the per-weapon color"
-seta crosshair_color_per_weapon 1 "when 1, each gun will display a different colored crosshair"
+seta crosshair_color_per_weapon 1 "when 1, each gun will display the crosshair with a different color"
 seta crosshair_effect_speed -1 "how fast (in seconds) some crosshair effects should take place, 0 = instant, -1 = 2x weapon switch time"
 seta crosshair_effect_scalefade 1 "use scaling and fading for crosshair effects"
 seta crosshair_hittest 1 "do a crosshair hit evaluation; also, the crosshair is scaled by the given number when aiming at an enemy, and blurred when aiming at a team mate"
@@ -264,6 +266,14 @@ gl_polyblend 0 // whether to use screen tints, this has now been replaced by a b
 r_motionblur 0 // motion blur value, default is 0
 r_damageblur 0 // motion blur when damaged, default is 0
 
+r_bloom_blur 8
+r_bloom_brighten 3
+r_bloom_colorexponent 1
+r_bloom_colorscale 1
+r_bloom_colorsubtract 0.25
+r_bloom_resolution 320
+r_hdr_range 4
+
 seta vid_x11_display ""        "xonotic-linux-*.sh will use this to start xonotic on an other/new X display"
 // This can have three possible settings:
 //     ""              run as usual
@@ -377,25 +387,6 @@ set ekg 0  "Throw huge amounts of gibs"
 
 cl_movement 1
 cl_stairsmoothspeed 200
-cl_forwardspeed $sv_maxspeed
-cl_backspeed $sv_maxspeed
-cl_sidespeed $sv_maxspeed
-cl_upspeed $sv_maxspeed
-cl_movement_accelerate $sv_accelerate
-cl_movement_airaccel_qw $sv_airaccel_qw
-cl_movement_airaccel_sideways_friction $sv_airaccel_sideways_friction
-cl_movement_airaccelerate $sv_airaccelerate
-cl_movement_edgefriction $edgefriction
-cl_movement_friction $sv_friction
-cl_movement_jumpvelocity $sv_jumpvelocity
-cl_movement_maxairspeed $sv_maxairspeed
-cl_movement_maxspeed $sv_maxspeed
-cl_movement_stepheight $sv_stepheight
-cl_movement_stopspeed $sv_stopspeed
-cl_movement_track_canjump 0 // till DP bug gets fixed
-cl_movement_wallfriction $sv_wallfriction
-cl_movement_wateraccelerate $sv_wateraccelerate
-cl_movement_waterfriction $sv_waterfriction
 
 seta cl_autoswitch 1 "automatically switch to newly picked up weapons if they are better than what you are carrying"
 alias autoswitch "set cl_autoswitch $1 ; cmd autoswitch $1"
@@ -427,9 +418,9 @@ set bot_ai_keyboard_treshold 0.57
 set bot_ai_aimskill_offset 0.3 "Amount of error induced to the bots aim"
 set bot_ai_aimskill_think 1 "Aiming velocity. Use values below 1 for slower aiming"
 set bot_ai_custom_weapon_priority_distances "300 850"  "Define close and far distances in any order. Based on the distance to the enemy bots will choose different weapons"
-set bot_ai_custom_weapon_priority_far   "minstanex nex campingrifle rocketlauncher minelayer grenadelauncher electro hagar hlac crylink laser uzi fireball seeker shotgun tuba"        "Desired weapons for far distances ordered by priority"
-set bot_ai_custom_weapon_priority_mid   "minstanex rocketlauncher nex fireball seeker minelayer grenadelauncher electro uzi campingrifle crylink hlac hagar shotgun laser tuba"        "Desired weapons for middle distances ordered by priority"
-set bot_ai_custom_weapon_priority_close "minstanex nex uzi hlac tuba seeker hagar crylink minelayer grenadelauncher shotgun electro campingrifle rocketlauncher laser fireball"        "Desired weapons for close distances ordered by priority"
+set bot_ai_custom_weapon_priority_far   "minstanex nex campingrifle electro rocketlauncher grenadelauncher hagar hlac crylink laser uzi fireball seeker shotgun tuba minelayer"        "Desired weapons for far distances ordered by priority"
+set bot_ai_custom_weapon_priority_mid   "minstanex rocketlauncher nex fireball seeker grenadelauncher electro uzi campingrifle crylink hlac hagar shotgun laser tuba minelayer"        "Desired weapons for middle distances ordered by priority"
+set bot_ai_custom_weapon_priority_close "minstanex shotgun nex uzi hlac tuba seeker hagar crylink grenadelauncher electro campingrifle rocketlauncher laser fireball minelayer"        "Desired weapons for close distances ordered by priority"
 set bot_ai_weapon_combo 1      "Enable bots to do weapon combos"
 set bot_ai_weapon_combo_threshold 0.3  "Try to make a combo N seconds after the last attack"
 set bot_ai_friends_aware_pickup_radius "500"   "Bots will not pickup items if a team mate is this distance near the item"
@@ -586,40 +577,56 @@ set g_respawn_waves 0 "respawn in waves (every n seconds), intended to decrease
 // to force disable delay or waves, set them to 0.125
 set g_ctf_respawn_delay 0
 set g_ctf_respawn_waves 0
+set g_ctf_weapon_stay 0
 set g_dm_respawn_delay 0
 set g_dm_respawn_waves 0
+set g_dm_weapon_stay 0
 set g_dom_respawn_delay 0
 set g_dom_respawn_waves 0
+set g_dom_weapon_stay 0
 set g_lms_respawn_delay 0
 set g_lms_respawn_waves 0
+set g_lms_weapon_stay 0
 set g_rune_respawn_delay 0
 set g_rune_respawn_waves 0
+set g_rune_weapon_stay 0
 set g_tdm_respawn_delay 0
 set g_tdm_respawn_waves 0
+set g_tdm_weapon_stay 0
 set g_kh_respawn_delay 0
 set g_kh_respawn_waves 0
+set g_kh_weapon_stay 0
 set g_arena_respawn_delay 0
 set g_arena_respawn_waves 0
+set g_arena_weapon_stay 0
 set g_ca_respawn_delay 0
 set g_ca_respawn_waves 0
+set g_ca_weapon_stay 0
 set g_ca_damage2score_multiplier 0.01
 set g_ca_round_timelimit 180
 set g_nexball_respawn_delay 0
 set g_nexball_respawn_waves 0
+set g_nexball_weapon_stay 0
 set g_as_respawn_delay 0
 set g_as_respawn_waves 0
+set g_as_weapon_stay 0
 set g_ons_respawn_delay 0
 set g_ons_respawn_waves 0
+set g_ons_weapon_stay 0
 set g_rc_respawn_waves 0
 set g_rc_respawn_delay 0
+set g_rc_weapon_stay 0
 set g_cts_respawn_waves 0
-set g_cts_respawn_delay 0.25
+set g_cts_respawn_delay 0
 set g_cts_selfdamage 1 "0 = disable all selfdamage and falldamage in cts"
 set g_cts_finish_kill_delay 10 "prevent cheating by running back to the start line, and starting out with more speed than otherwise possible"
+set g_cts_weapon_stay 1
 set g_freezetag_respawn_waves 0
-set g_freezetag_respawn_delay 0.25
+set g_freezetag_respawn_delay 0
+set g_freezetag_weapon_stay 0
 set g_ka_respawn_delay 0
 set g_ka_respawn_waves 0
+set g_ka_weapon_stay 0
 
 // overtime
 seta timelimit_overtime 2 "duration in minutes of one added overtime, added to the timelimit"
@@ -629,7 +636,7 @@ seta timelimit_suddendeath 5 "number of minutes suddendeath mode lasts after all
 // common team values
 set g_tdm 0 "Team Deathmatch: the team who kills their opponents most often wins"
 
-seta teamplay_default 4 "default teamplay setting in team games. 1 = no friendly fire, self damage. 2 = friendly fire and self damage enabled. 3 = no friendly fire, but self damage enabled. 4 = obey the following four cvars"
+seta teamplay_mode 4 "default teamplay setting in team games. 1 = no friendly fire, self damage. 2 = friendly fire and self damage enabled. 3 = no friendly fire, but self damage enabled. 4 = obey the following four cvars"
 seta g_mirrordamage 0.300000   "for teamplay 4: mirror damage factor"
 seta g_friendlyfire 0.100000   "for teamplay 4: fiendly fire factor"
 seta g_teamdamage_threshold 50 "for teamplay 4: threshold over which to apply mirror damage"
@@ -1528,7 +1535,8 @@ sv_gameplayfix_q2airaccelerate 1
 sv_gameplayfix_stepmultipletimes 1
 
 // delay for "kill" to prevent abuse
-set g_balance_kill_delay 5
+set g_balance_kill_delay 2
+set g_balance_kill_antispam 5
 
 // this feature is currently buggy in the engine (it appears to PREVENT any dropping in lots of maps, leading to weirdly aligned entities, and in some cases even CAUSES them to drop through solid, like in facing worlds nex)
 sv_gameplayfix_droptofloorstartsolid 0
@@ -1616,7 +1624,7 @@ if_dedicated set g_start_delay 15 "delay before the game starts, so everyone can
 
 alias ons_map           "cl_cmd radar" // legacy alias
 alias radar             "cl_cmd radar"
-alias scoreboard_columns_set  "cl_cmd scoreboard_columns_set $*"
+alias scoreboard_columns_set  "" // aliased later
 alias scoreboard_columns_help "cl_cmd scoreboard_columns_help $*"
 
 alias _gl_flashblend_update_00 "gl_flashblend 1"
@@ -1634,7 +1642,6 @@ set cl_handicap 1 "the higher, the more damage you will receive (client setting)
 alias menu_showteamselect "menu_cmd directmenu TeamSelect"
 alias menu_showhudexit "menu_cmd directmenu HUDExit"
 alias menu_showhudoptions "menu_cmd directpanelhudmenu $*"
-alias menu_sync "menu_cmd sync"
 bind f5 menu_showteamselect
 
 set g_bugrigs 0
@@ -1904,9 +1911,6 @@ collision_endposnudge 1
 set cl_lerpanim_maxdelta_framegroups 0.05 // must be faster than fastest weapon refire
 set cl_lerpanim_maxdelta_server 0.1 // must be slower than slowest server controlled anim (e.g. animinfo stuff)
 
-// player ID
-seta _cl_userid "" "player ID (e.g. for tournaments)"
-
 // FIXME workaround for engine bug
 sv_gameplayfix_nudgeoutofsolid 0
 // to div0: remove this once 5b7ac1706712977bbc0297d2d53294e73574c7cd (svn r9537) is in the stable branch of the engine again
@@ -2042,15 +2046,33 @@ set g_forced_team_yellow "" "list of player IDs for yellow team"
 set g_forced_team_pink "" "list of player IDs for pink team"
 set g_forced_team_otherwise "default" "action if a non listed player joins (can be default for default action, spectate for forcing to spectate, or red, blue, yellow, pink)"
 
+// random charge stuff :P
+set g_weapon_charge_colormod_hdrmultiplier 4 "how much to multiply the colors by in the colormod vector"
+set g_weapon_charge_colormod_red_half 0
+set g_weapon_charge_colormod_green_half 0.5
+set g_weapon_charge_colormod_blue_half 1
+set g_weapon_charge_colormod_red_full 1
+set g_weapon_charge_colormod_green_full -0.5
+set g_weapon_charge_colormod_blue_full -1
+
 // player statistics server URI
 set g_playerstats_uri ""
 
+// create this cvar in case the engine did not
+set snd_soundradius 1200
+
+// loading screen
+scr_loadingscreen_scale 1
+scr_loadingscreen_scale_base 1
+scr_loadingscreen_scale_limit 1
+
 // other config files
 exec balanceXonotic.cfg
 exec ctfscoring-ai.cfg
 exec effects-normal.cfg
 exec physicsX0.cfg
 exec turrets.cfg
+exec font-nimbussansl.cfg
 
 // hud cvar descriptions
 exec _hud_descriptions.cfg
@@ -2058,10 +2080,6 @@ exec _hud_descriptions.cfg
 // please add any new cvars into the hud_save script in qcsrc/client/hud.qc for consistency
 exec hud_luminos.cfg
 
-set g_weapon_charge_colormod_hdrmultiplier 4 "how much to multiply the colors by in the colormod vector"
-set g_weapon_charge_colormod_red_half 0
-set g_weapon_charge_colormod_green_half 0.5
-set g_weapon_charge_colormod_blue_half 1
-set g_weapon_charge_colormod_red_full 1
-set g_weapon_charge_colormod_green_full -0.5
-set g_weapon_charge_colormod_blue_full -1
+// enable menu syncing
+alias menu_sync "menu_cmd sync"
+alias scoreboard_columns_set  "cl_cmd scoreboard_columns_set $*"
index 3fbccf9dee9f9d50f81982e9386e2f4dd17fa74e..4e31286157bb35c26cff8eb725df1f82117246fb 100644 (file)
Binary files a/gfx/hud/default/weaponminelayer.tga and b/gfx/hud/default/weaponminelayer.tga differ
index 3fbccf9dee9f9d50f81982e9386e2f4dd17fa74e..4e31286157bb35c26cff8eb725df1f82117246fb 100644 (file)
Binary files a/gfx/hud/luminos/weaponminelayer.tga and b/gfx/hud/luminos/weaponminelayer.tga differ
index 444247ffd7ea788493b0b82f6c24bb6eec0f707d..0c82a484158e5b02637e5e25e643bfba32056f37 100644 (file)
Binary files a/gfx/hud/old/weaponminelayer.tga and b/gfx/hud/old/weaponminelayer.tga differ
index 2b6e22ce76fb1ba1ebfa8009a4cc5abb435f4be1..589a7fd2d7aeeda72dd74416a986adf2deb032d1 100644 (file)
Binary files a/gfx/loading.tga and b/gfx/loading.tga differ
index 70bb566cdf82e63e4e37fd3b46c346ff517a3731..c713a85714322ce5b3953e0592baa28f2fbc3dc3 100644 (file)
Binary files a/gfx/winner.tga and b/gfx/winner.tga differ
index ba9e01a906d8b96f0540a0f40543f586248cc992..73b08adeb16ea344a2e8b01815b9b37cad8e01ae 100644 (file)
@@ -59,6 +59,7 @@ seta hud_panel_ammo_onlycurrent "1"
 seta hud_panel_ammo_iconalign "0"
 seta hud_panel_ammo_progressbar "1"
 seta hud_panel_ammo_progressbar_name "progressbar_ammo"
+seta hud_panel_ammo_progressbar_xoffset "0.32"
 seta hud_panel_ammo_text "1"
 
 seta hud_panel_powerups 1
index 71128c6c82fd047ec1b0b0a7e854df45dc67fe59..16b3e92c79f591ec88405a7ae46bece049f8c854 100644 (file)
@@ -9,7 +9,7 @@
 184 21 25.000000 0 // jump
 205 15 15.000000 0 // painone
 220 17 15.000000 0 // paintwo
-237 3 15.000000 1 // shoot
+237 3 15.000000 0 // shoot
 240 21 15.000000 1 // taunt
 261 21 35.000000 1 // run
 282 21 35.000000 1 // runbackwards
index 71128c6c82fd047ec1b0b0a7e854df45dc67fe59..16b3e92c79f591ec88405a7ae46bece049f8c854 100644 (file)
@@ -9,7 +9,7 @@
 184 21 25.000000 0 // jump
 205 15 15.000000 0 // painone
 220 17 15.000000 0 // paintwo
-237 3 15.000000 1 // shoot
+237 3 15.000000 0 // shoot
 240 21 15.000000 1 // taunt
 261 21 35.000000 1 // run
 282 21 35.000000 1 // runbackwards
index 71128c6c82fd047ec1b0b0a7e854df45dc67fe59..16b3e92c79f591ec88405a7ae46bece049f8c854 100644 (file)
@@ -9,7 +9,7 @@
 184 21 25.000000 0 // jump
 205 15 15.000000 0 // painone
 220 17 15.000000 0 // paintwo
-237 3 15.000000 1 // shoot
+237 3 15.000000 0 // shoot
 240 21 15.000000 1 // taunt
 261 21 35.000000 1 // run
 282 21 35.000000 1 // runbackwards
index 71128c6c82fd047ec1b0b0a7e854df45dc67fe59..16b3e92c79f591ec88405a7ae46bece049f8c854 100644 (file)
@@ -9,7 +9,7 @@
 184 21 25.000000 0 // jump
 205 15 15.000000 0 // painone
 220 17 15.000000 0 // paintwo
-237 3 15.000000 1 // shoot
+237 3 15.000000 0 // shoot
 240 21 15.000000 1 // taunt
 261 21 35.000000 1 // run
 282 21 35.000000 1 // runbackwards
index 71128c6c82fd047ec1b0b0a7e854df45dc67fe59..16b3e92c79f591ec88405a7ae46bece049f8c854 100644 (file)
@@ -9,7 +9,7 @@
 184 21 25.000000 0 // jump
 205 15 15.000000 0 // painone
 220 17 15.000000 0 // paintwo
-237 3 15.000000 1 // shoot
+237 3 15.000000 0 // shoot
 240 21 15.000000 1 // taunt
 261 21 35.000000 1 // run
 282 21 35.000000 1 // runbackwards
index 71128c6c82fd047ec1b0b0a7e854df45dc67fe59..16b3e92c79f591ec88405a7ae46bece049f8c854 100644 (file)
@@ -9,7 +9,7 @@
 184 21 25.000000 0 // jump
 205 15 15.000000 0 // painone
 220 17 15.000000 0 // paintwo
-237 3 15.000000 1 // shoot
+237 3 15.000000 0 // shoot
 240 21 15.000000 1 // taunt
 261 21 35.000000 1 // run
 282 21 35.000000 1 // runbackwards
index 71128c6c82fd047ec1b0b0a7e854df45dc67fe59..16b3e92c79f591ec88405a7ae46bece049f8c854 100644 (file)
@@ -9,7 +9,7 @@
 184 21 25.000000 0 // jump
 205 15 15.000000 0 // painone
 220 17 15.000000 0 // paintwo
-237 3 15.000000 1 // shoot
+237 3 15.000000 0 // shoot
 240 21 15.000000 1 // taunt
 261 21 35.000000 1 // run
 282 21 35.000000 1 // runbackwards
index 71128c6c82fd047ec1b0b0a7e854df45dc67fe59..16b3e92c79f591ec88405a7ae46bece049f8c854 100644 (file)
@@ -9,7 +9,7 @@
 184 21 25.000000 0 // jump
 205 15 15.000000 0 // painone
 220 17 15.000000 0 // paintwo
-237 3 15.000000 1 // shoot
+237 3 15.000000 0 // shoot
 240 21 15.000000 1 // taunt
 261 21 35.000000 1 // run
 282 21 35.000000 1 // runbackwards
index 71128c6c82fd047ec1b0b0a7e854df45dc67fe59..16b3e92c79f591ec88405a7ae46bece049f8c854 100644 (file)
@@ -9,7 +9,7 @@
 184 21 25.000000 0 // jump
 205 15 15.000000 0 // painone
 220 17 15.000000 0 // paintwo
-237 3 15.000000 1 // shoot
+237 3 15.000000 0 // shoot
 240 21 15.000000 1 // taunt
 261 21 35.000000 1 // run
 282 21 35.000000 1 // runbackwards
index 71128c6c82fd047ec1b0b0a7e854df45dc67fe59..16b3e92c79f591ec88405a7ae46bece049f8c854 100644 (file)
@@ -9,7 +9,7 @@
 184 21 25.000000 0 // jump
 205 15 15.000000 0 // painone
 220 17 15.000000 0 // paintwo
-237 3 15.000000 1 // shoot
+237 3 15.000000 0 // shoot
 240 21 15.000000 1 // taunt
 261 21 35.000000 1 // run
 282 21 35.000000 1 // runbackwards
index 71128c6c82fd047ec1b0b0a7e854df45dc67fe59..16b3e92c79f591ec88405a7ae46bece049f8c854 100644 (file)
@@ -9,7 +9,7 @@
 184 21 25.000000 0 // jump
 205 15 15.000000 0 // painone
 220 17 15.000000 0 // paintwo
-237 3 15.000000 1 // shoot
+237 3 15.000000 0 // shoot
 240 21 15.000000 1 // taunt
 261 21 35.000000 1 // run
 282 21 35.000000 1 // runbackwards
index 71128c6c82fd047ec1b0b0a7e854df45dc67fe59..16b3e92c79f591ec88405a7ae46bece049f8c854 100644 (file)
@@ -9,7 +9,7 @@
 184 21 25.000000 0 // jump
 205 15 15.000000 0 // painone
 220 17 15.000000 0 // paintwo
-237 3 15.000000 1 // shoot
+237 3 15.000000 0 // shoot
 240 21 15.000000 1 // taunt
 261 21 35.000000 1 // run
 282 21 35.000000 1 // runbackwards
index 71128c6c82fd047ec1b0b0a7e854df45dc67fe59..16b3e92c79f591ec88405a7ae46bece049f8c854 100644 (file)
@@ -9,7 +9,7 @@
 184 21 25.000000 0 // jump
 205 15 15.000000 0 // painone
 220 17 15.000000 0 // paintwo
-237 3 15.000000 1 // shoot
+237 3 15.000000 0 // shoot
 240 21 15.000000 1 // taunt
 261 21 35.000000 1 // run
 282 21 35.000000 1 // runbackwards
index 71128c6c82fd047ec1b0b0a7e854df45dc67fe59..16b3e92c79f591ec88405a7ae46bece049f8c854 100644 (file)
@@ -9,7 +9,7 @@
 184 21 25.000000 0 // jump
 205 15 15.000000 0 // painone
 220 17 15.000000 0 // paintwo
-237 3 15.000000 1 // shoot
+237 3 15.000000 0 // shoot
 240 21 15.000000 1 // taunt
 261 21 35.000000 1 // run
 282 21 35.000000 1 // runbackwards
index 71128c6c82fd047ec1b0b0a7e854df45dc67fe59..16b3e92c79f591ec88405a7ae46bece049f8c854 100644 (file)
@@ -9,7 +9,7 @@
 184 21 25.000000 0 // jump
 205 15 15.000000 0 // painone
 220 17 15.000000 0 // paintwo
-237 3 15.000000 1 // shoot
+237 3 15.000000 0 // shoot
 240 21 15.000000 1 // taunt
 261 21 35.000000 1 // run
 282 21 35.000000 1 // runbackwards
index 71128c6c82fd047ec1b0b0a7e854df45dc67fe59..16b3e92c79f591ec88405a7ae46bece049f8c854 100644 (file)
@@ -9,7 +9,7 @@
 184 21 25.000000 0 // jump
 205 15 15.000000 0 // painone
 220 17 15.000000 0 // paintwo
-237 3 15.000000 1 // shoot
+237 3 15.000000 0 // shoot
 240 21 15.000000 1 // taunt
 261 21 35.000000 1 // run
 282 21 35.000000 1 // runbackwards
index b98d0b9818be941fbe715c5114f0b70cbd23e273..a257a2469eb0f5c7bd5feedf17d76e78848d615a 100644 (file)
@@ -9,7 +9,7 @@
 156 16 15.000000 0 // jump
 172 15 15.000000 0 // painone
 187 17 15.000000 0 // paintwo
-204 5 15.000000 1 // shoot
+204 5 15.000000 0 // shoot
 209 21 15.000000 1 // taunt
 230 21 40.000000 1 // run
 251 21 40.000000 1 // runbackwards
index 71128c6c82fd047ec1b0b0a7e854df45dc67fe59..16b3e92c79f591ec88405a7ae46bece049f8c854 100644 (file)
@@ -9,7 +9,7 @@
 184 21 25.000000 0 // jump
 205 15 15.000000 0 // painone
 220 17 15.000000 0 // paintwo
-237 3 15.000000 1 // shoot
+237 3 15.000000 0 // shoot
 240 21 15.000000 1 // taunt
 261 21 35.000000 1 // run
 282 21 35.000000 1 // runbackwards
index 71128c6c82fd047ec1b0b0a7e854df45dc67fe59..16b3e92c79f591ec88405a7ae46bece049f8c854 100644 (file)
@@ -9,7 +9,7 @@
 184 21 25.000000 0 // jump
 205 15 15.000000 0 // painone
 220 17 15.000000 0 // paintwo
-237 3 15.000000 1 // shoot
+237 3 15.000000 0 // shoot
 240 21 15.000000 1 // taunt
 261 21 35.000000 1 // run
 282 21 35.000000 1 // runbackwards
index 71128c6c82fd047ec1b0b0a7e854df45dc67fe59..16b3e92c79f591ec88405a7ae46bece049f8c854 100644 (file)
@@ -9,7 +9,7 @@
 184 21 25.000000 0 // jump
 205 15 15.000000 0 // painone
 220 17 15.000000 0 // paintwo
-237 3 15.000000 1 // shoot
+237 3 15.000000 0 // shoot
 240 21 15.000000 1 // taunt
 261 21 35.000000 1 // run
 282 21 35.000000 1 // runbackwards
index 71128c6c82fd047ec1b0b0a7e854df45dc67fe59..16b3e92c79f591ec88405a7ae46bece049f8c854 100644 (file)
@@ -9,7 +9,7 @@
 184 21 25.000000 0 // jump
 205 15 15.000000 0 // painone
 220 17 15.000000 0 // paintwo
-237 3 15.000000 1 // shoot
+237 3 15.000000 0 // shoot
 240 21 15.000000 1 // taunt
 261 21 35.000000 1 // run
 282 21 35.000000 1 // runbackwards
index 71128c6c82fd047ec1b0b0a7e854df45dc67fe59..16b3e92c79f591ec88405a7ae46bece049f8c854 100644 (file)
@@ -9,7 +9,7 @@
 184 21 25.000000 0 // jump
 205 15 15.000000 0 // painone
 220 17 15.000000 0 // paintwo
-237 3 15.000000 1 // shoot
+237 3 15.000000 0 // shoot
 240 21 15.000000 1 // taunt
 261 21 35.000000 1 // run
 282 21 35.000000 1 // runbackwards
index 71128c6c82fd047ec1b0b0a7e854df45dc67fe59..16b3e92c79f591ec88405a7ae46bece049f8c854 100644 (file)
@@ -9,7 +9,7 @@
 184 21 25.000000 0 // jump
 205 15 15.000000 0 // painone
 220 17 15.000000 0 // paintwo
-237 3 15.000000 1 // shoot
+237 3 15.000000 0 // shoot
 240 21 15.000000 1 // taunt
 261 21 35.000000 1 // run
 282 21 35.000000 1 // runbackwards
index b98d0b9818be941fbe715c5114f0b70cbd23e273..a257a2469eb0f5c7bd5feedf17d76e78848d615a 100644 (file)
@@ -9,7 +9,7 @@
 156 16 15.000000 0 // jump
 172 15 15.000000 0 // painone
 187 17 15.000000 0 // paintwo
-204 5 15.000000 1 // shoot
+204 5 15.000000 0 // shoot
 209 21 15.000000 1 // taunt
 230 21 40.000000 1 // run
 251 21 40.000000 1 // runbackwards
index 50131ee91c12fbeeb6c374b9e606114a28e9b3f2..87f24a6d0b49fed6eb041a421f8b080d1e99002e 100644 (file)
@@ -189,6 +189,7 @@ sprite wpn-hookgun        "Hook"          008000 000000 0.0 # dark green
 sprite wpn-fireball       "Fireball"      ff8000 000000 0.0 # orange
 sprite wpn-hlac           "HLAC"          00ff00 000000 0.0 # green
 sprite wpn-campingrifle   "Rifle"         80ff00 000000 0.0 # orange
+sprite wpn-minelayer      "Mine Layer"    ccff00 000000 0.0 # yellowish orange
 
 sprite dom-neut           "Control point" 00ffff 000000 0.0
 sprite dom-red            "Control point" ff0000 000000 0.0
diff --git a/models/sprites/wpn-minelayer_frame0.tga b/models/sprites/wpn-minelayer_frame0.tga
new file mode 100644 (file)
index 0000000..b2d2905
Binary files /dev/null and b/models/sprites/wpn-minelayer_frame0.tga differ
index 5660a33421e5d6d3f65b4651789af40e2dc33334..2ae8d2d6b8c7316b5ec7ed0de79d58ed59b880bc 100644 (file)
@@ -30,3 +30,4 @@ sv_doublejump 0
 sv_jumpspeedcap_min ""
 sv_jumpspeedcap_max ""
 sv_jumpspeedcap_max_disable_on_ramps 0
+g_teleport_maxspeed 320
index 82d996f55bcea8600e6e54d8c5227963e8921588..6467afad4c3b13e354e3fc8ad6069c94194cd2a2 100644 (file)
@@ -29,3 +29,4 @@ sv_doublejump 1 // TINY (1.35x normal) doublejumps only, can be disabled if want
 sv_jumpspeedcap_min 0 // need predicting? (it should already be in CSQC prediction code)
 sv_jumpspeedcap_max 0.35
 sv_jumpspeedcap_max_disable_on_ramps 1
+g_teleport_maxspeed 0
index f328f8967b67db1c46b4af61d66c5dd87951e2da..a19617d93f89be9ef474bff4f7820936bb72920e 100644 (file)
@@ -30,3 +30,4 @@ sv_doublejump 0
 sv_jumpspeedcap_min ""
 sv_jumpspeedcap_max ""
 sv_jumpspeedcap_max_disable_on_ramps 0
+g_teleport_maxspeed 0
index 805df99b8831070346e637f3eb9cc068463f9c4b..c3329426e1370368da1a0dbea20c03d8aa19501b 100644 (file)
@@ -38,3 +38,4 @@ sv_doublejump 0 // TINY (1.35x normal) doublejumps only, can be disabled if want
 sv_jumpspeedcap_min 0 // need predicting? (it should already be in CSQC prediction code)
 sv_jumpspeedcap_max ""
 sv_jumpspeedcap_max_disable_on_ramps 1
+g_teleport_maxspeed 0
index dc82a81f54702c34e8273b6003e42fd25f09b1bb..2f23ae763dbdb30e0da4f093d4fe269dce4e6bcf 100644 (file)
@@ -38,3 +38,4 @@ sv_doublejump 0
 sv_jumpspeedcap_min ""
 sv_jumpspeedcap_max ""
 sv_jumpspeedcap_max_disable_on_ramps 1
+g_teleport_maxspeed 0
index 5d9a1280b6ae7d4bb21adef218a4edcc5aada830..bb6133a8b79f8b08fef018af239bc84425235b07 100644 (file)
@@ -33,3 +33,4 @@ sv_doublejump 0
 sv_jumpspeedcap_min ""
 sv_jumpspeedcap_max 0.38
 sv_jumpspeedcap_max_disable_on_ramps 0
+g_teleport_maxspeed 0
index 064499002a2981fd266240bbb63bc2467eafc4dd..01e446e8ba32c2219d4f366c94e8b307ce88fcc9 100644 (file)
@@ -31,3 +31,4 @@ sv_doublejump 0
 sv_jumpspeedcap_min ""
 sv_jumpspeedcap_max ""
 sv_jumpspeedcap_max_disable_on_ramps 0
+g_teleport_maxspeed 0
index 6e112b9f67f3ccdcc7e26a0c7477a4fe85d16120..de2ff2591250b235a69eea7525611167386cf78d 100644 (file)
@@ -31,3 +31,4 @@ sv_doublejump 0
 sv_jumpspeedcap_min ""
 sv_jumpspeedcap_max ""
 sv_jumpspeedcap_max_disable_on_ramps 0
+g_teleport_maxspeed 0
index d4e1f54ababe70d5aadcbc7cdac254b344881e94..64ac7b019cafcc6947711454fa968d39432ebd19 100644 (file)
@@ -30,3 +30,4 @@ sv_doublejump 0
 sv_jumpspeedcap_min ""
 sv_jumpspeedcap_max ""
 sv_jumpspeedcap_max_disable_on_ramps 0
+g_teleport_maxspeed 0
index 6cb19f1bde23333f0f2363419496b0dc72b3ce5c..c527b29efb3489637e6defbbfdea9d460b404f59 100644 (file)
@@ -30,3 +30,4 @@ sv_doublejump 0
 sv_jumpspeedcap_min ""
 sv_jumpspeedcap_max ""
 sv_jumpspeedcap_max_disable_on_ramps 0
+g_teleport_maxspeed 0
index 4796765cd3db3c906d7c0b436120d755d2f7c9b9..aa2f530cdf6f782bafa86b1264a3f942cf8fb108 100644 (file)
@@ -30,3 +30,4 @@ sv_doublejump 0
 sv_jumpspeedcap_min ""
 sv_jumpspeedcap_max ""
 sv_jumpspeedcap_max_disable_on_ramps 0
+g_teleport_maxspeed 0
index c4d60c7f333b0a84d84315158ed8f82c77ff308e..0622e1a48134efa1e984be177e67f30e9dc137d1 100644 (file)
@@ -30,3 +30,4 @@ sv_doublejump 0
 sv_jumpspeedcap_min ""
 sv_jumpspeedcap_max ""
 sv_jumpspeedcap_max_disable_on_ramps 0
+g_teleport_maxspeed 0
index d317514c00f0232528c7c97a3078c976bdbc3f07..1d15fe1d67be61adbdbf3c50b4fe89b8d6be3a72 100644 (file)
@@ -30,3 +30,4 @@ sv_doublejump 0
 sv_jumpspeedcap_min ""
 sv_jumpspeedcap_max ""
 sv_jumpspeedcap_max_disable_on_ramps 0
+g_teleport_maxspeed 0
index af5f3863278bdab434c3217c22fbc00062607ef6..5b6db6b944c423b765a301238414d854ce41bf04 100644 (file)
@@ -30,3 +30,4 @@ sv_doublejump 0
 sv_jumpspeedcap_min ""
 sv_jumpspeedcap_max ""
 sv_jumpspeedcap_max_disable_on_ramps 0
+g_teleport_maxspeed 0
index 8fa5abc006df61b586cd358c6b4f55cab50feeca..f7661523ea146abdb371ee77589e5401600a641e 100644 (file)
@@ -30,3 +30,4 @@ sv_doublejump 0
 sv_jumpspeedcap_min ""
 sv_jumpspeedcap_max ""
 sv_jumpspeedcap_max_disable_on_ramps 0
+g_teleport_maxspeed 0
index e67832dcb74a97c64ab3562a166b0475a591c37f..2f12a4ebceb3ac7cea0e1ed94f7d7f1aa1ac2bf4 100644 (file)
@@ -39,3 +39,4 @@ sv_doublejump 0
 sv_jumpspeedcap_min ""
 sv_jumpspeedcap_max ""
 sv_jumpspeedcap_max_disable_on_ramps 1
+g_teleport_maxspeed 0
index 6fb02afe7880a41e02bb26f8242030acb6c9f5ef..509310843b5e31ebbd5c6c18e56bd6291f0448b6 100644 (file)
@@ -31,3 +31,4 @@ sv_doublejump 0
 sv_jumpspeedcap_min ""
 sv_jumpspeedcap_max ""
 sv_jumpspeedcap_max_disable_on_ramps 0
+g_teleport_maxspeed 0
index 927fef3c44edd49d4ddf7eced660035966311204..dc580a51190ead71c541fc9833e70c0e0449ccf0 100644 (file)
@@ -30,3 +30,4 @@ sv_doublejump 1
 sv_jumpspeedcap_min ""
 sv_jumpspeedcap_max ""
 sv_jumpspeedcap_max_disable_on_ramps 0
+g_teleport_maxspeed 0
index 7828cc608b2303368ab4bb3bfb32f2fc879a1ed8..c5f21116ec9a4bff476338502dace8b7a9937a8b 100644 (file)
@@ -31,3 +31,4 @@ sv_doublejump 1
 sv_jumpspeedcap_min ""
 sv_jumpspeedcap_max ""
 sv_jumpspeedcap_max_disable_on_ramps 0
+g_teleport_maxspeed 0
index 37973aef68f90d59a53e9ec7aaa1793cb6bfb939..a50427155e11414f2d3362960165284e1cb2344b 100644 (file)
@@ -30,3 +30,4 @@ sv_doublejump 0
 sv_jumpspeedcap_min ""
 sv_jumpspeedcap_max ""
 sv_jumpspeedcap_max_disable_on_ramps 0
+g_teleport_maxspeed 320
index 2f325586e363f133153ffcce967a796807d6c5e5..9725e8cc4a207e12d49789ea413ba09ddcc35707 100644 (file)
@@ -30,3 +30,4 @@ sv_doublejump 0
 sv_jumpspeedcap_min ""
 sv_jumpspeedcap_max ""
 sv_jumpspeedcap_max_disable_on_ramps 0
+g_teleport_maxspeed 0
index 03be62dd43d66b6c586750aef68e42a1fd7140bb..75c70c1818bec4bac9ef7dae8f2e361412a39e63 100644 (file)
@@ -30,3 +30,4 @@ sv_doublejump 0
 sv_jumpspeedcap_min ""
 sv_jumpspeedcap_max ""
 sv_jumpspeedcap_max_disable_on_ramps 0
+g_teleport_maxspeed 0
index 7492b415c56220840633b2aa256913b391931e2f..731b1482e6ddae0e04cc904cdebe671ba55c107f 100644 (file)
@@ -30,3 +30,4 @@ sv_doublejump 0
 sv_jumpspeedcap_min ""
 sv_jumpspeedcap_max ""
 sv_jumpspeedcap_max_disable_on_ramps 0
+g_teleport_maxspeed 0
index 811084dd5f316c3e8e32120cf8f3a8279d5a1be6..068d22ce67c7387e0b4ec3574dd434df246899c7 100644 (file)
@@ -30,3 +30,4 @@ sv_doublejump 0
 sv_jumpspeedcap_min ""
 sv_jumpspeedcap_max ""
 sv_jumpspeedcap_max_disable_on_ramps 0
+g_teleport_maxspeed 0
index 467c4212a02626942b5557f0d86c5a740f1b9d5f..72ca9ffcae73a43a275813ab8865ca882290c7ab 100644 (file)
@@ -30,3 +30,4 @@ sv_doublejump 0
 sv_jumpspeedcap_min ""
 sv_jumpspeedcap_max ""
 sv_jumpspeedcap_max_disable_on_ramps 0
+g_teleport_maxspeed 0
index 8a62f3e053c355a24d1f14c519f0e0d6a009e849..051775de9a900680e0ab37949b827f1d798387a7 100644 (file)
@@ -30,3 +30,4 @@ sv_doublejump 0
 sv_jumpspeedcap_min ""
 sv_jumpspeedcap_max ""
 sv_jumpspeedcap_max_disable_on_ramps 0
+g_teleport_maxspeed 0
index 18973158ebd47fb1de2ad0f06cee71f039bd1b52..8fec0268663a6455b1631276e941457ac0b74c41 100644 (file)
@@ -38,3 +38,4 @@ sv_doublejump 0
 sv_jumpspeedcap_min ""
 sv_jumpspeedcap_max ""
 sv_jumpspeedcap_max_disable_on_ramps 1
+g_teleport_maxspeed 0
index 6c6b8a4ec54133fba4d6ec2ad082419a762ab319..9191ab8e83d66f2f2e9d9142d36182ed21ff5f4c 100644 (file)
@@ -34,3 +34,4 @@ sv_doublejump 1
 sv_jumpspeedcap_min 0
 sv_jumpspeedcap_max 0.5
 sv_jumpspeedcap_max_disable_on_ramps 1
+g_teleport_maxspeed 320
index 519db9f729fbde9d008ec3bbb6443a0832019a32..3e7ee55570fa21cc92fa488a4aaae9b3a99336a4 100644 (file)
@@ -34,3 +34,4 @@ sv_doublejump 0
 sv_jumpspeedcap_min ""
 sv_jumpspeedcap_max ""
 sv_jumpspeedcap_max_disable_on_ramps 1
+g_teleport_maxspeed 0
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 f0bcba6e6b8d805020f989731ddf91d6ac15f35a..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;
@@ -350,7 +350,7 @@ vector freeze_pmove_org, freeze_input_angles;
 entity nightvision_noise, nightvision_noise2;
 
 float pickup_crosshair_time, pickup_crosshair_size;
-float use_nex_charge_pool;
+float use_nex_chargepool;
 
 float myhealth, myhealth_prev;
 float myhealth_flash;
@@ -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,9 +477,9 @@ void CSQC_UpdateView(float w, float h)
                }
        }
 
-       ColorTranslateMode = cvar("cl_stripcolorcodes");
+       ColorTranslateMode = autocvar_cl_stripcolorcodes;
        activeweapon = getstati(STAT_SWITCHWEAPON);
-       f = cvar("teamplay");
+       f = (serverflags & SERVERFLAG_TEAMPLAY);
        if(f != teamplay)
        {
                teamplay = f;
@@ -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,16 +926,16 @@ 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;
 
-                       float nex_charge, nex_charge_pool;
+                       float nex_charge, nex_chargepool;
                        nex_charge = getstatf(STAT_NEX_CHARGE);
-                       nex_charge_pool = getstatf(STAT_NEX_CHARGEPOOL);
+                       nex_chargepool = getstatf(STAT_NEX_CHARGEPOOL);
 
                        if(nex_charge_movingavg == 0) // this should only happen if we have just loaded up the game
                                nex_charge_movingavg = nex_charge;
@@ -946,31 +946,31 @@ 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
                        {
-                               if(nex_charge_pool || use_nex_charge_pool)
+                               if(nex_chargepool || use_nex_chargepool)
                                {
-                                       use_nex_charge_pool = 1;
+                                       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");
-                                       DrawCircleClippedPic(wcross_origin, wcross_size_x * ring_scale, "gfx/crosshair_ring_inner.tga", nex_charge_pool, rgb, wcross_alpha * a, DRAWFLAG_ADDITIVE);
+                                       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..476eb607e48b6be0b28f05bba4a7aeef19d6e532 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)
        {
@@ -498,6 +498,7 @@ void HUD_Panel_ExportCfg(string cfgname)
                                        HUD_Write_PanelCvar_q("_iconalign");
                                        HUD_Write_PanelCvar_q("_progressbar");
                                        HUD_Write_PanelCvar_q("_progressbar_name");
+                                       HUD_Write_PanelCvar_q("_progressbar_xoffset");
                                        HUD_Write_PanelCvar_q("_text");
                                        break;
                                case HUD_PANEL_POWERUPS:
@@ -843,8 +844,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 +933,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 +1350,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 +1366,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 +1385,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 +1443,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 +1524,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 +1549,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 +1580,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 +1619,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 +1652,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 +1663,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 +1672,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 +1685,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 +1713,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 +1722,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 +1804,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 +1824,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 +1916,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 +2128,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 +2174,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 +2198,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 +2224,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 +2247,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 +2281,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 +2313,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 +2366,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 +2392,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 +2404,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 +2430,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 +2442,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 +2481,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 +2499,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 +2528,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 +2546,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 +2583,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 +2612,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 +2675,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 +3043,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 +3154,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 +3166,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;
@@ -3562,7 +3563,7 @@ void HUD_Radar(void)
        if(hud_panel_radar_rotation == 0)
        {
                // max-min distance must fit the radar in any rotation
-               bigsize = vlen_minnorm2d(teamradar_size2d) * scale2d / (1.05 * vlen2d(mi_max - mi_min));
+               bigsize = vlen_minnorm2d(teamradar_size2d) * scale2d / (1.05 * vlen2d(mi_scale));
        }
        else
        {
@@ -3590,7 +3591,7 @@ void HUD_Radar(void)
                  f * bigsize
                + (1 - f) * normalsize;
        teamradar_origin3d_in_texcoord = teamradar_3dcoord_to_texcoord(
-                 f * (mi_min + mi_max) * 0.5
+                 f * mi_center
                + (1 - f) * view_origin);
 
        color1 = GetPlayerColor(player_localentnum-1);
@@ -3920,7 +3921,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 +3965,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 +4484,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 +4675,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 +4756,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 +4823,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 +4834,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 +5036,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 +5067,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 +5093,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 +5106,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 +5192,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 +5219,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 +5229,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 +5250,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 +5274,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..31cdc45bfa04b4bcffe5697e0bbf47d4fcc4ccec 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,8 +883,10 @@ 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 && gametype != GAME_CTS)
                return 1;
+    else if (spectatee_status == -1)
+        return 1;
        else if (scoreboard_showscores_force)
                return 1;
        return 0;
@@ -897,7 +899,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 +1030,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 +1082,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 +1101,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 +1137,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 +1157,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 +1181,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..2cd50789f14157b307380372329a1157a5e29c4d 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;
                */
 
@@ -409,23 +409,23 @@ 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_fadedistance = vlen(mi_scale);
+       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 = waypointsprite_fadedistance * autocvar_g_waypointsprite_distancefadedistancemultiplier;
+       waypointsprite_alpha = autocvar_g_waypointsprite_alpha;
 
        if(!waypointsprite_initialized)
        {
@@ -461,6 +461,6 @@ void WaypointSprite_Load()
                        db_put(tempdb, sname, ftos(max(f, stof(db_get(tempdb, sname)))));
                }
                search_end(dh);
+               waypointsprite_initialized = true;
        }
-       waypointsprite_initialized = 1;
 }
index b3929c7cda9ffc057e2a6dd495bea87eac8e5d9e..50abe9875e0899dae8da1a549b0639511ee6aa83 100644 (file)
@@ -660,3 +660,4 @@ string HUD_PANELNAME_INFOMESSAGES   = "infomessages";
 float HUD_MENU_ENABLE          = 0;
 
 #define SERVERFLAG_ALLOW_FULLBRIGHT 1
+#define SERVERFLAG_TEAMPLAY 2
index 37ffb25e7c3cff3b49e3581dc69a179048483212..5387c05aae1cac4d2d26d1aae4172536be840326 100644 (file)
@@ -1,5 +1,5 @@
 // WEAPON PLUGIN SYSTEM
-entity weapon_info[24];
+entity weapon_info[WEP_MAXCOUNT];
 entity dummy_weapon_info;
 
 void register_weapon(float id, float(float) func, float ammotype, float i, float weapontype, float pickupbasevalue, string modelname, string shortname, string wname)
@@ -43,7 +43,7 @@ void register_weapons_done()
 
        float i;
        weaponorder_byid = "";
-       for(i = 24; i >= 1; --i)
+       for(i = WEP_MAXCOUNT; i >= 1; --i)
                if(weapon_info[i-1])
                        weaponorder_byid = strcat(weaponorder_byid, " ", ftos(i));
        weaponorder_byid = strzone(substring(weaponorder_byid, 1, strlen(weaponorder_byid) - 1));
index 44f8751733aab62e96406a890da8cee451966806..83ea8e3e5827fedbc29f9f7534aec14f8865ca80 100644 (file)
@@ -1953,3 +1953,23 @@ float vercmp(string v1, string v2)
 
        return vercmp_recursive(v1, v2);
 }
+
+float u8_strsize(string s)
+{
+       float l, i, c;
+       l = 0;
+       for(i = 0; ; ++i)
+       {
+               c = str2chr(s, i);
+               if(c <= 0)
+                       break;
+               ++l;
+               if(c >= 0x80)
+                       ++l;
+               if(c >= 0x800)
+                       ++l;
+               if(c >= 0x10000)
+                       ++l;
+       }
+       return l;
+}
index cfb955e3566cb44d576ab6b09963eed1fe79c1b2..79b93d3ede3d238d5e6d8ad4eaf4f787aa331ea0 100644 (file)
@@ -247,3 +247,5 @@ vector NearestPointOnBox(entity box, vector org);
 #endif
 
 float vercmp(string v1, string v2);
+
+float u8_strsize(string s);
index 2d64590306139cc97f1b860ac56c5e7a72de836a..750bc83b890453eb917fcaaac3aa804a54142727 100644 (file)
@@ -25,7 +25,7 @@ CLASS(InputBox) EXTENDS(Label)
        ATTRIB(InputBox, forbiddenCharacters, string, "")
        ATTRIB(InputBox, color, vector, '1 1 1')
        ATTRIB(InputBox, colorF, vector, '1 1 1')
-       ATTRIB(InputBox, maxLength, float, 255)
+       ATTRIB(InputBox, maxLength, float, 255) // if negative, it counts bytes, not chars
 ENDCLASS(InputBox)
 void InputBox_Clear_Click(entity btn, entity me);
 #endif
@@ -79,8 +79,16 @@ void InputBox_enterText(entity me, string ch)
        for(i = 0; i < strlen(ch); ++i)
                if(strstrofs(me.forbiddenCharacters, substring(ch, i, 1), 0) > -1)
                        return;
-       if(strlen(ch) + strlen(me.text) > me.maxLength)
-               return;
+       if(me.maxLength > 0)
+       {
+               if(strlen(ch) + strlen(me.text) > me.maxLength)
+                       return;
+       }
+       else if(me.maxLength < 0)
+       {
+               if(u8_strsize(ch) + u8_strsize(me.text) > -me.maxLength)
+                       return;
+       }
        me.setText(me, strcat(substring(me.text, 0, me.cursorPos), ch, substring(me.text, me.cursorPos, strlen(me.text) - me.cursorPos)));
        me.cursorPos += strlen(ch);
 }
index d1116a70db870bcd7fbc9bb88ece64d9740d4dd4..3eaf2677e9a4316231080e552e34ad0c7bf7365b 100644 (file)
@@ -15,7 +15,9 @@ CLASS(XonoticCvarList) EXTENDS(XonoticListBox)
        ATTRIB(XonoticCvarList, columnValueOrigin, float, 0)
        ATTRIB(XonoticCvarList, columnValueSize, float, 0)
 
+       METHOD(XonoticCvarList, mouseRelease, float(entity, vector))
        METHOD(XonoticCvarList, setSelected, void(entity, float))
+
        ATTRIB(XonoticCvarList, controlledTextbox, entity, NULL)
        ATTRIB(XonoticCvarList, cvarNameBox, entity, NULL)
        ATTRIB(XonoticCvarList, cvarDescriptionBox, entity, NULL)
@@ -162,6 +164,8 @@ float XonoticCvarList_keyDown(entity me, float scan, float ascii, float shift)
                CvarList_Revert_Click(world, me);
                return 1;
        }
+       else if(scan == K_ENTER)
+               me.cvarValueBox.parent.setFocus(me.cvarValueBox.parent, me.cvarValueBox);
        else if(SUPER(XonoticCvarList).keyDown(me, scan, ascii, shift))
                return 1;
        else if(!me.controlledTextbox)
@@ -170,6 +174,13 @@ float XonoticCvarList_keyDown(entity me, float scan, float ascii, float shift)
                return me.controlledTextbox.keyDown(me.controlledTextbox, scan, ascii, shift);
 }
 
+float XonoticCvarList_mouseRelease(entity me, vector pos)
+{
+       if(me.pressed == 2)
+               me.cvarValueBox.parent.setFocus(me.cvarValueBox.parent, me.cvarValueBox);
+       return SUPER(XonoticCvarList).mouseRelease(me, pos);
+}
+
 void CvarList_Value_Change(entity box, entity me)
 {
        cvar_set(me.cvarNameBox.text, box.text);
@@ -180,4 +191,5 @@ void CvarList_Revert_Click(entity btn, entity me)
        me.cvarValueBox.setText(me.cvarValueBox, me.cvarDefault);
        me.cvarValueBox.cursorPos = strlen(me.cvarDefault);
 }
+
 #endif
index 562c097ce8f228d6738fdf6c8bc0f8cd6a02c9f1..586896171e76df85676739208b209b6a113524b3 100644 (file)
@@ -46,7 +46,7 @@ void XonoticPlayerSettingsTab_fill(entity me)
        me.TR(me);
                me.TD(me, 1, 3.0, box = makeXonoticInputBox(1, "_cl_name"));
                        box.forbiddenCharacters = "\r\n\\\"$"; // don't care, isn't getting saved
-                       box.maxLength = 63;
+                       box.maxLength = -63; // negativ means encoded length in bytes
                        label.textEntity = box;
        me.TR(me);
                me.TD(me, 5, 1, e = makeXonoticColorpicker(box));
index c6fca21ac2e606d91b5be05217a793f6abc754f6..1cb4cf50db979f0d7db77ef9c203a348f97bfa46 100644 (file)
@@ -359,8 +359,43 @@ void preMenuDraw()
                if(!_Nex_ExtResponseSystem_Queried)
                {
                        _Nex_ExtResponseSystem_Queried = 1;
-                       uri_get(sprintf("http://www.xonotic.org/dl/checkupdate.txt?version=%s", uri_escape(cvar_string("g_xonoticversion"))), URI_GET_UPDATENOTIFICATION);
-                       //crypto_uri_postbuf(sprintf("http://www.xonotic.org/dl/t/checkupdate2.cgi?version=%s", uri_escape(cvar_string("g_xonoticversion"))), URI_GET_UPDATENOTIFICATION, "application/x-www-urlencoded", "hello=world&foo=bar", -1, 0);
+                       float startcnt;
+                       string uri;
+
+                       cvar_set("cl_startcount", ftos(startcnt = cvar("cl_startcount") + 1));
+
+                       // for privacy, munge the start count a little
+                       startcnt = floor((floor(startcnt / 10) + random()) * 10);
+                       uri = sprintf("http://www.xonotic.org/dl/checkupdate.txt?version=%s&cnt=%d", uri_escape(cvar_string("g_xonoticversion")), startcnt);
+
+#ifdef CVAR_POPCON
+                       float cvar_handle, popcon_handle;
+                       float n, i, j;
+                       string k, s;
+                       cvar_handle = buf_create();
+                       buf_cvarlist(cvar_handle, "", "");
+                       n = buf_getsize(cvar_handle);
+                       popcon_handle = buf_create();
+                       for(i= 0, j = 0; i < n; ++i)
+                       {
+                               k = bufstr_get(cvar_handle, i);
+                               if(!(cvar_type(k) & CVAR_TYPEFLAG_SAVED))
+                                       continue;
+                               s = sprintf("%s=%d", uri_escape(k), cvar_string(k) != cvar_defstring(k));
+                               bufstr_set(popcon_handle, j, s);
+                               ++j;
+                       }
+                       buf_del(cvar_handle);
+                       uri_postbuf(
+                               uri, URI_GET_UPDATENOTIFICATION,
+                               "application/x-www-form-urlencoded",
+                               "&",
+                               popcon_handle
+                       );
+                       buf_del(popcon_handle);
+#else
+                       uri_get(uri, URI_GET_UPDATENOTIFICATION);
+#endif
                }
        }
 
index f683876485d97829d00b254bf393a89f1acfd3bc..84488fc7796954883c6e484342945b597b5bc6eb 100644 (file)
@@ -1,5 +1,4 @@
 .float cvar_cl_accuracy_data_share;
-var float autocvar_sv_accuracy_data_share = 1;
 
 // init/free
 void accuracy_init(entity e);
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 36334b27127b218ece882fbbc6ea47da559fdad9..c5beab269911b3a761d0bd7fa9785b870a12bc32 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_kill_antispam;
+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_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_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;
+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;
+float autocvar_gameversion_min;
+float autocvar_gameversion_max;
+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;
+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_doublejump;
+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_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;
+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 945600a886b208e6af45bb58aba71cd5d304a4ce..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 (teamplay && 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 0550431e968bd8b31b49a7c7546a89faed272bd5..9e6d447e6a8d22ef3b9e857e32f00efe67b282d1 100644 (file)
@@ -108,8 +108,6 @@ void bot_serverframe();
  * Imports
  */
 
-float sv_maxspeed;
-
 void() havocbot_setupbot;
 
 float c1, c2, c3, c4;
index 934aba87ddc6fd2f175fcbde18459dc3de57f694..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)
        {
@@ -1026,142 +1026,6 @@ void havocbot_chooseweapon()
                        }
                }
        }
-
-#ifdef 0
-       // TODO: This disabled code is not working well and got replaced by custom weapon priorities.
-       // However, this logic should be refactored and moved to weapons code so each new weapon can be
-       // evaluated dynamically by bots without updating the "ai" or config files.     --mand1nga
-       float s, distancefromfloor, currentscore;
-
-
-       // Formula:
-       //      (Damage/Sec * Weapon spefic change to get that damage)
-       //      *(Time to get to target * weapon specfic hitchange bonus) / (in a time of maxdelaytime)
-       //      *(Spread change of hit) // if it applies
-       //      *(Penality for target beeing in air)
-       // %weaponaddpoint
-
-       traceline(self.enemy.origin,self.enemy.origin-'0 0 1000',TRUE,world);
-       distancefromfloor = self.enemy.origin_z - trace_endpos_z;
-
-       if (client_hasweapon(self, WEP_MINSTANEX, TRUE, FALSE))
-               minstanex = (1000/cvar("g_balance_minstanex_refire")*1.0)
-                       * (0.5);
-
-       if (client_hasweapon(self, WEP_ROCKET_LAUNCHER, TRUE, FALSE)  &&
-               !(      cvar("bot_ai_weapon_combo") && self.weapon == WEP_ROCKET_LAUNCHER &&
-                       af > combo_time
-               )
-       )
-               rocket = (cvar("g_balance_rocketlauncher_damage")/cvar("g_balance_rocketlauncher_refire")*0.75)
-                       * bound(0,(cvar("g_balance_rocketlauncher_speed")/distance*maxdelaytime),1)*1.5;
-
-       if (client_hasweapon(self, WEP_NEX, TRUE, FALSE)  &&
-               !(      cvar("bot_ai_weapon_combo") && self.weapon == WEP_NEX &&
-                       af > combo_time
-               )
-       )
-               nex = (cvar("g_balance_nex_damage")/cvar("g_balance_nex_refire")*1.0)
-                       * (0.5);
-
-       if (client_hasweapon(self, WEP_HAGAR, TRUE, FALSE) ) // &&
-       //      !( cvar("bot_ai_weapon_combo") && self.weapon == WEP_HAGAR &&  time < self.bot_lastshot + cvar("g_balance_hagar_primary_refire") ))
-               hagar = (cvar("g_balance_hagar_primary_damage")/cvar("g_balance_hagar_primary_refire")*1.0)
-                       * bound(0,(cvar("g_balance_hagar_primary_speed")/distance*maxdelaytime),1)*0.2;
-
-       if (client_hasweapon(self, WEP_GRENADE_LAUNCHER, TRUE, FALSE) &&
-               !(
-                       cvar("bot_ai_weapon_combo") && self.weapon == WEP_GRENADE_LAUNCHER &&
-                       af > combo_time
-               )
-       )
-               grenade = (cvar("g_balance_grenadelauncher_primary_damage")/cvar("g_balance_grenadelauncher_primary_refire")*1.0)
-                       * bound(0,(cvar("g_balance_grenadelauncher_primary_speed")/distance*maxdelaytime),1)*1.1;
-
-       if (client_hasweapon(self, WEP_MINE_LAYER, TRUE, FALSE) &&
-               !(
-                       cvar("bot_ai_weapon_combo") && self.weapon == WEP_MINE_LAYER &&
-                       af > combo_time
-               )
-       )
-               mine = (cvar("g_balance_minelayer_damage")/cvar("g_balance_minelayer_refire")*1.0)
-                       * bound(0,(cvar("g_balance_minelayer_speed")/distance*maxdelaytime),1)*1.1;
-
-       if (client_hasweapon(self, WEP_ELECTRO, TRUE, FALSE) &&
-               !(      cvar("bot_ai_weapon_combo") && self.weapon == WEP_ELECTRO &&
-                       af > combo_time
-               )
-       )
-               electro = (cvar("g_balance_electro_primary_damage")/cvar("g_balance_electro_primary_refire")*0.75)
-                       * bound(0,(cvar("g_balance_electro_primary_speed")/distance*maxdelaytime),1)*1.0;
-
-       if (client_hasweapon(self, WEP_CRYLINK, TRUE, FALSE) ) // &&
-       //      !( self.weapon == WEP_CRYLINK &&  time < self.bot_lastshot + cvar("g_balance_crylink_primary_refire") ))
-               crylink = (cvar("g_balance_crylink_primary_damage")/cvar("g_balance_crylink_primary_refire")*1.0)
-                       * bound(0,(cvar("g_balance_crylink_primary_speed")/distance*maxdelaytime),1)*(64/(32+cvar("g_balance_crylink_primary_spread")*distance))*1.0;
-
-       if (client_hasweapon(self, WEP_UZI, TRUE, FALSE) ) // &&
-       //      !( self.weapon == WEP_UZI &&  time < self.bot_lastshot + cvar("g_balance_uzi_sustained_refire") ))
-               uzi = (cvar("g_balance_uzi_sustained_damage")/cvar("g_balance_uzi_sustained_refire")*1.0)
-                       * bound(0,32/(32+cvar("g_balance_uzi_sustained_spread")*distance),1);
-
-       if (client_hasweapon(self, WEP_SHOTGUN, TRUE, FALSE) &&
-               !(      cvar("bot_ai_weapon_combo") && self.weapon == WEP_SHOTGUN &&
-                       af > combo_time
-               )
-       )
-               shotgun = (cvar("g_balance_shotgun_primary_damage")*cvar("g_balance_shotgun_primary_bullets")/cvar("g_balance_shotgun_primary_refire")*1.0)
-                       * bound(0,32/(32+cvar("g_balance_shotgun_primary_spread")*distance),1);
-
-       if (client_hasweapon(self, WEP_LASER, FALSE, FALSE) &&
-               !(      cvar("bot_ai_weapon_combo") && self.weapon == WEP_LASER &&
-                       af > combo_time
-               )
-       )
-               laser = (cvar("g_balance_laser_primary_damage")/cvar("g_balance_laser_primary_refire")*1.0)
-                       * bound(0,cvar("g_balance_laser_primary_speed")/distance*maxdelaytime,1);
-
-       if((self.enemy.flags & FL_ONGROUND)==FALSE){
-               rocket = rocket   * (1.5-bound(0, distancefromfloor/cvar("g_balance_rocketlauncher_radius"         ),0.9)); //slight bigger change
-               grenade = grenade * (1.5-bound(0,distancefromfloor/cvar("g_balance_grenadelauncher_primary_radius"),0.95));
-               electro = electro * (1.5-bound(0,distancefromfloor/cvar("g_balance_electro_primary_radius"        ),0.95));
-               laser = laser     * (1.5-bound(0,distancefromfloor/cvar("g_balance_laser_primary_radius"                  ),0.95));
-       }
-       /*
-       dprint("Floor distance: ",ftos(distancefromfloor),"\n");
-       dprint("Rocket: " , ftos(rocket  ), "\n");
-       dprint("Nex: "    , ftos(nex     ), "\n");
-       dprint("Hagar: "  , ftos(hagar   ), "\n");
-       dprint("Grenade: ", ftos(grenade ), "\n");
-       dprint("Mine: "   , ftos(mine    ), "\n");
-       dprint("Electro: ", ftos(electro ), "\n");
-       dprint("Crylink: ", ftos(crylink ), "\n");
-       dprint("Uzi: "    , ftos(uzi     ), "\n");
-       dprint("Shotgun :", ftos(shotgun ), "\n");
-       dprint("Laser   :", ftos(laser   ), "\n\n");
-       */
-       currentscore = -1;
-       w = WEP_MINSTANEX        ;s = minstanex;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
-       w = WEP_ROCKET_LAUNCHER  ;s = rocket   ;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
-       w = WEP_NEX              ;s = nex      ;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
-       w = WEP_HAGAR            ;s = hagar    ;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
-       w = WEP_GRENADE_LAUNCHER ;s = grenade  ;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
-       w = WEP_MINE_LAYER       ;s = mine     ;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
-       w = WEP_ELECTRO          ;s = electro  ;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
-       w = WEP_CRYLINK          ;s = crylink  ;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
-       w = WEP_UZI              ;s = uzi      ;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
-       w = WEP_SHOTGUN          ;s = shotgun  ;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
-       w = WEP_LASER            ;s = laser    ;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
-
-       // switch if the best weapon would provide a significant damage increase
-       if (bestscore > currentscore*1.5){
-               self.switchweapon = bestweapon;
-
-               // buys time for detonating the rocket. not tested yet
-               if ( cvar("bot_ai_weapon_combo") && bestweapon == WEP_ROCKET_LAUNCHER )
-                       self.bot_chooseweapontime += (distance  / cvar("g_balance_rocketlauncher_speed"));
-       }
-#endif
 };
 
 void havocbot_aim()
@@ -1346,7 +1210,7 @@ vector havocbot_dodge()
                if (head.owner != self)
                {
                        vl = vlen(head.velocity);
-                       if (vl > sv_maxspeed * 0.3)
+                       if (vl > autocvar_sv_maxspeed * 0.3)
                        {
                                n = normalize(head.velocity);
                                v = self.origin - head.origin;
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..bc84340287ff8938e5e3b60d80d9073f41443095 100644 (file)
@@ -35,7 +35,7 @@ void havocbot_goalrating_ons_offenseitems(float ratingscale, vector org, float s
                needarmor = TRUE;
 
        // Needs weapons?
-       for(i = WEP_FIRST; i < WEP_LAST ; ++i)
+       for(i = WEP_FIRST; i <= WEP_LAST ; ++i)
        {
                // Find weapon
                if(power2of(i-1) & self.weapons)
@@ -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 1a8db10af5238ff5c7fe15acdd50f765b306bafb..9a36546716d6dc644512e2536a1f449791be55c8 100644 (file)
@@ -64,13 +64,13 @@ void CampaignPreInit()
 {
        float baseskill;
        string title;
-       if(cvar("sv_cheats"))
+       if(autocvar_sv_cheats)
        {
                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", cvar_string("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 0104f89b3f2bcfe5742fc0abb5ee6582880d5642..fc54d49148835d9ed584c1632866f22ccaedc1f4 100644 (file)
@@ -14,7 +14,7 @@ void Drag_MoveDrag(entity from, entity to) { }
 #else
 
 .float maycheat;
-float sv_cheats;
+float gamestart_sv_cheats;
 
 #define CHIMPULSE_SPEEDRUN_INIT 30
 #define CHIMPULSE_GIVE_ALL 99
@@ -28,7 +28,7 @@ float sv_cheats;
 
 void CheatInit()
 {
-       sv_cheats = cvar("sv_cheats");
+       gamestart_sv_cheats = autocvar_sv_cheats;
 }
 
 void CheatShutdown()
@@ -61,7 +61,7 @@ float CheatsAllowed(float i, float argc, float fr) // the cheat gets passed as a
                return 1;
        
        // sv_cheats
-       if(sv_cheats && autocvar_sv_cheats)
+       if(gamestart_sv_cheats && autocvar_sv_cheats)
                return 1;
 
        // if we get here, player is not allowed to cheat. Log it.
@@ -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;
                                }
@@ -215,7 +215,7 @@ float CheatImpulse(float i)
                        break;
                case CHIMPULSE_TELEPORT:
                        IS_CHEAT(i, 0, 0);
-                       if(MoveToRandomMapLocation(self, DPCONTENTS_SOLID | DPCONTENTS_CORPSE | DPCONTENTS_PLAYERCLIP, DPCONTENTS_SLIME | DPCONTENTS_LAVA | DPCONTENTS_SKY | DPCONTENTS_BODY | DPCONTENTS_DONOTENTER, Q3SURFACEFLAG_SKY, ((sv_cheats >= 2) ? 100000 : 100), 1024, 256))
+                       if(MoveToRandomMapLocation(self, DPCONTENTS_SOLID | DPCONTENTS_CORPSE | DPCONTENTS_PLAYERCLIP, DPCONTENTS_SLIME | DPCONTENTS_LAVA | DPCONTENTS_SKY | DPCONTENTS_BODY | DPCONTENTS_DONOTENTER, Q3SURFACEFLAG_SKY, ((gamestart_sv_cheats >= 2) ? 100000 : 100), 1024, 256))
                        {
                                self.angles_x = -self.angles_x;
                                self.fixangle = TRUE;
@@ -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 cb365a3ba46f6363c73bdce67c0c2813cce5aa53..8c276919c51082206169b6050dd44335d7d1fc84 100644 (file)
@@ -1,3 +1,5 @@
+float autocvar_sv_cheats; // must... declare... global
+
 float cheatcount_total;
 .float cheatcount;
 void CheatInit();
index a1a8c4f900ad0a959e5993c09746868d8cb955a1..475771fd3a23e86c174b5a2592a0122b0babe8f8 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 != cvar("sv_defaultplayercolors"))
-                               setcolor(self, cvar("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_charge_pool"))
-                               self.nex_charge_pool_ammo = 1;
-                       self.nex_charge = cvar("g_balance_nex_charge_start");
+                       if(autocvar_g_balance_nex_secondary_chargepool)
+                               self.nex_chargepool_ammo = 1;
+                       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;
        }
 }
@@ -1222,6 +1222,7 @@ Called when a client types 'kill' in the console
 =============
 */
 
+.float clientkill_nexttime;
 void ClientKill_Now_TeamChange()
 {
        if(self.killindicator_teamchange == -1)
@@ -1229,24 +1230,30 @@ void ClientKill_Now_TeamChange()
                self.team = -1;
                JoinBestTeam( self, FALSE, FALSE );
        }
+       else if(self.killindicator_teamchange == -2)
+       {
+               if(g_ca)
+                       self.caplayer = 0;
+               if(blockSpectators)
+                       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"));
+               PutObserverInServer();
+       }
        else
                SV_ChangeTeam(self.killindicator_teamchange - 1);
 }
 
 void ClientKill_Now()
 {
+       remove(self.killindicator);
+       self.killindicator = world;
+
        if(self.killindicator_teamchange)
                ClientKill_Now_TeamChange();
 
        // in any case:
        Damage(self, self, self, 100000, DEATH_KILL, self.origin, '0 0 0');
 
-       if(self.killindicator)
-       {
-               dprint("Cleaned up after a leaked kill indicator.\n");
-               remove(self.killindicator);
-               self.killindicator = world;
-       }
+       // now I am sure the player IS dead
 }
 void KillIndicator_Think()
 {
@@ -1263,6 +1270,11 @@ void KillIndicator_Think()
                ClientKill_Now(); // no oldself needed
                return;
        }
+    else if(g_cts && self.health == 1) // health == 1 means that it's silent
+    {
+        self.nextthink = time + 1;
+        self.cnt -= 1;
+    }
        else
        {
                if(self.cnt <= 10)
@@ -1275,6 +1287,8 @@ void KillIndicator_Think()
                        {
                                if(self.owner.killindicator_teamchange == -1)
                                        centerprint(self.owner, strcat("Changing team in ", ftos(self.cnt), " seconds"));
+                               else if(self.owner.killindicator_teamchange == -2)
+                                       centerprint(self.owner, strcat("Spectating in ", ftos(self.cnt), " seconds"));
                                else
                                        centerprint(self.owner, strcat("Changing to ", ColoredTeamName(self.owner.killindicator_teamchange), " in ", ftos(self.cnt), " seconds"));
                        }
@@ -1286,19 +1300,34 @@ void KillIndicator_Think()
        }
 }
 
-void ClientKill_TeamChange (float targetteam) // 0 = don't change, -1 = auto
+void ClientKill_TeamChange (float targetteam) // 0 = don't change, -1 = auto, -2 = spec
 {
        float killtime;
        entity e;
-       killtime = cvar("g_balance_kill_delay");
+       killtime = autocvar_g_balance_kill_delay;
 
-       if(g_race_qualifying)
+       if(g_race_qualifying || g_cts)
                killtime = 0;
 
+    if(g_cts && self.killindicator && self.killindicator.health == 1) // self.killindicator.health == 1 means that the kill indicator was spawned by CTS_ClientKill
+    {
+               remove(self.killindicator);
+               self.killindicator = world;
+
+        ClientKill_Now(); // allow instant kill in this case
+        return;
+    }
+
        self.killindicator_teamchange = targetteam;
 
-       if(!self.killindicator)
+    if(!self.killindicator)
        {
+               if(self.modelindex && self.deadflag == DEAD_NO)
+               {
+                       killtime = max(killtime, self.clientkill_nexttime - time);
+                       self.clientkill_nexttime = time + killtime + autocvar_g_balance_kill_antispam;
+               }
+
                if(killtime <= 0 || !self.modelindex || self.deadflag != DEAD_NO)
                {
                        ClientKill_Now();
@@ -1334,10 +1363,14 @@ void ClientKill_TeamChange (float targetteam) // 0 = don't change, -1 = auto
        }
        if(self.killindicator)
        {
-               if(targetteam)
-                       self.killindicator.colormod = TeamColor(targetteam);
-               else
+               if(targetteam == 0) // just die
                        self.killindicator.colormod = '0 0 0';
+               else if(targetteam == -1) // auto
+                       self.killindicator.colormod = '0 1 0';
+               else if(targetteam == -2) // spectate
+                       self.killindicator.colormod = '0.5 0.5 0.5';
+               else
+                       self.killindicator.colormod = TeamColor(targetteam);
        }
 }
 
@@ -1355,20 +1388,15 @@ void ClientKill (void)
                ClientKill_TeamChange(0);
 }
 
-void CTS_ClientKill_Think (void)
+void CTS_ClientKill (entity e) // silent version of ClientKill, used when player finishes a CTS run. Useful to prevent cheating by running back to the start line and starting out with more speed
 {
-       self = self.owner; // set self to the player to be killed
-       sprint(self, "^1You were killed in order to prevent cheating!");
-       ClientKill_Now();
-}
-
-void CTS_ClientKill (float t) // silent version of ClientKill
-{
-       entity e;
-       e = spawn();
-       e.owner = self;
-       e.think = CTS_ClientKill_Think;
-       e.nextthink = t;
+    e.killindicator = spawn();
+    e.killindicator.owner = e;
+    e.killindicator.think = KillIndicator_Think;
+    e.killindicator.nextthink = time + (e.lip) * 0.05;
+    e.killindicator.cnt = ceil(autocvar_g_cts_finish_kill_delay);
+    e.killindicator.health = 1; // this is used to indicate that it should be silent
+    e.lip = 0;
 }
 
 void DoTeamChange(float destteam)
@@ -1426,25 +1454,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 +1555,39 @@ void ClientConnect (void)
        //      dom_player_join_team(self);
 
        // identify the right forced team
-       if(PlayerInIDList(self, cvar_string("g_forced_team_red")))
+       if(autocvar_g_campaign)
+       {
+               if(clienttype(self) == CLIENTTYPE_REAL) // only players, not bots
+               {
+                       switch(autocvar_g_campaign_forceteam)
+                       {
+                               case 1: self.team_forced = COLOR_TEAM1; break;
+                               case 2: self.team_forced = COLOR_TEAM2; break;
+                               case 3: self.team_forced = COLOR_TEAM3; break;
+                               case 4: self.team_forced = COLOR_TEAM4; break;
+                               default: self.team_forced = 0;
+                       }
+               }
+       }
+       else 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 +1598,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 +1622,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);
@@ -1619,9 +1661,6 @@ void ClientConnect (void)
        // get other cvars from player
        GetCvars(0);
 
-       // set cvar for team scoreboard
-       stuffcmd(self, strcat("set teamplay ", ftos(teamplay), "\n"));
-
        // notify about available teams
        if(teams_matter)
        {
@@ -1653,15 +1692,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");
        }
 
@@ -1679,7 +1718,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"));
@@ -1708,7 +1747,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);
@@ -1756,7 +1795,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");
@@ -1928,19 +1967,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);
@@ -1968,7 +2007,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;
@@ -2009,7 +2048,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
@@ -2055,7 +2094,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");
@@ -2076,7 +2115,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");
@@ -2094,7 +2133,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");
@@ -2109,10 +2148,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
@@ -2122,7 +2161,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)
@@ -2180,15 +2219,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;
 
@@ -2196,27 +2235,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;
@@ -2231,10 +2270,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)
@@ -2242,7 +2281,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;
@@ -2414,13 +2453,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();
@@ -2428,7 +2467,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;
@@ -2456,7 +2495,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;
@@ -2465,7 +2504,7 @@ float isJoinAllowed() {
                if(e.classname == "player")
                        currentlyPlaying += 1;
        }
-       if(currentlyPlaying < cvar("g_maxplayers"))
+       if(currentlyPlaying < autocvar_g_maxplayers)
                return TRUE;
 
        return FALSE;
@@ -2477,7 +2516,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);
                }
@@ -2568,8 +2607,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)
        {
@@ -2585,7 +2624,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);
@@ -2599,24 +2638,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"));
                                                }
                                        }
                                }
@@ -2670,18 +2709,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;
                        }
@@ -2707,7 +2746,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 || g_cts || autocvar_g_forced_respawn);
                                if (self.deadflag == DEAD_DYING)
                                {
                                        if(force_respawn)
@@ -2755,7 +2794,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;
 
@@ -2764,23 +2803,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;
                        }
                }
@@ -2842,8 +2881,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();
@@ -2857,7 +2896,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) {
@@ -2871,7 +2910,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;
@@ -2927,12 +2966,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;
@@ -3041,9 +3080,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 b852e3f05b8652b6c35a242148167f2180034156..e2feca927b94472af9ff963e1c01d141be5d2d01 100644 (file)
@@ -1,29 +1,6 @@
 .float race_penalty;
 .float restart_jump;
 
-float sv_accelerate;
-float sv_friction;
-float sv_maxspeed;
-float sv_airaccelerate;
-float sv_maxairspeed;
-float sv_stopspeed;
-float sv_gravity;
-float sv_airaccel_sideways_friction;
-float sv_airaccel_qw;
-float sv_airstopaccelerate;
-float sv_airstrafeaccelerate;
-float sv_maxairstrafespeed;
-float sv_airstrafeaccel_qw;
-float sv_aircontrol;
-float sv_aircontrol_power;
-float sv_aircontrol_penalty;
-float sv_warsowbunny_airforwardaccel;
-float sv_warsowbunny_accel;
-float sv_warsowbunny_topspeed;
-float sv_warsowbunny_turnaccel;
-float sv_warsowbunny_backtosideratio;
-float sv_airspeedlimit_nonqw;
-
 .float ladder_time;
 .entity ladder_entity;
 .float gravity;
@@ -53,14 +30,14 @@ void PlayerJump (void)
        float doublejump;
 
        doublejump = FALSE;
-       if (sv_doublejump)
+       if (autocvar_sv_doublejump)
        {
                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.7)
                        doublejump = TRUE;
        }
 
-       mjumpheight = cvar("sv_jumpvelocity");
+       mjumpheight = autocvar_sv_jumpvelocity;
        if (self.waterlevel >= WATERLEVEL_SWIMMING)
        {
                if (self.watertype == CONTENT_WATER)
@@ -73,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
@@ -81,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)
                                {
@@ -137,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;
@@ -165,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"));
@@ -354,7 +331,7 @@ void RaceCarPhysics()
                vector rigvel_xy, neworigin, up;
                float mt;
 
-               rigvel_z -= frametime * sv_gravity; // 4x gravity plays better
+               rigvel_z -= frametime * autocvar_sv_gravity; // 4x gravity plays better
                rigvel_xy = vec2(rigvel);
 
                if(g_bugrigs_planar_movement_car_jumping && !g_touchexplode) // touchexplode is a better way to handle collisions
@@ -403,7 +380,7 @@ void RaceCarPhysics()
        }
        else
        {
-               rigvel_z -= frametime * sv_gravity; // 4x gravity plays better
+               rigvel_z -= frametime * autocvar_sv_gravity; // 4x gravity plays better
                self.velocity = rigvel;
                self.movetype = MOVETYPE_FLY;
        }
@@ -496,7 +473,7 @@ void CPM_PM_Aircontrol(vector wishdir, float wishspeed)
                return;
 #endif
 
-       k *= bound(0, wishspeed / sv_maxairspeed, 1);
+       k *= bound(0, wishspeed / autocvar_sv_maxairspeed, 1);
 
        zspeed = self.velocity_z;
        self.velocity_z = 0;
@@ -506,9 +483,9 @@ void CPM_PM_Aircontrol(vector wishdir, float wishspeed)
 
        if(dot > 0) // we can't change direction while slowing down
        {
-               k *= pow(dot, sv_aircontrol_power)*frametime;
-               xyspeed = max(0, xyspeed - sv_aircontrol_penalty * sqrt(max(0, 1 - dot*dot)) * k/32);
-               k *= sv_aircontrol;
+               k *= pow(dot, autocvar_sv_aircontrol_power)*frametime;
+               xyspeed = max(0, xyspeed - autocvar_sv_aircontrol_penalty * sqrt(max(0, 1 - dot*dot)) * k/32);
+               k *= autocvar_sv_aircontrol;
                self.velocity = normalize(self.velocity * xyspeed + wishdir * k);
        }
 
@@ -542,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;
@@ -608,26 +585,26 @@ void PM_AirAccelerate(vector wishdir, float wishspeed)
 
        if(wishspeed > curspeed * 1.01)
        {
-               wishspeed = min(wishspeed, curspeed + sv_warsowbunny_airforwardaccel * self.stat_sv_maxspeed * frametime);
+               wishspeed = min(wishspeed, curspeed + autocvar_sv_warsowbunny_airforwardaccel * self.stat_sv_maxspeed * frametime);
        }
        else
        {
-               f = max(0, (sv_warsowbunny_topspeed - curspeed) / (sv_warsowbunny_topspeed - self.stat_sv_maxspeed));
-               wishspeed = max(curspeed, self.stat_sv_maxspeed) + sv_warsowbunny_accel * f * self.stat_sv_maxspeed * frametime;
+               f = max(0, (autocvar_sv_warsowbunny_topspeed - curspeed) / (autocvar_sv_warsowbunny_topspeed - self.stat_sv_maxspeed));
+               wishspeed = max(curspeed, self.stat_sv_maxspeed) + autocvar_sv_warsowbunny_accel * f * self.stat_sv_maxspeed * frametime;
        }
        wishvel = wishdir * wishspeed;
        acceldir = wishvel - curvel;
        addspeed = vlen(acceldir);
        acceldir = normalize(acceldir);
 
-       accelspeed = min(addspeed, sv_warsowbunny_turnaccel * self.stat_sv_maxspeed * frametime);
+       accelspeed = min(addspeed, autocvar_sv_warsowbunny_turnaccel * self.stat_sv_maxspeed * frametime);
 
-       if(sv_warsowbunny_backtosideratio < 1)
+       if(autocvar_sv_warsowbunny_backtosideratio < 1)
        {
                curdir = normalize(curvel);
                dot = acceldir * curdir;
                if(dot < 0)
-                       acceldir = acceldir - (1 - sv_warsowbunny_backtosideratio) * dot * curdir;
+                       acceldir = acceldir - (1 - autocvar_sv_warsowbunny_backtosideratio) * dot * curdir;
        }
 
        self.velocity += accelspeed * acceldir;
@@ -692,37 +669,37 @@ 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;
 
        // fix physics stats for g_movement_highspeed
-       self.stat_sv_airaccel_qw = AdjustAirAccelQW(sv_airaccel_qw, maxspd_mod);
-       if(sv_airstrafeaccel_qw)
-               self.stat_sv_airstrafeaccel_qw = AdjustAirAccelQW(sv_airstrafeaccel_qw, maxspd_mod);
+       self.stat_sv_airaccel_qw = AdjustAirAccelQW(autocvar_sv_airaccel_qw, maxspd_mod);
+       if(autocvar_sv_airstrafeaccel_qw)
+               self.stat_sv_airstrafeaccel_qw = AdjustAirAccelQW(autocvar_sv_airstrafeaccel_qw, maxspd_mod);
        else
                self.stat_sv_airstrafeaccel_qw = 0;
-       self.stat_sv_airspeedlimit_nonqw = sv_airspeedlimit_nonqw * maxspd_mod;
-       self.stat_sv_maxspeed = sv_maxspeed * maxspd_mod; // also slow walking
+       self.stat_sv_airspeedlimit_nonqw = autocvar_sv_airspeedlimit_nonqw * maxspd_mod;
+       self.stat_sv_maxspeed = autocvar_sv_maxspeed * maxspd_mod; // also slow walking
 
     if(self.PlayerPhysplug)
         if(self.PlayerPhysplug())
@@ -779,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;
@@ -832,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;
 
@@ -862,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)
@@ -883,7 +860,7 @@ void SV_PlayerPhysics()
                maxspd_mod = self.spectatorspeed;
        }
 
-       spd = max(self.stat_sv_maxspeed, sv_maxairspeed) * maxspd_mod * swampspd_mod;
+       spd = max(self.stat_sv_maxspeed, autocvar_sv_maxairspeed) * maxspd_mod * swampspd_mod;
        if(self.speed != spd)
        {
                self.speed = spd;
@@ -937,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
@@ -972,7 +949,7 @@ void SV_PlayerPhysics()
                // noclipping or flying
                self.flags &~= FL_ONGROUND;
 
-               self.velocity = self.velocity * (1 - frametime * sv_friction);
+               self.velocity = self.velocity * (1 - frametime * autocvar_sv_friction);
                makevectors(self.v_angle);
                //wishvel = v_forward * self.movement_x + v_right * self.movement_y + v_up * self.movement_z;
                wishvel = v_forward * self.movement_x + v_right * self.movement_y + '0 0 1' * self.movement_z;
@@ -982,7 +959,7 @@ void SV_PlayerPhysics()
                if (wishspeed > self.stat_sv_maxspeed*maxspd_mod)
                        wishspeed = self.stat_sv_maxspeed*maxspd_mod;
                if (time >= self.teleport_time)
-                       PM_Accelerate(wishdir, wishspeed, wishspeed, sv_accelerate*maxspd_mod, 1, 0, 0);
+                       PM_Accelerate(wishdir, wishspeed, wishspeed, autocvar_sv_accelerate*maxspd_mod, 1, 0, 0);
        }
        else if (self.waterlevel >= WATERLEVEL_SWIMMING)
        {
@@ -1002,24 +979,24 @@ void SV_PlayerPhysics()
                wishspeed = wishspeed * 0.7;
 
                // water friction
-               self.velocity = self.velocity * (1 - frametime * sv_friction);
+               self.velocity = self.velocity * (1 - frametime * autocvar_sv_friction);
 
                // water acceleration
-               PM_Accelerate(wishdir, wishspeed, wishspeed, sv_accelerate*maxspd_mod, 1, 0, 0);
+               PM_Accelerate(wishdir, wishspeed, wishspeed, autocvar_sv_accelerate*maxspd_mod, 1, 0, 0);
        }
        else if (time < self.ladder_time)
        {
                // on a spawnfunc_func_ladder or swimming in spawnfunc_func_water
                self.flags &~= FL_ONGROUND;
 
-               self.velocity = self.velocity * (1 - frametime * sv_friction);
+               self.velocity = self.velocity * (1 - frametime * autocvar_sv_friction);
                makevectors(self.v_angle);
                //wishvel = v_forward * self.movement_x + v_right * self.movement_y + v_up * self.movement_z;
                wishvel = v_forward * self.movement_x + v_right * self.movement_y + '0 0 1' * self.movement_z;
                if (self.gravity)
-                       self.velocity_z = self.velocity_z + self.gravity * sv_gravity * frametime;
+                       self.velocity_z = self.velocity_z + self.gravity * autocvar_sv_gravity * frametime;
                else
-                       self.velocity_z = self.velocity_z + sv_gravity * frametime;
+                       self.velocity_z = self.velocity_z + autocvar_sv_gravity * frametime;
                if (self.ladder_entity.classname == "func_water")
                {
                        f = vlen(wishvel);
@@ -1048,16 +1025,16 @@ void SV_PlayerPhysics()
                if (time >= self.teleport_time)
                {
                        // water acceleration
-                       PM_Accelerate(wishdir, wishspeed, wishspeed, sv_accelerate*maxspd_mod, 1, 0, 0);
+                       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);
                wishvel = v_forward * self.movement_x + v_right * self.movement_y;
                // add remaining speed as Z component
-               maxairspd = sv_maxairspeed*max(1, maxspd_mod);
+               maxairspd = autocvar_sv_maxairspeed*max(1, maxspd_mod);
                // fix speedhacks :P
                wishvel = normalize(wishvel) * min(vlen(wishvel) / maxairspd, 1);
                // add the unused velocity as up component
@@ -1068,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") * 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;
@@ -1118,21 +1095,21 @@ 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);
-               if(wishvel_z - sv_gravity > 0)
-                       fz = bound(0, 1 - self.velocity_z / cvar("g_jetpack_maxspeed_up"), 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 / 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);
                wishvel_x *= fxy;
                wishvel_y *= fxy;
-               wishvel_z = (wishvel_z - sv_gravity) * fz + sv_gravity;
+               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;
 
@@ -1142,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)
@@ -1162,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;
@@ -1190,10 +1167,10 @@ void SV_PlayerPhysics()
                f = vlen(v);
                if(f > 0)
                {
-                       if (f < sv_stopspeed)
-                               f = 1 - frametime * (sv_stopspeed / f) * sv_friction;
+                       if (f < autocvar_sv_stopspeed)
+                               f = 1 - frametime * (autocvar_sv_stopspeed / f) * autocvar_sv_friction;
                        else
-                               f = 1 - frametime * sv_friction;
+                               f = 1 - frametime * autocvar_sv_friction;
                        if (f > 0)
                                self.velocity = self.velocity * f;
                        else
@@ -1208,7 +1185,7 @@ void SV_PlayerPhysics()
                if (self.crouch)
                        wishspeed = wishspeed * 0.5;
                if (time >= self.teleport_time)
-                       PM_Accelerate(wishdir, wishspeed, wishspeed, sv_accelerate*maxspd_mod, 1, 0, 0);
+                       PM_Accelerate(wishdir, wishspeed, wishspeed, autocvar_sv_accelerate*maxspd_mod, 1, 0, 0);
        }
        else
        {
@@ -1219,13 +1196,13 @@ void SV_PlayerPhysics()
 
                if(maxspd_mod < 1)
                {
-                       maxairspd = sv_maxairspeed*maxspd_mod;
-                       airaccel = sv_airaccelerate*maxspd_mod;
+                       maxairspd = autocvar_sv_maxairspeed*maxspd_mod;
+                       airaccel = autocvar_sv_airaccelerate*maxspd_mod;
                }
                else
                {
-                       maxairspd = sv_maxairspeed;
-                       airaccel = sv_airaccelerate;
+                       maxairspd = autocvar_sv_maxairspeed;
+                       airaccel = autocvar_sv_airaccelerate;
                }
                // airborn
                makevectors(self.v_angle_y * '0 1 0');
@@ -1251,13 +1228,13 @@ void SV_PlayerPhysics()
                        wishspeed2 = wishspeed;
 
                        // CPM
-                       if(sv_airstopaccelerate)
+                       if(autocvar_sv_airstopaccelerate)
                        {
                                vector curdir;
                                curdir = self.velocity;
                                curdir_z = 0;
                                curdir = normalize(curdir);
-                               airaccel = airaccel + (sv_airstopaccelerate*maxspd_mod - airaccel) * max(0, -(curdir * wishdir));
+                               airaccel = airaccel + (autocvar_sv_airstopaccelerate*maxspd_mod - airaccel) * max(0, -(curdir * wishdir));
                        }
                        // note that for straight forward jumping:
                        // step = accel * frametime * wishspeed0;
@@ -1268,20 +1245,20 @@ void SV_PlayerPhysics()
                        // log dv/dt = logaccel + logmaxspeed (when slow)
                        // log dv/dt = logaccel + logmaxspeed + log(1 - accelqw) (when fast)
                        strafity = IsMoveInDirection(self.movement, -90) + IsMoveInDirection(self.movement, +90); // if one is nonzero, other is always zero
-                       if(sv_maxairstrafespeed)
-                               wishspeed = min(wishspeed, GeomLerp(sv_maxairspeed*maxspd_mod, strafity, sv_maxairstrafespeed*maxspd_mod));
-                       if(sv_airstrafeaccelerate)
-                               airaccel = GeomLerp(airaccel, strafity, sv_airstrafeaccelerate*maxspd_mod);
+                       if(autocvar_sv_maxairstrafespeed)
+                               wishspeed = min(wishspeed, GeomLerp(autocvar_sv_maxairspeed*maxspd_mod, strafity, autocvar_sv_maxairstrafespeed*maxspd_mod));
+                       if(autocvar_sv_airstrafeaccelerate)
+                               airaccel = GeomLerp(airaccel, strafity, autocvar_sv_airstrafeaccelerate*maxspd_mod);
                        if(self.stat_sv_airstrafeaccel_qw)
                                airaccelqw = copysign(1-GeomLerp(1-fabs(self.stat_sv_airaccel_qw), strafity, 1-fabs(self.stat_sv_airstrafeaccel_qw)), ((strafity > 0.5) ? self.stat_sv_airstrafeaccel_qw : self.stat_sv_airaccel_qw));
                        // !CPM
 
-                       if(sv_warsowbunny_turnaccel && accelerating && self.movement_y == 0 && self.movement_x != 0)
+                       if(autocvar_sv_warsowbunny_turnaccel && accelerating && self.movement_y == 0 && self.movement_x != 0)
                                PM_AirAccelerate(wishdir, wishspeed);
                        else
-                               PM_Accelerate(wishdir, wishspeed, wishspeed0, airaccel, airaccelqw, sv_airaccel_sideways_friction / maxairspd, self.stat_sv_airspeedlimit_nonqw);
+                               PM_Accelerate(wishdir, wishspeed, wishspeed0, airaccel, airaccelqw, autocvar_sv_airaccel_sideways_friction / maxairspd, self.stat_sv_airspeedlimit_nonqw);
 
-                       if(sv_aircontrol)
+                       if(autocvar_sv_aircontrol)
                                CPM_PM_Aircontrol(wishdir, wishspeed2);
                }
        }
@@ -1314,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..9fa4784faca6cd6022dfcf24628dd32a8ce14f86 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,15 @@ 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");
+        {
+            if(g_cts)
+                sdelay = 0; // no respawn delay in CTS
+            else
+                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 +719,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 +792,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 +928,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 +941,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 +976,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 +1041,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 +1062,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 +1080,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;
@@ -1147,12 +1152,9 @@ float GetVoiceMessageVoiceType(string type)
 }
 
 string allvoicesamples;
-float GetPlayerSoundSampleField_notFound;
-float GetPlayerSoundSampleField_fixed;
 .string GetVoiceMessageSampleField(string type)
 {
        GetPlayerSoundSampleField_notFound = 0;
-       GetPlayerSoundSampleField_fixed = 0;
        switch(type)
        {
 #define _VOICEMSG(m) case #m: return playersound_##m;
@@ -1166,7 +1168,6 @@ float GetPlayerSoundSampleField_fixed;
 .string GetPlayerSoundSampleField(string type)
 {
        GetPlayerSoundSampleField_notFound = 0;
-       GetPlayerSoundSampleField_fixed = 0;
        switch(type)
        {
 #define _VOICEMSG(m) case #m: return playersound_##m;
@@ -1248,9 +1249,6 @@ void LoadPlayerSounds(string f, float first)
                        field = GetVoiceMessageSampleField(argv(0));
                if(GetPlayerSoundSampleField_notFound)
                        continue;
-               if(GetPlayerSoundSampleField_fixed)
-                       if not(first)
-                               continue;
                if(self.field)
                        strunzone(self.field);
                self.field = strzone(strcat(argv(1), " ", argv(2)));
index 5b765396c4641aa847b5aacd2c20f3dc395d726f..6de63b9377fd76893498adebe0507247737e3fe1 100644 (file)
@@ -271,13 +271,15 @@ 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 (g_cts)
+        return;
+       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 +312,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 +345,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 +358,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
                        }
@@ -389,6 +391,7 @@ void W_WeaponFrame()
                        v_forward = fo;
                        v_right = ri;
                        v_up = up;
+                       self.weaponentity_glowmod = '0 0 0'; // reset glowmod, weapon think function only *might* set it
                        weapon_action(self.weapon, WR_THINK);
                }
                if (time + self.weapon_frametime * 0.5 >= self.weapon_nextthink)
index 5bfad53530b8b7446c14c33ef4fdaca68510f41c..4f5e7604448fc0e7458a91be39f81fc4808f9f20 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);
@@ -603,12 +603,14 @@ void CL_Weaponentity_Think()
        else
                self.alpha = 1;
 
+       self.glowmod = self.owner.weaponentity_glowmod;
        self.colormap = self.owner.colormap;
        if (self.weaponentity)
        {
                self.weaponentity.effects = self.effects;
                self.weaponentity.alpha = self.alpha;
                self.weaponentity.colormap = self.colormap;
+               self.weaponentity.glowmod = self.glowmod;
        }
 
        self.angles = '0 0 0';
@@ -616,7 +618,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 +628,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)
                {
@@ -847,6 +849,7 @@ void CL_ExteriorWeaponentity_Think()
                self.angles = ang;
        }
 
+       self.glowmod = self.owner.weaponentity_glowmod;
        self.colormap = self.owner.colormap;
 };
 
@@ -952,7 +955,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 +1014,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 +1278,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 +1315,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 +1458,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 +1583,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..adaf36f16415dc860c2b746dfc5d42074e98a856 100644 (file)
@@ -164,14 +164,13 @@ void SV_ParseClientCommand(string s) {
                } else {
                        self.version = stof(argv(1));
                }
-               if(self.version != cvar("gameversion"))
+               if(self.version < autocvar_gameversion_min || self.version > autocvar_gameversion_max)
                {
-                       self.classname = "observer";
                        self.version_mismatch = 1;
-                       PutClientInServer();
-               } else if(cvar("g_campaign") || cvar("g_balance_teams") || cvar("g_balance_teams_force")) {
+                       ClientKill_TeamChange(-2); // observe
+               } 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,18 +209,8 @@ void SV_ParseClientCommand(string s) {
                                return;
                        }
                }
-               if(self.classname == "player" && cvar("sv_spectate") == 1) {
-                       if(self.flagcarried)
-                               DropFlag(self.flagcarried, world, world);
-                       if(self.ballcarried && g_nexball)
-                               DropBall(self.ballcarried, self.origin, self.velocity);
-                       WaypointSprite_PlayerDead();
-                       self.classname = "observer";
-                       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"));
-                       PutClientInServer();
+               if(self.classname == "player" && autocvar_sv_spectate == 1) {
+                       ClientKill_TeamChange(-2); // observe
                }
        } else if(cmd == "join") {
                if not(self.flags & FL_CLIENT)
@@ -236,7 +225,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,22 +238,22 @@ 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");
                } else if(lockteams) {
                        sprint( self, "^7The game has already begun, you must wait until the next map to be able to join a team.\n");
                } else if( argv(1) == "red" ) {
-                       DoTeamChange(COLOR_TEAM1);
+                       ClientKill_TeamChange(COLOR_TEAM1);
                } else if( argv(1) == "blue" ) {
-                       DoTeamChange(COLOR_TEAM2);
+                       ClientKill_TeamChange(COLOR_TEAM2);
                } else if( argv(1) == "yellow" ) {
-                       DoTeamChange(COLOR_TEAM3);
+                       ClientKill_TeamChange(COLOR_TEAM3);
                } else if( argv(1) == "pink" ) {
-                       DoTeamChange(COLOR_TEAM4);
+                       ClientKill_TeamChange(COLOR_TEAM4);
                } else if( argv(1) == "auto" ) {
-                       DoTeamChange(-1);
+                       ClientKill_TeamChange(-1);
                } else {
                        sprint( self, strcat( "selectteam none/red/blue/yellow/pink/auto - \"", argv(1), "\" not recognised\n" ) );
                }
@@ -273,9 +262,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 +334,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 +347,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 +387,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 +414,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 +436,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 +450,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 +477,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 +542,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 +560,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 +595,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 a6d31ca57a01da68d842917532ca8aa7686d0fc4..b31e1429381ca5637966f9dfd8a0bde4c308474c 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
@@ -775,9 +775,6 @@ void spawnfunc_item_flag_team1()
                return;
        }
 
-       //if(!cvar("teamplay"))
-       //      cvar_set("teamplay", "3");
-
        // link flag into ctf_worldflaglist
        self.ctf_worldflagnext = ctf_worldflaglist;
        ctf_worldflaglist = self;
@@ -795,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)
@@ -829,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
@@ -875,8 +872,6 @@ void spawnfunc_item_flag_team2()
                remove(self);
                return;
        }
-       //if(!cvar("teamplay"))
-       //      cvar_set("teamplay", "3");
 
        // link flag into ctf_worldflaglist
        self.ctf_worldflagnext = ctf_worldflaglist;
@@ -895,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)
@@ -929,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
@@ -1010,9 +1005,14 @@ 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;
+
+
+//#NO AUTOCVARS START
+       g_ctf_win_mode = cvar("g_ctf_win_mode");
+//#NO AUTOCVARS END
 };
 
 void ctf_setstatus2(entity flag, float shift)
index 381543fae3b9aa38110085740fc688e253a85584..86a57d460b42a5d952bc09785dad450ec23b2648 100644 (file)
@@ -200,6 +200,7 @@ void setanim(entity e, vector anim, float looping, float override, float restart
 
 .entity weaponentity;
 .entity exteriorweaponentity;
+.vector weaponentity_glowmod;
 .float switchweapon;
 .float autoswitch;
 float weapon_action(float wpn, float wrequest);
@@ -271,13 +272,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();
@@ -427,7 +428,6 @@ float sv_maxidle;
 float sv_maxidle_spectatorsareidle;
 
 float sv_pogostick;
-float sv_doublejump;
 float tracebox_hits_trigger_hurt(vector start, vector mi, vector ma, vector end);
 
 float next_pingtime;
@@ -500,6 +500,8 @@ void PlayerSound(.string samplefield, float channel, float voicetype);
 void GlobalSound(string samplestring, float channel, float voicetype);
 void FakeGlobalSound(string samplestring, float channel, float voicetype);
 void VoiceMessage(string type, string message);
+float GetPlayerSoundSampleField_notFound;
+.string GetVoiceMessageSampleField(string type)
 
 // autotaunt system
 .float cvar_cl_autotaunt;
@@ -647,7 +649,7 @@ string deathmessage;
 
 .float nex_charge;
 .float nex_charge_rottime;
-.float nex_charge_pool_ammo;
+.float nex_chargepool_ammo;
 
 float allowed_to_spawn; // boolean variable used by the clan arena code to determine if a player can spawn (after the round has ended)
 
index 3e5bed8b25f23c35247fa2cf1c50c14da053dc3c..891863f97a3a32daa771675391405563ad4675ca 100644 (file)
@@ -17,9 +17,6 @@ Note: The only teams who can use dom control points are identified by spawnfunc_
 
 #define DOMPOINTFRAGS frags
 
-float g_domination_point_amt;
-float g_domination_point_rate;
-
 .float enemy_playerid;
 .entity sprite;
 .float captime;
@@ -29,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));
@@ -67,12 +64,12 @@ void dompoint_captured ()
        //bprint("\n");
 
        float points, wait_time;
-       if (g_domination_point_amt)
-               points = g_domination_point_amt;
+       if (autocvar_g_domination_point_amt)
+               points = autocvar_g_domination_point_amt;
        else
                points = self.frags;
-       if (g_domination_point_rate)
-               wait_time = g_domination_point_rate;
+       if (autocvar_g_domination_point_rate)
+               wait_time = autocvar_g_domination_point_rate;
        else
                wait_time = self.wait;
 
@@ -95,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;
@@ -160,11 +157,8 @@ void dompointthink()
        if (gameover || self.delay > time || time < game_starttime)     // game has ended, don't keep giving points
                return;
 
-       g_domination_point_rate = cvar("g_domination_point_rate");
-       g_domination_point_amt = cvar("g_domination_point_amt");
-
-       if(g_domination_point_rate)
-               self.delay = time + g_domination_point_rate;
+       if(autocvar_g_domination_point_rate)
+               self.delay = time + autocvar_g_domination_point_rate;
        else
                self.delay = time + self.wait;
 
@@ -172,8 +166,8 @@ void dompointthink()
        // NOTE: this defaults to 0
        if (self.goalentity.netname != "")
        {
-               if(g_domination_point_amt)
-                       fragamt = 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);
@@ -270,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;
@@ -345,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;
@@ -547,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;
 };
 
@@ -596,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");
@@ -615,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)
@@ -654,9 +648,5 @@ void dom_init()
        precache_model("models/domination/dom_unclaimed.md3");
        precache_sound("domination/claim.wav");
        InitializeEntity(world, dom_delayedinit, INITPRIO_GAMETYPE);
-
-       // teamplay is always on in domination, defaults to hurt self but not teammates
-       //if(!teams_matter)
-       //      cvar_set("teamplay", "3");
 };
 
index fd5b445eba8664746b8ad43f64738e3ad0534fd7..6ab29006d2226bc8fa897b446aa05a4f8de6c262 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));
@@ -295,7 +295,8 @@ void Obituary (entity attacker, entity inflictor, entity targ, float deathtype)
                {
                        if (deathtype == DEATH_TEAMCHANGE || deathtype == DEATH_AUTOTEAMCHANGE)
                                msg = ColoredTeamName(targ.team); // TODO: check if needed?
-                       Send_CSQC_Centerprint(targ, msg, "", deathtype, MSG_SUICIDE);
+            if(!g_cts) // no "killed your own dumb self" message in CTS
+                Send_CSQC_Centerprint(targ, msg, "", deathtype, MSG_SUICIDE);
 
                        if(deathtype != DEATH_TEAMCHANGE && deathtype != DEATH_QUIET)
                        {
@@ -353,7 +354,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 {
@@ -537,32 +538,32 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float
                                damage = 0;
                                force = '0 0 0';
                        }
-                       else if(attacker.team == targ.team)
+                       else if(teams_matter && attacker.team == targ.team)
                        {
-                               if(teamplay == 1)
+                               if(autocvar_teamplay_mode == 1)
                                        damage = 0;
                                else if(attacker != targ)
                                {
-                                       if(teamplay == 3)
+                                       if(autocvar_teamplay_mode == 3)
                                                damage = 0;
-                                       else if(teamplay == 4)
+                                       else if(autocvar_teamplay_mode == 4)
                                        {
                                                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 +577,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 +642,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 +669,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 +680,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 +740,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 +766,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 +809,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);
                        }
                }
@@ -877,21 +878,14 @@ float RadiusDamage (entity inflictor, entity attacker, float coredamage, float e
 
        if(RadiusDamage_running)
        {
-               string save;
-               print("RadiusDamage called recursively!\n");
-               print("Expect stuff to go HORRIBLY wrong.\n");
-               print("Causing a stack trace...\n");
-               save = cvar_string("prvm_backtraceforwarnings");
-               cvar_set("prvm_backtraceforwarnings", "1");
-               fclose(-1); // calls VM_Warning
-               cvar_set("prvm_backtraceforwarnings", save);
+               backtrace("RadiusDamage called recursively! Expect stuff to go HORRIBLY wrong.");
                return 0;
        }
 
        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;
@@ -993,16 +987,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;
@@ -1207,8 +1201,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..47f3a5a699b8daa78b7d9a896304a5ae681a6a0c 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
        }
@@ -750,9 +750,7 @@ void InitTrigger()
 {
 // trigger angles are used for one-way touches.  An angle of 0 is assumed
 // to mean no restrictions, so use a yaw of 360 instead.
-       if (self.movedir == '0 0 0')
-       if (self.angles != '0 0 0')
-               SetMovedir ();
+       SetMovedir ();
        self.solid = SOLID_TRIGGER;
        SetBrushEntityModel();
        self.movetype = MOVETYPE_NONE;
@@ -764,9 +762,7 @@ void InitSolidBSPTrigger()
 {
 // trigger angles are used for one-way touches.  An angle of 0 is assumed
 // to mean no restrictions, so use a yaw of 360 instead.
-       if (self.movedir == '0 0 0')
-       if (self.angles != '0 0 0')
-               SetMovedir ();
+       SetMovedir ();
        self.solid = SOLID_BSP;
        SetBrushEntityModel();
        self.movetype = MOVETYPE_NONE; // why was this PUSH? -div0
index 4a66f229380ea9c505962ae4e5aa0abe9674d171..0a70de75f802fb13561c7ccf6eb259788b901023 100644 (file)
@@ -51,6 +51,9 @@ void SUB_UseTargets()
                t.message = self.message;
                t.killtarget = self.killtarget;
                t.target = self.target;
+               t.target2 = self.target2;
+               t.target3 = self.target3;
+               t.target4 = self.target4;
                return;
        }
 
@@ -186,14 +189,12 @@ void multi_use()
 void multi_touch()
 {
        if not(self.spawnflags & 2)
-       {
                if not(other.iscreature)
                        return;
 
-               if(self.team)
-               if(self.team == other.team)
+       if(self.team)
+               if((self.spawnflags & 4 == 0) == (self.team != other.team))
                        return;
-       }
 
 // if the trigger has an angles field, check player's facing direction
        if (self.movedir != '0 0 0')
@@ -516,7 +517,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);
                        }
                }
@@ -656,31 +657,134 @@ void spawnfunc_trigger_gravity()
 
 // TODO add a way to do looped sounds with sound(); then complete this entity
 .float volume, atten;
-void target_speaker_use() {sound(self, CHAN_TRIGGER, self.noise, VOL_BASE * self.volume, self.atten);}
+void target_speaker_use_off();
+void target_speaker_use_activator()
+{
+       if(clienttype(activator) != CLIENTTYPE_REAL)
+               return;
+       string snd;
+       if(substring(self.noise, 0, 1) == "*")
+       {
+               var .string sample;
+               sample = GetVoiceMessageSampleField(substring(self.noise, 1, -1));
+               if(GetPlayerSoundSampleField_notFound)
+                       snd = "misc/null.wav";
+               else if(activator.sample == "")
+                       snd = "misc/null.wav";
+               else
+               {
+                       tokenize_console(activator.sample);
+                       float n;
+                       n = stof(argv(1));
+                       if(n > 0)
+                               snd = strcat(argv(0), ftos(floor(random() * n + 1)), ".wav"); // randomization
+                       else
+                               snd = strcat(argv(0), ".wav"); // randomization
+               }
+       }
+       else
+               snd = self.noise;
+       msg_entity = activator;
+       soundto(MSG_ONE, self, CHAN_TRIGGER, snd, VOL_BASE * self.volume, self.atten);
+}
+void target_speaker_use_on()
+{
+       string snd;
+       if(substring(self.noise, 0, 1) == "*")
+       {
+               var .string sample;
+               sample = GetVoiceMessageSampleField(substring(self.noise, 1, -1));
+               if(GetPlayerSoundSampleField_notFound)
+                       snd = "misc/null.wav";
+               else if(activator.sample == "")
+                       snd = "misc/null.wav";
+               else
+               {
+                       tokenize_console(activator.sample);
+                       float n;
+                       n = stof(argv(1));
+                       if(n > 0)
+                               snd = strcat(argv(0), ftos(floor(random() * n + 1)), ".wav"); // randomization
+                       else
+                               snd = strcat(argv(0), ".wav"); // randomization
+               }
+       }
+       else
+               snd = self.noise;
+       sound(self, CHAN_TRIGGER, snd, VOL_BASE * self.volume, self.atten);
+       if(self.spawnflags & 3)
+               self.use = target_speaker_use_off;
+}
+void target_speaker_use_off()
+{
+       sound(self, CHAN_TRIGGER, "misc/null.wav", VOL_BASE * self.volume, self.atten);
+       self.use = target_speaker_use_on;
+}
+void target_speaker_reset()
+{
+       if(self.spawnflags & 1) // LOOPED_ON
+       {
+               if(self.use == target_speaker_use_on)
+                       target_speaker_use_on();
+       }
+       else if(self.spawnflags & 2)
+       {
+               if(self.use == target_speaker_use_off)
+                       target_speaker_use_off();
+       }
+}
 
 void spawnfunc_target_speaker()
 {
+       // TODO: "*" prefix to sound file name
+       // TODO: wait and random (just, HOW? random is not a field)
        if(self.noise)
                precache_sound (self.noise);
-       IFTARGETED
+
+       if(!self.atten && !(self.spawnflags & 4))
        {
-               if(!self.atten)
+               IFTARGETED
                        self.atten = ATTN_NORM;
-               else if(self.atten < 0)
-                       self.atten = 0;
-               if(!self.volume)
-                       self.volume = 1;
-               self.use = target_speaker_use;
+               else
+                       self.atten = ATTN_STATIC;
+       }
+       else if(self.atten < 0)
+               self.atten = 0;
+
+       if(!self.volume)
+               self.volume = 1;
+
+       IFTARGETED
+       {
+               if(self.spawnflags & 8) // ACTIVATOR
+                       self.use = target_speaker_use_activator;
+               else if(self.spawnflags & 1) // LOOPED_ON
+               {
+                       target_speaker_use_on();
+                       self.reset = target_speaker_reset;
+               }
+               else if(self.spawnflags & 2) // LOOPED_OFF
+               {
+                       self.use = target_speaker_use_on;
+                       self.reset = target_speaker_reset;
+               }
+               else
+                       self.use = target_speaker_use_on;
+       }
+       else if(self.spawnflags & 1) // LOOPED_ON
+       {
+               ambientsound (self.origin, self.noise, VOL_BASE * self.volume, self.atten);
+               remove(self);
+       }
+       else if(self.spawnflags & 2) // LOOPED_OFF
+       {
+               objerror("This sound entity can never be activated");
        }
        else
        {
-               if(!self.atten)
-                       self.atten = ATTN_STATIC;
-               else if(self.atten < 0)
-                       self.atten = 0;
-               if(!self.volume)
-                       self.volume = 1;
+               // Quake/Nexuiz fallback
                ambientsound (self.origin, self.noise, VOL_BASE * self.volume, self.atten);
+               remove(self);
        }
 };
 
@@ -1400,7 +1504,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 +1513,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 9a3c3614a25de91e4bab9259f6e5e142431c12cb..30a63ba7d44b027fb2e58c160142d900ba000820 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();
@@ -235,6 +235,7 @@ void cvar_changes_init()
                k = bufstr_get(h, i);
 
 #define BADPREFIX(p) if(substring(k, 0, strlen(p)) == p) continue
+#define BADPRESUFFIX(p,s) if(substring(k, 0, strlen(p)) == p && substring(k, -strlen(s), -1) == s) continue
 #define BADCVAR(p) if(k == p) continue
                // internal
                BADPREFIX("csqc_");
@@ -414,6 +415,7 @@ void cvar_changes_init()
                BADCVAR("g_nexball_goallimit");
                BADCVAR("g_runematch_point_limit");
                BADCVAR("g_start_delay");
+               BADCVAR("g_weapon_stay"); BADPRESUFFIX("g_", "_weapon_stay");
                BADCVAR("hostname");
                BADCVAR("log_file");
                BADCVAR("maxplayers");
@@ -446,7 +448,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");
@@ -614,15 +616,6 @@ void spawnfunc_worldspawn (void)
 
        TemporaryDB = db_create();
 
-       /*
-       TODO sound pack system
-       // initialize sound pack system
-       soundpack = cvar_string("g_soundpack");
-       if(soundpack != "")
-               soundpack = strcat(soundpack, "/");
-       soundpack = strzone(soundpack);
-       */
-
        // 0 normal
        lightstyle(0, "m");
 
@@ -664,7 +657,7 @@ void spawnfunc_worldspawn (void)
        // 63 testing
        lightstyle(63, "a");
 
-       if(cvar("g_campaign"))
+       if(autocvar_g_campaign)
                CampaignPreInit();
 
        Map_MarkAsRecent(mapname);
@@ -677,13 +670,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();
@@ -694,9 +687,9 @@ void spawnfunc_worldspawn (void)
        //      dom_init();
 
        GameLogInit(); // prepare everything
-       if(cvar("sv_eventlog"))
+       if(autocvar_sv_eventlog)
        {
-               s = strcat(cvar_string("sv_eventlog_files_counter"), ".");
+               s = strcat(ftos(autocvar_sv_eventlog_files_counter), ".");
                s = strcat(s, ftos(random()));
                matchid = strzone(s);
 
@@ -708,31 +701,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);
@@ -745,7 +738,7 @@ void spawnfunc_worldspawn (void)
 
        SetDefaultAlpha();
 
-       if(cvar("g_campaign"))
+       if(autocvar_g_campaign)
                CampaignPostInit();
 
        fteqcc_testbugs();
@@ -808,7 +801,7 @@ void spawnfunc_worldspawn (void)
        addstat(STAT_LAST_PICKUP, AS_FLOAT, last_pickup);
 
        addstat(STAT_NEX_CHARGE, AS_FLOAT, nex_charge);
-       addstat(STAT_NEX_CHARGEPOOL, AS_FLOAT, nex_charge_pool_ammo);
+       addstat(STAT_NEX_CHARGEPOOL, AS_FLOAT, nex_chargepool_ammo);
 
        if(g_ca || g_freezetag)
        {
@@ -858,7 +851,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)))
@@ -892,7 +885,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 = "";
@@ -951,7 +944,7 @@ float GetMaplistPosition()
        string map;
 
        map = GetMapname();
-       idx = cvar("g_maplist_index");
+       idx = autocvar_g_maplist_index;
 
        if(idx >= 0)
                if(idx < Map_Count)
@@ -969,8 +962,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);
@@ -1033,12 +1026,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)
@@ -1164,7 +1157,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
@@ -1176,15 +1169,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");
@@ -1205,11 +1198,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)
@@ -1229,13 +1222,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)
                {
@@ -1244,13 +1237,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"));
@@ -1260,15 +1253,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");
@@ -1301,7 +1294,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");
                        }
@@ -1330,7 +1323,7 @@ void IntermissionThink()
 {
        FixIntermissionClient(self);
 
-       if(cvar("sv_autoscreenshot"))
+       if(autocvar_sv_autoscreenshot)
        if(self.autoscreenshot > 0)
        if(time > self.autoscreenshot)
        {
@@ -1416,9 +1409,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)
        {
@@ -1427,7 +1420,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)
@@ -1442,7 +1435,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
@@ -1459,7 +1452,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)), ":");
@@ -1538,7 +1531,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;
@@ -1565,7 +1558,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;
 
@@ -1582,7 +1575,7 @@ void NextLevel()
 
        DumpStats(TRUE);
 
-       if(cvar("sv_eventlog"))
+       if(autocvar_sv_eventlog)
                GameLogEcho(":gameover");
 
        GameLogClose();
@@ -1593,7 +1586,7 @@ void NextLevel()
                        bprint(other.netname, " ^7wins.\n");
        }
 
-       if(cvar("g_campaign"))
+       if(autocvar_g_campaign)
                CampaignPreIntermission();
 
        localcmd("\nsv_hook_gameend\n");
@@ -1634,7 +1627,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
        }
@@ -1642,7 +1635,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();
                }
@@ -1655,11 +1648,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";
@@ -1667,7 +1660,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!"
                )
@@ -1676,7 +1669,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
@@ -1765,7 +1758,7 @@ float WinningCondition_Onslaught()
 float LMS_NewPlayerLives()
 {
        float fl;
-       fl = cvar("fraglimit");
+       fl = autocvar_fraglimit;
        if(fl == 0)
                fl = 999;
 
@@ -1773,8 +1766,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);
@@ -1811,7 +1804,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;
                        }
@@ -1910,7 +1903,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;
@@ -1970,7 +1963,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);
@@ -2127,9 +2120,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
        {
@@ -2310,14 +2303,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.";
 
@@ -2338,7 +2331,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.");
 }
@@ -2389,17 +2382,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);
@@ -2417,7 +2410,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)
@@ -2430,8 +2423,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!";
@@ -2558,7 +2551,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]), "::");
@@ -2680,7 +2673,7 @@ float MapVote_CheckRules_2()
                                                }
                                }
                        result = strcat(result, ":didn't vote:", ftos(didntvote));
-                       if(cvar("sv_eventlog"))
+                       if(autocvar_sv_eventlog)
                                GameLogEcho(result);
                }
 
@@ -2759,17 +2752,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))
@@ -2782,7 +2775,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;
@@ -2831,7 +2824,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
@@ -2932,14 +2925,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 cb74c8d3a8a926148704766a302c6ab9004284b1..113e9f427df5b8105d918b7483e482142b3d4deb 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");
@@ -794,6 +794,8 @@ vector randompos(vector m1, vector m2)
     return  v;
 };
 
+//#NO AUTOCVARS START
+
 float g_pickup_shells;
 float g_pickup_shells_max;
 float g_pickup_nails;
@@ -878,8 +880,8 @@ float want_weapon(string cvarprefix, entity weaponinfo, float allguns)
                        t = (weaponinfo.spawnflags & WEP_FLAG_NORMAL);
                else if(t < -1)
                        t = 0;
-               else if (g_race || g_cts)
-                       t = (i == WEP_LASER);
+               else if (g_cts)
+                       t = (i == WEP_SHOTGUN);
                else if (g_nexball)
                        t = 0; // weapon is set a few lines later
                else
@@ -979,16 +981,23 @@ void readplayerstartcvars()
        if (g_weaponarena)
        {
                start_weapons = g_weaponarena;
-               if (g_weaponarena & (WEPBIT_GRENADE_LAUNCHER | WEPBIT_MINE_LAYER | WEPBIT_HAGAR | WEPBIT_ROCKET_LAUNCHER))
-                       start_ammo_rockets = 999;
-               if (g_weaponarena & WEPBIT_SHOTGUN)
-                       start_ammo_shells = 999;
-               if (g_weaponarena & (WEPBIT_ELECTRO | WEPBIT_CRYLINK | WEPBIT_NEX | WEPBIT_MINSTANEX | WEPBIT_HLAC | WEPBIT_HOOK))
-                       start_ammo_cells = 999;
-               if (g_weaponarena & (WEPBIT_UZI | WEPBIT_CAMPINGRIFLE))
-                       start_ammo_nails = 999;
-               if (g_weaponarena & WEPBIT_HOOK)
-                       start_ammo_fuel = 999;
+               for (j = WEP_FIRST; j <= WEP_LAST; ++j)
+               {
+                       e = get_weaponinfo(j);
+                       if(start_weapons & e.weapons)
+                       {
+                               if(e.items & IT_ROCKETS)
+                                       start_ammo_rockets = 999;
+                               if(e.items & IT_SHELLS)
+                                       start_ammo_shells = 999;
+                               if(e.items & IT_CELLS)
+                                       start_ammo_cells = 999;
+                               if(e.items & IT_NAILS)
+                                       start_ammo_nails = 999;
+                               if(e.items & IT_FUEL)
+                                       start_ammo_fuel = 999;
+                       }
+               }
                start_items |= IT_UNLIMITED_AMMO;
        }
        else if (g_minstagib)
@@ -1155,8 +1164,7 @@ float sv_pitch_min;
 float sv_pitch_max;
 float sv_pitch_fixyaw;
 
-float sv_accuracy_data_share;
-
+string GetGametype(); // g_world.qc
 void readlevelcvars(void)
 {
        // first load all the mutators
@@ -1169,7 +1177,6 @@ void readlevelcvars(void)
        if(cvar("g_vampire"))
                MUTATOR_ADD(mutator_vampire);
 
-       serverflags = 0;
        if(cvar("sv_allow_fullbright"))
                serverflags |= SERVERFLAG_ALLOW_FULLBRIGHT;
 
@@ -1208,6 +1215,8 @@ void readlevelcvars(void)
        sv_gentle = cvar("sv_gentle");
        sv_foginterval = cvar("sv_foginterval");
        g_cloaked = cvar("g_cloaked");
+    if(g_cts)
+        g_cloaked = 1; // always enable cloak in CTS
        g_jump_grunt = cvar("g_jump_grunt");
        g_footsteps = cvar("g_footsteps");
        g_grappling_hook = cvar("g_grappling_hook");
@@ -1291,7 +1300,9 @@ void readlevelcvars(void)
 
        g_pinata = cvar("g_pinata");
 
-       g_weapon_stay = cvar("g_weapon_stay");
+    g_weapon_stay = cvar(strcat("g_", GetGametype(), "_weapon_stay"));
+    if(!g_weapon_stay)
+        g_weapon_stay = cvar("g_weapon_stay");
 
        if (!g_weapon_stay && (cvar("deathmatch") == 2))
                g_weapon_stay = 1;
@@ -1308,30 +1319,10 @@ void readlevelcvars(void)
        sv_pitch_max = cvar("sv_pitch_max");
        sv_pitch_fixyaw = cvar("sv_pitch_fixyaw");
 
-       sv_accuracy_data_share = boolean(cvar("sv_accuracy_data_share"));
-
        readplayerstartcvars();
 }
 
-/*
-// TODO sound pack system
-string soundpack;
-
-string precache_sound_builtin (string s) = #19;
-void(entity e, float chan, string samp, float vol, float atten) sound_builtin = #8;
-string precache_sound(string s)
-{
-       return precache_sound_builtin(strcat(soundpack, s));
-}
-void play2(entity e, string filename)
-{
-       stuffcmd(e, strcat("play2 ", soundpack, filename, "\n"));
-}
-void sound(entity e, float chan, string samp, float vol, float atten)
-{
-       sound_builtin(e, chan, strcat(soundpack, samp), vol, atten);
-}
-*/
+//#NO AUTOCVARS END
 
 // Sound functions
 string precache_sound (string s) = #19;
@@ -1360,7 +1351,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
@@ -1506,7 +1497,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)
@@ -1518,7 +1509,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);
@@ -1537,8 +1528,12 @@ void precache_playermodel(string m)
        precache_model(m);
        if(sv_loddistance1)
        {
-               precache_model(strcat(substring(m, 0, -5), "_lod1", substring(m, -4, -1)));
-               precache_model(strcat(substring(m, 0, -5), "_lod2", substring(m, -4, -1)));
+               f = strcat(substring(m, 0, -5), "_lod1", substring(m, -4, -1));
+               if(fexists(f))
+                       precache_model(f);
+               f = strcat(substring(m, 0, -5), "_lod2", substring(m, -4, -1));
+               if(fexists(f))
+                       precache_model(f);
        }
 
        globhandle = search_begin(strcat(m, "_*.sounds"), TRUE, FALSE);
@@ -1583,12 +1578,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");
@@ -1598,22 +1593,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);
     }
@@ -1673,7 +1668,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;
@@ -1764,6 +1759,14 @@ void objerror(string s)
     objerror_builtin(s);
 }
 
+.float remove_except_protected_forbidden;
+void remove_except_protected(entity e)
+{
+       if(e.remove_except_protected_forbidden)
+               error("not allowed to remove this at this point");
+       remove_builtin(e);
+}
+
 void remove_unsafely(entity e)
 {
     remove_builtin(e);
@@ -1814,6 +1817,11 @@ void InitializeEntitiesRun()
     entity startoflist;
     startoflist = initialize_entity_first;
     initialize_entity_first = world;
+    remove = remove_except_protected;
+    for (self = startoflist; self; self = self.initialize_entity_next)
+    {
+       self.remove_except_protected_forbidden = 1;
+    }
     for (self = startoflist; self; )
     {
         entity e;
@@ -1823,6 +1831,7 @@ void InitializeEntitiesRun()
         self.initialize_entity_order = 0;
         self.initialize_entity = func_null;
         self.initialize_entity_next = world;
+       self.remove_except_protected_forbidden = 0;
         if (self.classname == "initialize_entity")
         {
             entity e_old;
@@ -1831,9 +1840,16 @@ void InitializeEntitiesRun()
             self = e_old;
         }
         //dprint("Delayed initialization: ", self.classname, "\n");
-        func();
+        if(func != func_null)
+            func();
+        else
+        {
+            eprint(self);
+            backtrace(strcat("Null function in: ", self.classname, "\n"));
+        }
         self = e;
     }
+    remove = remove_unsafely;
 }
 
 .float uncustomizeentityforclient_set;
@@ -2609,7 +2625,6 @@ void zcurveparticles_from_tracetoss(float effectno, vector start, vector end, ve
        zcurveparticles(effectno, start, end, end_dz, vlen(vel));
 }
 
-string GetGametype(); // g_world.qc
 void write_recordmarker(entity pl, float tstart, float dt)
 {
     GameLogEcho(strcat(":recordset:", ftos(pl.playerid), ":", ftos(dt)));
@@ -2668,7 +2683,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)
                {
@@ -2680,7 +2695,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)
                {
@@ -2692,7 +2707,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)
@@ -2702,9 +2717,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 23330cdfc22a8f24ddf65ee3344655538a44db26..022fde20152fec14ba2b6e223308569b6b146ff8 100644 (file)
@@ -188,6 +188,7 @@ void() monster_spawnwanderpath =
 
 void() monster_checkbossflag =
 {
+//#NO AUTOCVARS START
 #if 0
        local float healthboost;
        local float r;
@@ -222,6 +223,7 @@ void() monster_checkbossflag =
                while (self.colormod_x > 0.6 && self.colormod_y > 0.6 && self.colormod_z > 0.6);
        }
 #endif
+//#NO AUTOCVARS END
 };
 
 
index 1a43fc78ea8d89a026b6b8406fe27318ca0e834b..19821429c3d7b46f4f6aa09a77ce626de9688556 100644 (file)
@@ -40,12 +40,14 @@ float   AS_MISSILE              = 4;
 float SKILL4_MINALPHA         = 0.4;
 
 float monsterwander;
+//#NO AUTOCVARS START
 /*
         monsterwander = cvar("monsterwander");
         // monsterwander is always on in skill 5
         if (skill >= 5)
                 monsterwander = TRUE;
 */
+//#NO AUTOCVARS END
 
 .float candrown;
 
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...
diff --git a/qcsrc/server/monsters/mode_management.qc b/qcsrc/server/monsters/mode_management.qc
deleted file mode 100644 (file)
index 9f3770f..0000000
+++ /dev/null
@@ -1,526 +0,0 @@
-
-string(float c) colorname =
-{
-       // yikes, the quake color set is HARD to describe
-       // many are easy, but, uh, 2 browns???
-       // 2 purples???
-       // that 'pink' is hard to classify
-       // I think 'biege' is a fairly good name for color 10
-       // oh well, gotta do all the color names...
-       if (c ==  0) return "white";
-       else if (c ==  1) return "brown";
-       else if (c ==  2) return "lightblue";
-       else if (c ==  3) return "green";
-       else if (c ==  4) return "red";
-       else if (c ==  5) return "lighterbrown";
-       else if (c ==  6) return "orange";
-       else if (c ==  7) return "pink";
-       else if (c ==  8) return "purple";
-       else if (c ==  9) return "redishpurple";
-       else if (c == 10) return "biege";
-       else if (c == 11) return "aqua";
-       else if (c == 12) return "yellow";
-       else if (c == 13) return "blue";
-       else if (c == 14) return "flamingorange";
-       else if (c == 15) return "psychadelic";
-       else              return "INVALID COLOR";
-};
-
-float mode_shirtmustmatchpants;
-float mode_numteams;
-float mode_allowedteams[17];
-float mode_teamcount[17];
-float mode_teamscore[17];
-
-void() mode_initallowedteams =
-{
-       local float c;
-       c = 0;
-       while(c < 17)
-       {
-               mode_allowedteams[c] = FALSE;
-               c = c + 1;
-       }
-       mode_allowedteams[5] = TRUE; // red
-       mode_allowedteams[14] = TRUE; // blue
-       if (deathmatch == DM_ELIM
-        || deathmatch == DM_ONEVSALL
-        || deathmatch == DM_CTF_2TEAM
-        || deathmatch == DM_DOMINATION
-        || deathmatch == DM_SUPERDOMINATION)
-               mode_numteams = 2;
-       else if (deathmatch == DM_CTF_3TEAM)
-       {
-               mode_numteams = 3;
-               mode_allowedteams[13] = TRUE; // yellow
-       }
-       else
-       {
-               mode_numteams = 16;
-               c = 1;
-               while(c < 17)
-               {
-                       mode_allowedteams[c] = TRUE;
-                       c = c + 1;
-               }
-       }
-};
-
-float(float t) validteam =
-{
-       return mode_allowedteams[t];
-};
-
-float() weakestteam =
-{
-       local float bestteam;
-       local float bestteamcount;
-       local float headcount;
-       local float c;
-       bestteam = -1;
-       bestteamcount = 0;
-       c = 1;
-       while (c < 17)
-       {
-               if (mode_allowedteams[c])
-               {
-                       headcount = mode_teamcount[c];
-                       if (bestteamcount > headcount || bestteam == -1)
-                       {
-                               bestteamcount = headcount;
-                               bestteam = c;
-                       }
-               }
-               c = c + 1;
-       }
-       return bestteam;
-};
-
-void() updateteams =
-{
-       local entity head;
-       local float c;
-       c = 1;
-       while (c < 17)
-       {
-               mode_teamcount[c] = 0;
-               mode_teamscore[c] = 0;
-               c = c + 1;
-       }
-       c = 0;
-       head = nextent(world);
-       while (c < maxclients)
-       {
-               mode_teamcount[head.team] = mode_teamcount[head.team] + 1;
-               mode_teamscore[head.team] = mode_teamscore[head.team] + head.frags;
-               c = c + 1;
-               head = nextent(head);
-       }
-};
-
-float(float p) checkteamcolor =
-{
-       if (!validteam(p + 1))
-               p = weakestteam() - 1;
-       return p;
-};
-
-void(float c) SV_ChangeTeam =
-{
-       local float pants, shirt, old;
-       old = self.clientcolors & 15;
-       if (c >= 0)
-       {
-               pants = c & 15;
-               shirt = (c / 16) & 15;
-       }
-       else
-       {
-               pants = -1;
-               shirt = -1;
-       }
-       pants = checkteamcolor(pants);
-       if (mode_shirtmustmatchpants || shirt < 0)
-               shirt = pants;
-       setcolor(self, pants + shirt * 16);
-       if (pants != old && old >= 0 && teamplay && deathmatch)
-       {
-               T_Damage(self, self, self, 0, 0, " changed teams", DT_TELEFRAG, self.origin, '0 0 0', Obituary_Generic);
-               self.frags = 0;
-               PutClientInServer ();
-       }
-};
-
-void() checkinvalidteam =
-{
-       // call SV_ChangeTeam to trigger the weakestteam change
-       if (!validteam(self.team))
-               SV_ChangeTeam(self.team - 1);
-};
-
-
-string dmmessage;
-
-void(string m) setdm =
-{
-       dmmessage = m;
-       if (cvar_string("deathmatch") != m)
-               cvar_set("deathmatch", m);
-}
-
-void(string m) setteamplay =
-{
-       dmmessage = m;
-       if (cvar_string("teamplay") != m)
-               cvar_set("teamplay", m);
-}
-
-void() mode_updatecvars =
-{
-       local float dm, tp;
-       dm = cvar("deathmatch");
-       tp = cvar("teamplay");
-       // now set deathmatch cvar
-       if (dm ==  0) setdm("0?Dark Places - Coop");
-       else if (dm ==  1) setdm("1?Dark Places - Deathmatch");
-       else if (dm ==  2) setdm("2?Dark Places - Deathmatch 2 (can only pickup gun once)");
-       else if (dm ==  3) setdm("3?Dark Places - Deathmatch 3 (quick ammo respawn)");
-       else if (dm ==  5) setdm("5?Dark Places - Frag Fest (spawn with full pack)");
-//     else if (dm ==  6) setdm("6?Dark Places - Random Weapons (spawn with 2 random weapons)"); // removed
-       else if (dm ==  7) setdm("7?Dark Places - Monsters");
-//     else if (dm ==  8) setdm("8?Dark Places - Elimination");
-//     else if (dm ==  9) setdm("9?Dark Places - Kill The Leader Mode");
-       else if (dm == 10) setdm("10?Dark Places - Capture The Flag - 2 Team");
-       else if (dm == 11) setdm("11?Dark Places - Capture The Flag - 3 Team");
-       else if (dm == 12) setdm("12?Dark Places - Domination");
-       else if (dm == 13) setdm("13?Dark Places - Monster Capture The Flag - 2 Team");
-       else if (dm == 14) setdm("14?Dark Places - Super Domination");
-       else if (dm == 30) setdm("30?Dark Places - Role Playing Game");
-       else                               setdm("1?Dark Places - Deathmatch");
-
-       // now set teamplay cvar
-       if (dm == 0) setteamplay("4?Dark Places - Coop (Can't hurt other players)");
-       //else if (dm == 8) setteamplay("3?Dark Places - Elimination");
-       //else if (dm == 9) setteamplay("3?Dark Places - Kill The Leader");
-       else if (dm == 10) setteamplay("3?Dark Places - Capture The Flag - 2 Team");
-       else if (dm == 11) setteamplay("3?Dark Places - Capture The Flag - 3 Team");
-       else if (dm == 12) setteamplay("3?Dark Places - Domination");
-       else if (dm == 13) setteamplay("3?Dark Places - Monster Capture The Flag - 2 Team");
-       else
-       {
-               if (tp == 0) setteamplay("0?Dark Places - No Teamplay");
-               else if (tp == 1) setteamplay("1?Dark Places - No team damage");
-               else if (tp == 2) setteamplay("2?Dark Places - Can hurt anyone");
-               else if (tp == 3) setteamplay("3?Dark Places - No team damage, but can hurt self");
-               else              setteamplay("0?Dark Places - No Teamplay");
-       }
-};
-
-float nextcvarupdate;
-void() deathmatch7update;
-void() modeupdate =
-{
-       if (time > nextcvarupdate)
-       {
-               nextcvarupdate = time + 1;
-               mode_updatecvars();
-       }
-       deathmatch7update();
-};
-
-// true if items should respawn
-float itemrespawn;
-// when the next monster spawning check will occur in deathmatch 7 mode
-float spawnchecktime;
-
-void() precachemonsters;
-void() superdomination_precache;
-void() modesetup =
-{
-       mode_shirtmustmatchpants = deathmatch >= DM_TEAM_MODS_START && deathmatch < DM_TEAM_MODS_END;
-       mode_initallowedteams();
-
-       itemrespawn = cvar("deathmatch") + cvar("coop");
-
-       // don't spawn any monsters until 15 seconds
-       spawnchecktime = 15;
-       if (deathmatch == 7 || cvar("spawnmonsters") >= 1)
-               precachemonsters();
-
-       superdomination_precache();
-};
-
-float monsterspawn;
-void() spawnmonster_think =
-{
-       //local float c;
-       local void() sfunc;
-       self.nextthink = time;
-       if (time > self.cnt)
-       {
-               remove(self);
-               return;
-       }
-       if (vlen(self.velocity) > 5)
-               return; // try again later
-
-       //if (!(self.flags & FL_FLY))
-       //      droptofloor();
-       // don't spawn if something is in the way
-       /*
-       // walk around a lot
-       if (walkmove(0,0))
-       {
-               if (self.lefty > 0)
-               {
-                       c = 100;
-                       self.lefty = self.lefty - 1;
-                       self.angles = '0 0 0';
-                       while(c > 0)
-                       {
-                               c = c - 1;
-                               if (!walkmove(self.angles_y, 16))
-                                       self.angles_y = random() * 360;
-                       }
-                       self.angles = '0 0 0';
-                       return;
-               }
-       }
-       */
-       // don't spawn if something is in the way
-       if (!walkmove(0,0))
-       {
-               self.lefty = 10;
-               setorigin(self, self.dest);
-               self.flags = self.flags - (self.flags & FL_ONGROUND);
-               self.velocity = randomvec() * 700 + '0 0 1000';
-               return;
-       }
-       newmis = findchain(classname, "player");
-       while (newmis)
-       {
-               if (vlen(newmis.origin - self.origin) < 300)
-                       return;
-               newmis = newmis.chain;
-       }
-
-       if (self.netname == "monster_fish")
-       {
-               if (pointcontents(self.origin) != CONTENT_WATER)
-               {
-                       remove(self);
-                       return;
-               }
-       }
-
-       // spawn in
-       self.movetype = MOVETYPE_NONE;
-       self.solid = SOLID_NOT;
-       self.velocity = '0 0 0';
-       self.flags = 0;
-       self.model = "";
-       self.modelindex = 0;
-       setorigin(self, self.origin);
-       self.angles = '0 360 0' * random();
-       self.classname = self.netname;
-       self.netname = "";
-       self.cnt = 0;
-       self.think = SUB_Remove;
-       sfunc = self.th_run;
-       self.th_run = SUB_Null;
-       te_teleport(self.origin);
-       monsterspawn = TRUE;
-       sfunc();
-       monsterspawn = FALSE;
-};
-
-void(vector org, float c1, float c2, string cname, void() spawnfunc, vector m1, vector m2) spawnmonster =
-{
-       local float c;
-       c = (c2 - c1) * random() + c1;
-       c = rint(c);
-       while (c > 0)
-       {
-               c = c - 1;
-
-               newmis = spawn();
-               newmis.cnt = time + 10;
-               if (cname == "monster_wizard")
-                       newmis.cnt = time + 2;
-               newmis.lefty = 10;
-               newmis.dest = org;
-               newmis.classname = "spawningmonster";
-               newmis.netname = cname;
-               newmis.solid = SOLID_TRIGGER;
-               newmis.movetype = MOVETYPE_TOSS;
-               newmis.flags = FL_MONSTER; // make this count as a monster even though it hasn't spawned in yet
-               newmis.velocity = randomvec() * 700 + '0 0 1000';
-               newmis.th_run = spawnfunc;
-               newmis.think = spawnmonster_think;
-               newmis.nextthink = time + random() * 0.5 + 0.3;
-               setorigin(newmis, org);
-               setmodel(newmis, "progs/s_explod.spr");
-               setsize(newmis, m1, m2);
-       }
-};
-
-void() monster_army;
-void() monster_demon1;
-void() monster_dog;
-void() monster_enforcer;
-void() monster_hell_knight;
-void() monster_knight;
-void() monster_ogre;
-void() monster_shalrath;
-void() monster_shambler;
-void() monster_tarbaby;
-void() monster_wizard;
-void() monster_zombie;
-void() monster_fish;
-void() monster_hellfish;
-
-void() spawnmonsters =
-{
-       local float r;
-       local vector org;
-       local entity head, e;
-       head = findchain(classname, "info_player_deathmatch");
-       if (head == world)
-       {
-               head = findchain(classname, "info_player_coop");
-               if (head == world)
-               {
-                       head = findchain(classname, "info_player_start");
-                       if (head == world)
-                               return;
-               }
-       }
-
-       // count the spawn points
-       r = 0;
-       e = head;
-       while (e)
-       {
-               r = r + 1;
-               e = e.chain;
-       }
-
-       // pick a random one
-       r = random() * r;
-       e = head;
-       while (r > 0)
-       {
-               r = r - 1;
-               org = e.origin;
-               e = e.chain;
-       }
-
-       // pick a type of monster
-       if (cvar("registered"))
-       {
-               r = floor(random() * 13);
-               if (r > 12)
-                       r = 12;
-       }
-       else
-       {
-               r = floor(random() * 8);
-               if (r > 7)
-                       r = 7;
-       }
-            if (r ==  0) spawnmonster(org,  5, 10, "monster_army"       , monster_army       , '-16 -16 -24', '16 16 32');
-       else if (r ==  1) spawnmonster(org,  3,  6, "monster_demon1"     , monster_demon1     , '-32 -32 -24', '32 32 64');
-       else if (r ==  2) spawnmonster(org,  6, 12, "monster_dog"        , monster_dog        , '-16 -16 -24', '16 16 32');
-       else if (r ==  3) spawnmonster(org,  6, 12, "monster_knight"     , monster_knight     , '-16 -16 -24', '16 16 32');
-       else if (r ==  4) spawnmonster(org,  3,  6, "monster_ogre"       , monster_ogre       , '-32 -32 -24', '32 32 64');
-       else if (r ==  5) spawnmonster(org,  1,  1, "monster_shambler"   , monster_shambler   , '-32 -32 -24', '32 32 64');
-       else if (r ==  6) spawnmonster(org,  6, 10, "monster_wizard"     , monster_wizard     , '-16 -16 -24', '16 16 32');
-       else if (r ==  7) spawnmonster(org,  8, 16, "monster_zombie"     , monster_zombie     , '-16 -16 -24', '16 16 32');
-       else if (r ==  8) spawnmonster(org,  4,  8, "monster_enforcer"   , monster_enforcer   , '-16 -16 -24', '16 16 32');
-       else if (r ==  9) spawnmonster(org,  4,  8, "monster_hell_knight", monster_hell_knight, '-16 -16 -24', '16 16 32');
-       else if (r == 10) spawnmonster(org,  1,  3, "monster_shalrath"   , monster_shalrath   , '-32 -32 -24', '32 32 64');
-       else if (r == 11) spawnmonster(org, 10, 15, "monster_tarbaby"    , monster_tarbaby    , '-16 -16 -24', '16 16 32');
-       else if (r == 12) spawnmonster(org,  4,  8, "monster_fish"       , monster_fish       , '-16 -16 -24', '16 16 32');
-};
-
-float monstersprecached;
-void() precachemonster_army;
-void() precachemonster_demon1;
-void() precachemonster_dog;
-void() precachemonster_enforcer;
-void() precachemonster_hell_knight;
-void() precachemonster_knight;
-void() precachemonster_ogre;
-void() precachemonster_shalrath;
-void() precachemonster_shambler;
-void() precachemonster_tarbaby;
-void() precachemonster_wizard;
-void() precachemonster_zombie;
-void() precachemonster_fish;
-
-void() precachemonsters =
-{
-       precachemonster_army();
-       precachemonster_demon1();
-       precachemonster_dog();
-       precachemonster_knight();
-       precachemonster_ogre();
-       precachemonster_shambler();
-       precachemonster_wizard();
-       precachemonster_zombie();
-       if (cvar("registered"))
-       {
-               precachemonster_enforcer();
-               precachemonster_hell_knight();
-               precachemonster_shalrath();
-               precachemonster_tarbaby();
-               precachemonster_fish();
-       }
-       monstersprecached = TRUE;
-};
-
-float spawnedexitmonsters;
-void() deathmatch7update =
-{
-       local entity e;
-       local float f, monster_count, monsters;
-       if (skill >= 5)
-       if (!deathmatch)
-       {
-               if (!spawnedexitmonsters)
-               if (time >= 2)
-               {
-                       spawnedexitmonsters = TRUE;
-                       e = find(world, classname, "target_changelevel");
-                       while (e)
-                       {
-                               spawnmonster(e.origin + (e.mins + e.maxs) * 0.5, 8, 8, "monster_hellfish", monster_hellfish, '-16 -16 -24', '16 16 32');
-                               e = find(e, classname, "target_changelevel");
-                       }
-               }
-               return;
-       }
-       if (time < spawnchecktime)
-               return;
-       if (!monstersprecached)
-               return;
-       spawnchecktime = time + 0.2;
-       monsters = 0;
-       if (deathmatch == 7)
-               monsters = 50;
-       f = cvar("spawnmonsters");
-       if (f >= 1)
-               monsters = f;
-       if (monsters < 1)
-               return;
-       monster_count = 0;
-       e = findchainflags(flags, FL_MONSTER);
-       while (e)
-       {
-               monster_count = monster_count + 1;
-               e = e.chain;
-       }
-       if (monster_count >= monsters)
-               return;
-       spawnmonsters();
-}
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 dd3f43f9fe6549ce4dbe1ed8344603746e192c8c..89feff9a49e3bbdf77de224226fd569adf8cfb9f 100644 (file)
@@ -89,10 +89,10 @@ void movelib_move(vector force,float max_velocity,float drag,float theMass,float
     if (self.waterlevel > 1)
     {
         self.velocity = self.velocity + force * (acceleration * deltatime);
-        self.velocity = self.velocity + '0 0 0.05' * sv_gravity * deltatime;
+        self.velocity = self.velocity + '0 0 0.05' * autocvar_sv_gravity * deltatime;
     }
     else
-        self.velocity = self.velocity + '0 0 -1' * sv_gravity * deltatime;
+        self.velocity = self.velocity + '0 0 -1' * autocvar_sv_gravity * deltatime;
 
     mspeed = vlen(self.velocity);
 
@@ -137,7 +137,7 @@ void movelib_update(vector dir,float force)
     old_speed    = vlen(self.velocity);
     old_dir      = normalize(self.velocity);
 
-    //ggravity      =  (sv_gravity / self.mass) * '0 0 100';
+    //ggravity      =  (autocvar_sv_gravity / self.mass) * '0 0 100';
     acceleration =  (force / self.mass) * dir;
     //acceleration -= old_dir * (old_speed / self.mass);
     acceleration -= ggravity;
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 104af5475e713118ff167a74ad4dec109711678d..04939e8398fe42dc06e7bdc98ed41c347c76279e 100644 (file)
@@ -40,9 +40,9 @@ void ka_SpawnBall() // loads various values for the ball, runs only once at star
        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; 
@@ -207,11 +207,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
@@ -250,26 +250,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;
@@ -287,8 +287,8 @@ MUTATOR_HOOKFUNCTION(ka_PlayerPowerups)
        if(self.ballcarried)
        { 
                // force the default ballcarrier alpha on the player if they have the ball
-               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(g_minstagib)
                {
@@ -345,4 +345,4 @@ MUTATOR_DEFINITION(gamemode_keepaway)
        }
 
        return 0;
-}
\ No newline at end of file
+}
index ca2865a2162e49c73a39a88f2efd59879dddbed9..e1cb1a85bcfe65e788eb11ce0fb1ada428205ee8 100644 (file)
@@ -2,7 +2,6 @@
 
 // #define KH_PLAYER_USE_ATTACHMENT
 // #define KH_PLAYER_USE_CARRIEDMODEL
-// #define KH_KEY_ATTACHMENT_DEBUG
 
 #ifdef KH_PLAYER_USE_ATTACHMENT
 vector KH_PLAYER_ATTACHMENT_DIST_ROTATED = '0 -4 0';
@@ -181,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));
@@ -285,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;
@@ -419,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;
@@ -440,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);
 }
@@ -488,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
@@ -498,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
@@ -567,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");
@@ -577,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)
@@ -588,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)
@@ -648,17 +647,6 @@ void kh_Key_Think()  // runs all the time
        if(intermission_running)
                return;
 
-#ifdef KH_KEY_ATTACHMENT_DEBUG
-       if(self.kh_prev == self.owner)
-       {
-               if(cvar_string("_angles") != "")
-               {
-                       self.angles = stov(cvar_string("_angles"));
-                       setorigin(self, stov(cvar_string("_origin")));
-               }
-       }
-#endif
-
        if(self.owner)
        {
 #ifndef KH_PLAYER_USE_ATTACHMENT
@@ -667,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
@@ -677,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;
                }
        }
@@ -702,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
@@ -828,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;
                }
@@ -877,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);
 }
@@ -934,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
@@ -951,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
                }
@@ -978,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..9817b3b0e1afaa45675b4755f45989da50afe0d6 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(e);
                                        }
                                }
                                if(t < recordtime || recordtime == 0)
@@ -742,11 +742,21 @@ void trigger_race_checkpoint_verify()
                for(trigger = world; (trigger = find(trigger, classname, "trigger_multiple")); )
                        for(targ = world; (targ = find(targ, targetname, trigger.target)); )
                                if (targ.classname == "target_checkpoint" || targ.classname == "target_startTimer" || targ.classname == "target_stopTimer") {
-                                       targ.wait = -2;
+                                       trigger.wait = 0;
+                                       trigger.delay = 0;
+                                       targ.wait = 0;
                                        targ.delay = 0;
 
-                                       setsize(targ, trigger.mins, trigger.maxs);
-                                       setorigin(targ, trigger.origin);
+                    // These just make the game crash on some maps with oddly shaped triggers. 
+                    // (on the other hand they used to fix the case when two players ran through a checkpoint at once, 
+                    // and often one of them just passed through without being registered. Hope it's fixed  in a better way now.
+                    // (happened on item triggers too)
+                    //
+                                       //targ.wait = -2;
+                                       //targ.delay = 0;
+
+                                       //setsize(targ, trigger.mins, trigger.maxs);
+                                       //setorigin(targ, trigger.origin);
                                        //remove(trigger);
                                }
        }
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 a5f35aa89ae3bc04a0e8d51d9ab5587dea084c1d..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');
 
@@ -86,7 +86,7 @@ void CreatureFrame (void)
                        if (g_footsteps)
                        if (!gameover)
                        if (self.flags & FL_ONGROUND)
-                       if (vlen(self.velocity) > sv_maxspeed * 0.6)
+                       if (vlen(self.velocity) > autocvar_sv_maxspeed * 0.6)
                        if (!self.deadflag)
                        if (time < self.lastground + 0.2)
                        {
@@ -175,43 +175,14 @@ void StartFrame (void)
 
        WarpZone_StartFrame();
 
-       sv_gravity = cvar("sv_gravity");
-       sv_maxairspeed = cvar("sv_maxairspeed");
-       sv_maxspeed = cvar ("sv_maxspeed");
-       sv_friction = cvar ("sv_friction");
-       sv_accelerate = cvar ("sv_accelerate");
-       sv_airaccelerate = cvar("sv_airaccelerate");
-       sv_airaccel_sideways_friction = cvar("sv_airaccel_sideways_friction");
-       sv_airaccel_qw = cvar("sv_airaccel_qw");
-       sv_stopspeed = cvar ("sv_stopspeed");
-       sv_airstopaccelerate = cvar("sv_airstopaccelerate");
-       sv_airstrafeaccelerate = cvar("sv_airstrafeaccelerate");
-       sv_maxairstrafespeed = cvar("sv_maxairstrafespeed");
-       sv_airstrafeaccel_qw = cvar("sv_airstrafeaccel_qw");
-       sv_aircontrol = cvar("sv_aircontrol");
-       sv_aircontrol_penalty = cvar("sv_aircontrol_penalty");
-       sv_aircontrol_power = cvar("sv_aircontrol_power");
-       sv_warsowbunny_airforwardaccel = cvar("sv_warsowbunny_airforwardaccel");
-       sv_warsowbunny_accel = cvar("sv_warsowbunny_accel");
-       sv_warsowbunny_topspeed = cvar("sv_warsowbunny_topspeed");
-       sv_warsowbunny_turnaccel = cvar("sv_warsowbunny_turnaccel");
-       sv_warsowbunny_backtosideratio = cvar("sv_warsowbunny_backtosideratio");
-       sv_airspeedlimit_nonqw = cvar("sv_airspeedlimit_nonqw");
-       teamplay = cvar ("teamplay");
-       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
-       sv_doublejump = cvar("sv_doublejump");
 
        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
 
-       if(teams_matter && !teamplay)
-               teamplay = 3;
-       if(!teams_matter && teamplay)
-               teamplay = 0;
-
-       skill = cvar("skill");
+       skill = autocvar_skill;
 
        Spawnqueue_Check();
 
@@ -221,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;
@@ -229,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;
@@ -243,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..143b3be4879d79cc2993a685f275e0a1cc2e0bee 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);
                        }
                }
        }
@@ -590,7 +590,7 @@ float weapon_pickupevalfunc(entity player, entity item)
        // If custom weapon priorities for bots is enabled rate most wanted weapons higher
        if( bot_custom_weapon && c )
        {
-               for(i = WEP_FIRST; i < WEP_LAST ; ++i)
+               for(i = WEP_FIRST; i <= WEP_LAST ; ++i)
                {
                        // Find weapon
                        if( (get_weaponinfo(i)).weapons & item.weapons  != item.weapons )
@@ -630,7 +630,7 @@ float commodity_pickupevalfunc(entity player, entity item)
        c = 0;
 
        // Detect needed ammo
-       for(i = WEP_FIRST; i < WEP_LAST ; ++i)
+       for(i = WEP_FIRST; i <= WEP_LAST ; ++i)
        {
                wi = get_weaponinfo(i);
 
@@ -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..36048e860129a1d79030939b3d8c2238828a8062 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');
@@ -286,8 +286,7 @@ void trigger_push_findtarget()
  */
 void spawnfunc_trigger_push()
 {
-       if (self.angles != '0 0 0')
-               SetMovedir ();
+       SetMovedir ();
 
        EXACTTRIGGER_INIT;
        
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..44036ade494e9b437934f93438fdd5ead1dab8ab 100644 (file)
@@ -47,11 +47,13 @@ void target_init_verify()
                for(targ = world; (targ = find(targ, targetname, trigger.target)); )
                        if (targ.classname == "target_init" || targ.classname == "target_give" || targ.classname == "target_items")
                        {
-                               targ.wait = -2;
+                               trigger.wait = 0;
+                               trigger.delay = 0;
+                               targ.wait = 0;
                                targ.delay = 0;
 
-                               setsize(targ, trigger.mins, trigger.maxs);
-                               setorigin(targ, trigger.origin);
+                               //setsize(targ, trigger.mins, trigger.maxs);
+                               //setorigin(targ, trigger.origin);
                                //remove(trigger);
                        }
 }
@@ -59,7 +61,7 @@ void target_init_verify()
 void spawnfunc_target_init()
 {
        self.spawnflags = 0; // remove all weapons except the ones listed below
-       self.netname = "laser uzi"; // keep these weapons through the remove trigger
+       self.netname = "shotgun"; // keep these weapons through the remove trigger
        spawnfunc_target_items();
        InitializeEntity(self, target_init_verify, INITPRIO_FINDTARGET);
 }
@@ -70,25 +72,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
@@ -98,7 +100,9 @@ void target_give_init()
                        self.armorvalue = 100;
                else if (targ.classname == "item_health_mega")
                        self.health = 200;
-               remove(targ);
+               //remove(targ); // removing ents in init functions causes havoc, workaround:
+        targ.think = SUB_Remove;
+        targ.nextthink = time;
        }
        self.spawnflags = 2;
        spawnfunc_target_items();
index eba0ea0681b3ee22edfcc378e7ca1c23f1027b17..93ced82670b1a36fb15c42a8236419621d52513a 100644 (file)
@@ -33,7 +33,7 @@ float check_tdeath(entity player, vector org, vector telefragmin, vector telefra
        {
                TDEATHLOOP(org)
                {
-                       if not(teamplay && 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(teamplay && 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 7df082c8747475d3b6d8fd0e3fb116ecca519fee..9cb52c1daa2444053ea8e6fbe2d344127f4197ad 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,9 +112,10 @@ void ReadGameCvars()
        float i;
 
        found = 0;
-       prev = cvar("gamecfg");
+       prev = autocvar_gamecfg;
        for(i = 0; i < 2; ++i)
        {
+//#NO AUTOCVARS START
                found += (g_dm = (!found && (prev != GAME_DEATHMATCH) && cvar("g_dm")));
                found += (g_tdm = (!found && (prev != GAME_TEAM_DEATHMATCH) && cvar("g_tdm")));
                found += (g_domination = (!found && (prev != GAME_DOMINATION) && cvar("g_domination")));
@@ -131,6 +132,7 @@ void ReadGameCvars()
                found += (g_cts = (!found && (prev != GAME_CTS) && cvar("g_cts")));
                found += (g_freezetag = (!found && (prev != GAME_FREEZETAG) && cvar("g_freezetag")));
                found += (g_keepaway = (!found && (prev != GAME_KEEPAWAY) && cvar("g_keepaway")));
+//#NO AUTOCVARS END
 
                if(found)
                        break;
@@ -141,13 +143,14 @@ 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;
        }
 
        teams_matter = 0;
+       serverflags &~= SERVERFLAG_TEAMPLAY;
 }
 
 void default_delayedinit()
@@ -158,15 +161,7 @@ void default_delayedinit()
 
 void ActivateTeamplay()
 {
-       float teamplay_default;
-       teamplay_default = cvar("teamplay_default");
-
-       if(teamplay_default)
-               teamplay = teamplay_default;
-       else
-               teamplay = 3;
-       cvar_set("teamplay", ftos(teamplay));
-
+       serverflags |= SERVERFLAG_TEAMPLAY;
        teams_matter = 1;
 }
 
@@ -178,9 +173,6 @@ void InitGameplayMode()
 
        VoteReset();
 
-       teams_matter = 0;
-       cvar_set("teamplay", "0");
-
        // make sure only ONE type is selected
        ReadGameCvars();
        WriteGameCvars();
@@ -210,9 +202,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)
        {
@@ -226,7 +218,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
        }
 
@@ -235,8 +227,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
        }
@@ -246,20 +238,16 @@ void InitGameplayMode()
                game = GAME_CTF;
                gamemode_name = "Capture the Flag";
                ActivateTeamplay();
-               if(cvar("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_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
@@ -269,10 +257,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();
        }
 
@@ -280,7 +268,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;
@@ -293,12 +281,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)
@@ -306,8 +294,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");
        }
@@ -316,8 +304,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);
        }
 
@@ -326,8 +314,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);
        }
 
@@ -353,17 +341,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
        }
 
@@ -380,8 +368,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
@@ -404,7 +392,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));
@@ -419,19 +407,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", cvar_string("g_race_qualifying_timelimit"));
+                       cvar_set("timelimit", ftos(autocvar_g_race_qualifying_timelimit));
                }
                else
                        g_race_qualifying = 0;
@@ -451,7 +439,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";
@@ -469,14 +457,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;
        }
 
@@ -485,7 +473,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;
@@ -525,11 +513,11 @@ 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)
+       if(g_cloaked && !g_cts)
                modifications = strcat(modifications, ", Cloaked");
        if(g_grappling_hook)
                modifications = strcat(modifications, ", Hook");
@@ -537,7 +525,7 @@ void PrintWelcomeMessage(entity pl)
                modifications = strcat(modifications, ", Midair");
        if(g_pinata)
                modifications = strcat(modifications, ", Pinata");
-       if(g_weapon_stay)
+       if(g_weapon_stay && !g_cts)
                modifications = strcat(modifications, ", Weapons stay");
        if(g_bloodloss > 0)
                modifications = strcat(modifications, ", Bloodloss");
@@ -548,7 +536,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 != "")
@@ -560,13 +548,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);
        }
 
@@ -574,7 +562,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));
        }
@@ -639,11 +627,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)
-       {
-               c1 = 0; // only allow RED team for player joining
-       }
-       else if(g_onslaught)
+       if(g_onslaught)
        {
                // onslaught is special
                head = findchain(classname, "onslaught_generator");
@@ -709,9 +693,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)
@@ -759,8 +743,15 @@ void GetTeamCounts(entity ignore)
        // FIXME: also find and memorize the lowest-scoring bot on each team (in case players must be shuffled around)
        // also remember the lowest-scoring player
 
-       FOR_EACH_PLAYER(head)
+       FOR_EACH_CLIENT(head)
        {
+               float t;
+               if(head.classname == "player")
+                       t = head.team;
+               else if(head.team_forced > 0)
+                       t = head.team_forced; // reserve the spot
+               else
+                       continue;
                if(head != ignore)// && head.netname != "")
                {
                        value = PlayerValue(head);
@@ -768,7 +759,7 @@ void GetTeamCounts(entity ignore)
                                bvalue = value;
                        else
                                bvalue = 0;
-                       if(head.team == COLOR_TEAM1)
+                       if(t == COLOR_TEAM1)
                        {
                                if(c1 >= 0)
                                {
@@ -776,7 +767,7 @@ void GetTeamCounts(entity ignore)
                                        cb1 = cb1 + bvalue;
                                }
                        }
-                       if(head.team == COLOR_TEAM2)
+                       if(t == COLOR_TEAM2)
                        {
                                if(c2 >= 0)
                                {
@@ -784,7 +775,7 @@ void GetTeamCounts(entity ignore)
                                        cb2 = cb2 + bvalue;
                                }
                        }
-                       if(head.team == COLOR_TEAM3)
+                       if(t == COLOR_TEAM3)
                        {
                                if(c3 >= 0)
                                {
@@ -792,7 +783,7 @@ void GetTeamCounts(entity ignore)
                                        cb3 = cb3 + bvalue;
                                }
                        }
-                       if(head.team == COLOR_TEAM4)
+                       if(t == COLOR_TEAM4)
                        {
                                if(c4 >= 0)
                                {
@@ -802,6 +793,18 @@ void GetTeamCounts(entity ignore)
                        }
                }
        }
+
+       // if the player who has a forced team has not joined yet, reserve the spot
+       if(autocvar_g_campaign)
+       {
+               switch(autocvar_g_campaign_forceteam)
+               {
+                       case 1: if(c1 == cb1) ++c1; break;
+                       case 2: if(c2 == cb2) ++c2; break;
+                       case 3: if(c3 == cb3) ++c3; break;
+                       case 4: if(c4 == cb4) ++c4; break;
+               }
+       }
 }
 
 // returns # of smallest team (1, 2, 3, 4)
@@ -824,12 +827,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");
@@ -906,33 +909,6 @@ float JoinBestTeam(entity pl, float only_return_best, float forcebestteam)
        // find out what teams are available
        CheckAllowedTeams(pl);
 
-       // if we want the player in a certain team for campaign, force him there
-       if(cvar("g_campaign"))
-       if(clienttype(pl) == CLIENTTYPE_REAL) // only players, not bots
-       {
-               switch(cvar("g_campaign_forceteam"))
-               {
-                       case 1:
-                               SetPlayerColors(pl, COLOR_TEAM1 - 1);
-                               LogTeamchange(pl.playerid, pl.team, 2);
-                               return COLOR_TEAM1;
-                       case 2:
-                               SetPlayerColors(pl, COLOR_TEAM2 - 1);
-                               LogTeamchange(pl.playerid, pl.team, 2);
-                               return COLOR_TEAM2;
-                       case 3:
-                               SetPlayerColors(pl, COLOR_TEAM3 - 1);
-                               LogTeamchange(pl.playerid, pl.team, 2);
-                               return COLOR_TEAM3;
-                       case 4:
-                               SetPlayerColors(pl, COLOR_TEAM4 - 1);
-                               LogTeamchange(pl.playerid, pl.team, 2);
-                               return COLOR_TEAM4;
-                       default:
-                               break;
-               }
-       }
-
        // if we don't care what team he ends up on, put him on whatever team he entered as.
        // if he's not on a valid team, then let other code put him on the smallest team
        if(!forcebestteam)
@@ -1044,12 +1020,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
 
@@ -1364,9 +1340,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 99f18c20b0c545ffb42c7eb7f8cc2a240a5058e0..80344a9e1f211bd2501911c7dc6272f39659264b 100644 (file)
@@ -63,7 +63,7 @@ vector turret_stdproc_aim_generic()
                                vz = self.enemy.velocity_z;
                                for(i = 0; i < impact_time; i += sys_frametime)
                                {
-                                       vz = vz - (sv_gravity * sys_frametime);
+                                       vz = vz - (autocvar_sv_gravity * sys_frametime);
                                        prep_z = prep_z + vz * sys_frametime;
                                }
                        }
index d3e0553db9800452fd252ca40c877b5900f53822..b7af33af82e506cc657ceee10e3cd6573fbb42d5 100644 (file)
@@ -269,15 +269,15 @@ void turret_stdproc_damage (entity inflictor, entity attacker, float damage, flo
     if not (self.tur_active)
         return;
 
-    if (teamplay != 0)
+    if (teams_matter)
     if (self.team == attacker.team)
     {
         // This does not happen anymore. Re-enable if you fix that.
         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 af53db7c62c234f258cfb46919f1dfe29e820960..4a2e886af863bdca739e41c43786dc5f684bc5ab 100644 (file)
@@ -609,7 +609,7 @@ void turret_think()
     self.nextthink = time + self.ticrate;
 
     // ONS uses somewhat backwards linking.
-    if (teamplay)
+    if (teams_matter)
     {
         if not (g_onslaught)
             if (self.target)
@@ -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,12 +913,12 @@ 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
     }
-    else if not (teamplay)
+    else if not (teams_matter)
                self.team = MAX_SHOT_DISTANCE; // Group all turrets into the same team, so they dont kill eachother.
        else if(g_onslaught && self.targetname)
        {
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 6f40e0b4d05b6ca6aa7a2c4e69ec60f0ffcec4ce..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;
 
 }
 
@@ -114,7 +114,7 @@ void racer_align4point()
         self.velocity += normalize(self.origin - trace_endpos) * (vlen(self.velocity) * 1.25);
 
     self.velocity =  self.velocity + (push_vector * frametime);
-    self.velocity_z -= sv_gravity * frametime;
+    self.velocity_z -= autocvar_sv_gravity * frametime;
 
     push_vector_x = (fl_push - bl_push);
     push_vector_x += (fr_push - br_push);
@@ -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 ee6d3976f6dbfa43ab9b4d9c7ac8cb3f1afed7fe..38ebad04275078262cfc5d9bbdf3c6613ad50557 100644 (file)
@@ -295,7 +295,7 @@ void raptor_enter()
     if (clienttype(other) != CLIENTTYPE_REAL)
         return;
 
-    if(teamplay)
+    if(teams_matter)
         if(self.team)
             if(self.team != other.team)
                 return;
@@ -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 056249ed53a6bc5f276da85ecbfc38532ab6ace6..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;
 }
@@ -430,7 +430,7 @@ void spiderbot_enter()
 
     self.colormod = self.tur_head.colormod = '0 0 0';
 
-    if(teamplay)
+    if(teams_matter)
     if(self.team)
     if(self.team != other.team)
         return;
@@ -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;
@@ -533,7 +533,7 @@ void spiderbot_exit(float eject)
        self.colormap            = 1024;
        self.tur_head.colormap   = 1024;
 
-    if not (teamplay)
+    if not (teams_matter)
         self.team                = 0;
     else
     {
@@ -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;
 
@@ -697,7 +697,7 @@ void vewhicle_spiderbot_dinit()
     tracebox(self.origin + '0 0 100', spiderbot_MIN, spiderbot_MAX, self.origin - '0 0 10000', MOVE_WORLDONLY, self);
     setorigin(self.spiderbot_spawnpnt,trace_endpos);
 
-    if(self.team && !teamplay)
+    if(self.team && !teams_matter)
         self.team = 0;
     else
         self.spiderbot_spawnpnt.team = self.team;
index 1fbdecad9fdf6714fff928c760ab9444eb140a35..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, " ", cvar_string("g_ban_default_bantime"), " ", cvar_string("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 ", cvar_string("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 309717305052fefb239085d85a8ed1ff41b5b103..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_after_changing_weapons"))
+               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..49e2773836c8cb8397ed883c3670d0affd19db9f 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)
@@ -451,6 +451,23 @@ void fireBallisticBullet(vector start, vector dir, float spread, float pSpeed, f
                                W_BallisticBullet_Hit();
                        }
 
+                       // if we hit "weapclip", bail out
+                       //
+                       // rationale of this check:
+                       //
+                       // any shader that is solid, nodraw AND trans is meant to clip weapon
+                       // shots and players, but has no other effect!
+                       //
+                       // if it is not trans, it is caulk and should not have this side effect
+                       //
+                       // matching shaders:
+                       //   common/weapclip (intended)
+                       //   common/noimpact (is supposed to eat projectiles, but is erased farther above)
+                       if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NODRAW)
+                       if not(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NONSOLID)
+                       if not(trace_dphitcontents & DPCONTENTS_OPAQUE)
+                               break;
+
                        density = other.ballistics_density;
                        if(density == 0)
                                density = 1;
index 092cb10e49b389c7a5ffa0610b7904ac8d19bbb6..4495b720c54e02eecd3ab2ca62e772aa31771adb 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,30 +174,30 @@ 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);
-                               }                               
-                       }                       
+                               }
+                       }
                }
        }
        remove(self);
@@ -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);
@@ -511,32 +511,32 @@ 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);
+               if (random() < 0.10)
+                       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;
                        }
                }
@@ -549,21 +549,21 @@ float w_crylink(float req)
                                {
                                        vector pos;
                                        entity linkjoineffect;
-                                       
-                                       
+
+
                                        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();
                                        linkjoineffect.think = W_Crylink_LinkJoinEffect_Think;
-                                       linkjoineffect.classname = "linkjoineffect";                                    
+                                       linkjoineffect.classname = "linkjoineffect";
                                        linkjoineffect.nextthink = time + w_crylink_linkjoin_time;
                                        linkjoineffect.owner = self;
                                        setorigin(linkjoineffect, pos);
@@ -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..1ae02b1613e47c5f1e7ba97a347688cd0a35b2ce 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,17 +52,17 @@ 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);
 }
 
 void W_Plasma_Touch (void)
 {
        //self.velocity = self.velocity  * 0.1;
-       
+
        PROJECTILE_TOUCH;
        if (other.takedamage == DAMAGE_AIM) {
                W_Plasma_Explode ();
@@ -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,14 +174,14 @@ 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;
        p2 = spawn();
@@ -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,14 @@ 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))
+                       float shoot;
+
+                       if(autocvar_g_balance_electro_primary_speed)
+                               shoot = bot_aim(autocvar_g_balance_electro_primary_speed, 0, autocvar_g_balance_electro_primary_lifetime, FALSE);
+                       else
+                               shoot = bot_aim(1000000, 0, 0.001, FALSE);
+
+                       if(shoot)
                        {
                                self.BUTTON_ATCK = TRUE;
                                if(random() < 0.01) self.bot_secondary_electromooth = 1;
@@ -359,7 +366,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 +377,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 +391,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 +406,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 +424,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 +433,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 0a06064632deae27be38ad60391fd434326c480a..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;
@@ -314,9 +314,9 @@ float w_minelayer(float req)
                        }
                        float desirabledamage;
                        desirabledamage = enemydamage;
-                       if (teamplay != 1 && time > self.invincible_finished && time > self.spawnshieldtime)
-                               desirabledamage = desirabledamage - selfdamage * cvar("g_balance_selfdamagepercent");
-                       if (self.team && teamplay != 1)
+                       if (time > self.invincible_finished && time > self.spawnshieldtime)
+                               desirabledamage = desirabledamage - selfdamage * autocvar_g_balance_selfdamagepercent;
+                       if (teams_matter && self.team)
                                desirabledamage = desirabledamage - teamdamage;
 
                        mine = find(world, classname, "mine");
@@ -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 ce97b02451210d7db63a342db4eb03254e98b2b8..f515d98b5a124b119f164e30e2d765691db6dc14 100644 (file)
@@ -43,7 +43,7 @@ void W_MinstaNex_Attack (void)
        // teamcolor / hit beam effect
        vector v;
        v = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos);
-       if(teamplay)
+       if(teams_matter)
        {
            switch(self.team)
            {
@@ -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 6e3210859dc65d2c80ccf4b31f4662551237d917..7b1239b898859f206b22bfe7881b49d8b72a8fb6 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;
@@ -80,7 +80,7 @@ void W_Nex_Attack (float issecondary)
 
 void spawnfunc_weapon_nex (void); // defined in t_items.qc
 
-.float nex_charge_pool_pauseregen_finished;
+.float nex_chargepool_pauseregen_finished;
 float w_nex(float req)
 {
        float dt;
@@ -91,89 +91,86 @@ 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_glowmod_x = autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_red_half * min(1, self.nex_charge / autocvar_g_balance_nex_charge_limit);
+            self.weaponentity_glowmod_y = autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_green_half * min(1, self.nex_charge / autocvar_g_balance_nex_charge_limit);
+            self.weaponentity_glowmod_z = autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_blue_half * min(1, self.nex_charge / autocvar_g_balance_nex_charge_limit);
 
-            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);
-
-            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_glowmod_x = self.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_glowmod_y = self.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_glowmod_z = self.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_charge_pool"))
-               if(self.nex_charge_pool_ammo < 1)
+               if(autocvar_g_balance_nex_secondary_chargepool)
+               if(self.nex_chargepool_ammo < 1)
                {
-                       if(self.nex_charge_pool_pauseregen_finished < time)
-                               self.nex_charge_pool_ammo = min(1, self.nex_charge_pool_ammo + cvar("g_balance_nex_secondary_charge_pool_regen") * frametime / W_TICSPERFRAME);
-                       self.pauseregen_finished = max(self.pauseregen_finished, time + cvar("g_balance_nex_secondary_charge_pool_pause_health_regen"));
+                       if(self.nex_chargepool_pauseregen_finished < time)
+                               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_charge_pool"))
+                               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_charge_pool_ammo = max(0, self.nex_charge_pool_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_charge_pool_pauseregen_finished = time + cvar("g_balance_nex_secondary_charge_pool_pause_regen");
-                                               dt = min(dt, self.nex_charge_pool_ammo);
+                                               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 +190,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 b42a4482899571dbf2967c8519855f3478e8b59c..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
@@ -196,21 +196,10 @@ void W_Rocket_Think (void)
                        desiredorigin = WarpZone_RefSys_TransformOrigin(self.owner, self, self.owner.origin + self.owner.view_ofs);
                        olddir = normalize(self.velocity);
 
-#if 0
-                       // disabled this code because it doesn't do what I want it to do :P
-                       cosminang = cos(cvar("g_balance_rocketlauncher_guidefadeangle") * DEG2RAD);
-                       cosmaxang = cos(cvar("g_balance_rocketlauncher_guidemaxangle") * DEG2RAD);
-                       cosang = desireddir * normalize(self.origin - desiredorigin);
-                       if(cosminang == cosmaxang)
-                               f *= (cosang >= cosminang);
-                       else
-                               f *= bound(0, (cosang - cosmaxang) / (cosminang - cosmaxang), 1);
-#endif
-
                        // 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);
@@ -260,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;
@@ -288,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 ();
@@ -319,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;
@@ -360,9 +349,9 @@ float w_rlauncher(float req)
                        }
                        local float desirabledamage;
                        desirabledamage = enemydamage;
-                       if (teamplay != 1 && time > self.invincible_finished && time > self.spawnshieldtime)
-                               desirabledamage = desirabledamage - selfdamage * cvar("g_balance_selfdamagepercent");
-                       if (self.team && teamplay != 1)
+                       if (time > self.invincible_finished && time > self.spawnshieldtime)
+                               desirabledamage = desirabledamage - selfdamage * autocvar_g_balance_selfdamagepercent;
+                       if (teams_matter && self.team)
                                desirabledamage = desirabledamage - teamdamage;
 
                        missile = find(world, classname, "rocket");
@@ -415,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;
                        }
                }
@@ -460,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 09c7ec85acd080acec35f836b77eb8c3cb8482ae..eb64dddd802875bbbdcc2b98d76025e55a0b02d7 100644 (file)
@@ -2,14 +2,13 @@
 REGISTER_WEAPON(SEEKER, w_seeker, IT_ROCKETS, 9, WEP_FLAG_NORMAL | WEP_TYPE_SPLASH, BOT_PICKUP_RATING_MID, "seeker", "seeker", "T.A.G. Seeker");
 #else
 #ifdef SVQC
-//.float speed; = switchweapon
 //.float proxytime; = autoswitch
 //.float tl; = wait
 
 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);
 }
@@ -27,6 +26,7 @@ void Seeker_Missile_Think()
        vector desireddir, olddir, newdir, eorg;
        float turnrate;
        float dist;
+       float spd;
 
        if (time > self.cnt)
        {
@@ -34,14 +34,12 @@ void Seeker_Missile_Think()
                Seeker_Missile_Explode();
        }
 
-       if (!self.switchweapon)
-               self.switchweapon = cvar("g_balance_seeker_missile_speed");
-
-       if ((self.switchweapon < cvar("g_balance_seeker_missile_speed_max")) && cvar("g_balance_seeker_missile_speed_accel"))
-               self.switchweapon = self.switchweapon * cvar("g_balance_seeker_missile_accel");
-
-       if (self.switchweapon > cvar("g_balance_seeker_missile_speed_max"))
-               self.switchweapon = self.switchweapon * cvar("g_balance_seeker_missile_decel");
+       spd = vlen(self.velocity);
+       spd = bound(
+               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)
                if (self.enemy.takedamage != DAMAGE_AIM || self.enemy.deadflag != DEAD_NO)
@@ -51,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)
@@ -66,24 +64,24 @@ 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);
                }
                
                newdir = normalize(olddir + desireddir * turnrate); // take the average of the 2 directions; not the best method but simple & easy
-               self.velocity = newdir * self.switchweapon; // make me fly in the new direction at my flight speed
+               self.velocity = newdir * spd; // make me fly in the new direction at my flight speed
        }
 
        // 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
                        {
@@ -146,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;
@@ -160,8 +158,8 @@ 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");
+       if not(self.items & IT_UNLIMITED_WEAPON_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);
@@ -174,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.
 
@@ -197,7 +195,6 @@ void Seeker_Fire_Missile(vector f_diff)
        missile.flags       = FL_PROJECTILE;
        W_SETUPPROJECTILEVELOCITY_UP(missile, g_balance_seeker_missile);
 
-       missile.switchweapon = vlen(missile.velocity);
        missile.angles = vectoangles (missile.velocity);
 
        CSQCProjectile(missile, FALSE, PROJECTILE_SEEKER, TRUE);
@@ -211,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))
+       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;
@@ -283,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;
@@ -298,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;
@@ -309,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');
@@ -338,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);
 }
@@ -357,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)
@@ -376,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);
@@ -385,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;
@@ -417,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);
                        }
 
        }
@@ -448,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..08c4a901e12083d7bdd972ed8755e3010cf97d9e 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
@@ -100,26 +100,26 @@ void spawnfunc_weapon_shotgun(); // defined in t_items.qc
 float w_shotgun(float req)
 {
        if (req == WR_AIM)
-               if(vlen(self.origin-self.enemy.origin)>200)
-                       self.BUTTON_ATCK = bot_aim(1000000, 0, 0.001, FALSE);
-               else
+               if(vlen(self.origin-self.enemy.origin) <= autocvar_g_balance_shotgun_secondary_melee_range)
                        self.BUTTON_ATCK2 = bot_aim(1000000, 0, 0.001, FALSE);
+               else
+                       self.BUTTON_ATCK = bot_aim(1000000, 0, 0.001, FALSE);
        else if (req == WR_THINK)
        {
                if (self.BUTTON_ATCK)
                {
                        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;
 }
index e76bc0eb96761c5efa52f02a07400b51fa28cdaa..62e74682090c725e544ce7725e57bc8ba2a06294 100644 (file)
@@ -191,6 +191,8 @@ void WarpZone_TraceBox_ThroughZone(vector org, vector mi, vector ma, vector end,
        entity wz;
        vector vf, vr, vu;
 
+       WarpZone_trace_firstzone = world;
+       WarpZone_trace_lastzone = world;
        WarpZone_Trace_InitTransform();
        if(!warpzone_warpzones_exist)
        {
@@ -234,6 +236,8 @@ void WarpZone_TraceBox_ThroughZone(vector org, vector mi, vector ma, vector end,
        wz = WarpZone_Find(org + mi, org + ma);
        if(wz)
        {
+               WarpZone_trace_firstzone = wz;
+               WarpZone_trace_lastzone = wz;
                if(zone && wz != zone)
                {
                        // we are in ANOTHER warpzone. This is bad. Make a zero length trace and return.
@@ -281,11 +285,15 @@ void WarpZone_TraceBox_ThroughZone(vector org, vector mi, vector ma, vector end,
                }
                if(trace_ent == wz)
                {
+                       // FIXME can this check be removed? Do we really need it?
                        dprint("I transformed into the same zone again, wtf, aborting the trace\n");
                        trace_ent = world;
                        break;
                }
                wz = trace_ent;
+               if(!WarpZone_trace_firstzone)
+                       WarpZone_trace_firstzone = wz;
+               WarpZone_trace_lastzone = wz;
                if(zone && wz != zone)
                        break;
                WarpZone_Trace_AddTransform(wz);
@@ -322,6 +330,8 @@ void WarpZone_TraceToss_ThroughZone(entity e, entity forent, entity zone, WarpZo
        o0 = e.origin;
        v0 = e.velocity;
 
+       WarpZone_trace_firstzone = world;
+       WarpZone_trace_lastzone = world;
        WarpZone_Trace_InitTransform();
        WarpZone_tracetoss_time = 0;
        if(!warpzone_warpzones_exist)
@@ -345,6 +355,8 @@ void WarpZone_TraceToss_ThroughZone(entity e, entity forent, entity zone, WarpZo
        wz = WarpZone_Find(e.origin + e.mins, e.origin + e.maxs);
        if(wz)
        {
+               WarpZone_trace_firstzone = wz;
+               WarpZone_trace_lastzone = wz;
                if(zone && wz != zone)
                {
                        // we are in ANOTHER warpzone. This is bad. Make a zero length trace and return.
@@ -381,11 +393,15 @@ void WarpZone_TraceToss_ThroughZone(entity e, entity forent, entity zone, WarpZo
                        break;
                if(trace_ent == wz)
                {
+                       // FIXME can this check be removed? Do we really need it?
                        dprint("I transformed into the same zone again, wtf, aborting the trace\n");
                        trace_ent = world;
                        break;
                }
                wz = trace_ent;
+               if(!WarpZone_trace_firstzone)
+                       WarpZone_trace_firstzone = wz;
+               WarpZone_trace_lastzone = wz;
                if(zone && wz != zone)
                        break;
                WarpZone_Trace_AddTransform(wz);
index 1b594d96d73b7c9da95404ad43e73185a1f66ba6..72485f25c4bc91ef64d1af1ab4c81576a407a6da 100644 (file)
@@ -30,6 +30,8 @@ void WarpZone_MakeAllOther();
 typedef void(vector start, vector hit, vector end) WarpZone_trace_callback_t; // called on every elementary trace
 const var WarpZone_trace_callback_t WarpZone_trace_callback_t_null;
 entity WarpZone_trace_transform; // transform accumulator during a trace
+entity WarpZone_trace_firstzone; // first warpzone hit by a trace (can differ from the requested zone in case of _ThroughZone, the trace is aborted then)
+entity WarpZone_trace_lastzone; // first warpzone hit by a trace (can differ from the requested zone in case of _ThroughZone, the trace is aborted then)
 vector WarpZone_tracetoss_velocity; // ending velocity of a tracetoss (post-transform)
 float WarpZone_tracetoss_time; // duration of toss (approximate)
 void WarpZone_TraceBox(vector org, vector min, vector max, vector end, float nomonsters, entity forent);
index 994a1c566ea261be3c9ba87a6b372fe53f4bff2e..725fa430e1bdad63ef5c28560b257ef89a82b25d 100644 (file)
--- a/quake.rc
+++ b/quake.rc
@@ -4,7 +4,6 @@ maxplayers $menu_maxplayers
 exec data/campaign.cfg
 exec config_update.cfg
 exec autoexec.cfg
-exec font-nimbussansl.cfg
 stuffcmds
 //startdemos demos/demo1 demos/demo2 demos/demo3
 //startdemos
index 50352aaae846931ea54e9aa8c3f32e2b8ae4c884..a2f7c8ac96a93fecaf855d467dfa378c9e299301 100644 (file)
@@ -15,10 +15,9 @@ skill 100
 fraglimit_override 0
 timelimit_override 3
 sv_eventlog 1
-g_nix 1
-g_nix_with_laser 1
-g_balance_nix_roundtime 3
-map downer
+g_weaponarena all
+g_weaponarena_random 2
+map g-23
 
-// time darkplaces/xonotic-dedicated +exec serverbench.cfg | grep ^: > serverbench.log
+// time ./all run +exec serverbench.cfg | grep ^: > serverbench.log
 // on Linux/Ubuntu, this should always yield a file with the md5sum
index 101defc6162b63aeb29e6a0e73586c5c1552edeb..876862b1c50a49684ef2afcc5d49212e00d4a2e9 100644 (file)
@@ -51,8 +51,8 @@ exec unit_walker.cfg
 // OMG! Its the Evil Wheel! :O
 exec unit_ewheel.cfg
 
-//
-exec unit_repulsor.cfg
+// It is so repulsive, it doesn't even exist!
+// exec unit_repulsor.cfg
 
 set g_turrets_reloadcvars 0 // reload when this cfg has been exec'd
 alias g_turrets_reload "set g_turrets_reloadcvars 1"
index 0e4cb86289e81aecac9046e00f6c15e27c3739b8..ec46525c90a1ec87dea004ba58f94e62ad837625 100644 (file)
@@ -20,6 +20,10 @@ FruitieX (game / web)
 *3D Art
 morphed
 
+*Concept Art
+LJFHutch
+theShadow
+
 *Level Design
 FruitieX
 MirceaKitsune