]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge remote-tracking branch 'origin/master' into samual/weapons
authorSamual Lenks <samual@xonotic.org>
Wed, 26 Feb 2014 21:00:14 +0000 (16:00 -0500)
committerSamual Lenks <samual@xonotic.org>
Wed, 26 Feb 2014 21:00:14 +0000 (16:00 -0500)
Conflicts:
mutators.cfg
qcsrc/common/items.qh

1  2 
mutators.cfg
qcsrc/client/Main.qc
qcsrc/client/View.qc
qcsrc/client/autocvars.qh
qcsrc/client/hud.qc
qcsrc/client/miscfunctions.qc
qcsrc/client/scoreboard.qc
qcsrc/client/waypointsprites.qc
qcsrc/server/autocvars.qh
qcsrc/server/miscfunctions.qc
qcsrc/server/mutators/mutator_nades.qc

diff --combined mutators.cfg
index 133a05aa9b3cad4156461cde227cbdc0edc5a5c6,c762ef9dec047aaa26cebd9320da67e40aad6aef..0dde22eedad304914abc1587f9726d96a8e612df
@@@ -77,6 -77,11 +77,11 @@@ set g_rocket_flying 0 "set to 1 to enab
  // =====================
  set g_spawn_near_teammate 0 "if set, players prefer spawns near a team mate"
  set g_spawn_near_teammate_distance 640 "max distance to consider a spawn to be near a team mate"
+ set g_spawn_near_teammate_ignore_spawnpoint 0 "ignore spawnpoints and spawn right at team mates"
+ set g_spawn_near_teammate_ignore_spawnpoint_delay 2.5 "how long to wait before its OK to spawn at a player after someone just spawned at this player"
+ set g_spawn_near_teammate_ignore_spawnpoint_delay_death 0 "how long to wait before its OK to spawn at a player after death"
+ set g_spawn_near_teammate_ignore_spawnpoint_check_health 1 "only allow spawn at this player if their health is full"
+ set g_spawn_near_teammate_ignore_spawnpoint_closetodeath 1 "spawn as close to death location as possible"
  
  
  // ========================
@@@ -157,9 -162,3 +162,9 @@@ set g_campcheck_interval 1
  set g_campcheck_damage 100
  set g_campcheck_distance 1800
  
 +
 +// ==========
 +//  New Toys
 +// ==========
 +set g_new_toys 0 "Mutator 'New Toys': enable extra fun guns"
 +set g_new_toys_autoreplace 2 "0: never replace, 1: always auto replace guns by available new toys, 2: randomly auto replace guns by available new toys"
diff --combined qcsrc/client/Main.qc
index 0ccb68a7f4edb2ab437815daf19bf719f1a37a97,db99e507ff7b68d86586799ca7942ac99088e360..9a3f587d322e5009be64c35c11c573329ca8caba
@@@ -121,6 -121,7 +121,6 @@@ void CSQC_Init(void
        Hook_Precache();
        GibSplash_Precache();
        Casings_Precache();
 -      DamageInfo_Precache();
        Vehicles_Precache();
        turrets_precache();
        Tuba_Precache();
  
        if(autocvar_cl_reticle)
        {
 -              if(autocvar_cl_reticle_item_normal) { precache_pic("gfx/reticle_normal"); }
 -              if(autocvar_cl_reticle_item_nex) { precache_pic("gfx/reticle_nex"); }
 +              precache_pic("gfx/reticle_normal");
 +              // weapon reticles are precached in weapon files
        }
  
        get_mi_min_max_texcoords(1); // try the CLEVER way first
@@@ -818,7 -819,8 +818,7 @@@ void CSQC_Ent_Update(float bIsNewEntity
                case ENT_CLIENT_WARPZONE_TELEPORTED: WarpZone_Teleported_Read(bIsNewEntity); break;
                case ENT_CLIENT_TRIGGER_MUSIC: Ent_ReadTriggerMusic(); break;
                case ENT_CLIENT_HOOK: Ent_ReadHook(bIsNewEntity, ENT_CLIENT_HOOK); break;
 -              case ENT_CLIENT_LGBEAM: Ent_ReadHook(bIsNewEntity, ENT_CLIENT_LGBEAM); break;
 -              case ENT_CLIENT_GAUNTLET: Ent_ReadHook(bIsNewEntity, ENT_CLIENT_GAUNTLET); break;
 +              case ENT_CLIENT_ARC_BEAM: Ent_ReadArcBeam(bIsNewEntity); break;
                case ENT_CLIENT_ACCURACY: Ent_ReadAccuracy(); break;
                case ENT_CLIENT_AUXILIARYXHAIR: Net_AuXair2(bIsNewEntity); break;
                case ENT_CLIENT_TURRET: ent_turret(); break;
@@@ -932,6 -934,7 +932,7 @@@ void Ent_ScoresInfo(
        float i;
        self.classname = "ent_client_scores_info";
        gametype = ReadInt24_t();
+       HUD_ModIcons_SetFunc();
        for(i = 0; i < MAX_SCORE; ++i)
        {
                scores_label[i] = strzone(ReadString());
@@@ -956,10 -959,14 +957,10 @@@ void Ent_Init(
        hook_shotorigin[1] = decompressShotOrigin(ReadInt24_t());
        hook_shotorigin[2] = decompressShotOrigin(ReadInt24_t());
        hook_shotorigin[3] = decompressShotOrigin(ReadInt24_t());
 -      electro_shotorigin[0] = decompressShotOrigin(ReadInt24_t());
 -      electro_shotorigin[1] = decompressShotOrigin(ReadInt24_t());
 -      electro_shotorigin[2] = decompressShotOrigin(ReadInt24_t());
 -      electro_shotorigin[3] = decompressShotOrigin(ReadInt24_t());
 -      gauntlet_shotorigin[0] = decompressShotOrigin(ReadInt24_t());
 -      gauntlet_shotorigin[1] = decompressShotOrigin(ReadInt24_t());
 -      gauntlet_shotorigin[2] = decompressShotOrigin(ReadInt24_t());
 -      gauntlet_shotorigin[3] = decompressShotOrigin(ReadInt24_t());
 +      arc_shotorigin[0] = decompressShotOrigin(ReadInt24_t());
 +      arc_shotorigin[1] = decompressShotOrigin(ReadInt24_t());
 +      arc_shotorigin[2] = decompressShotOrigin(ReadInt24_t());
 +      arc_shotorigin[3] = decompressShotOrigin(ReadInt24_t());
  
        if(forcefog)
                strunzone(forcefog);
        g_balance_electro_secondary_bouncefactor = ReadCoord();
        g_balance_electro_secondary_bouncestop = ReadCoord();
  
 -      nex_scope = !ReadByte();
 +      vortex_scope = !ReadByte();
        rifle_scope = !ReadByte();
  
        serverflags = ReadByte();
@@@ -1169,7 -1176,7 +1170,7 @@@ void Net_WeaponComplain(
  
        if(complain_weapon_name)
                strunzone(complain_weapon_name);
 -      complain_weapon_name = strzone(ReadString());
 +      complain_weapon_name = strzone(WEP_NAME(complain_weapon));
  
        complain_weapon_type = ReadByte();
  
@@@ -1213,16 -1220,16 +1214,16 @@@ float CSQC_Parse_TempEntity(
                        Net_ReadRace();
                        bHandled = true;
                        break;
 -              case TE_CSQC_NEXGUNBEAMPARTICLE:
 -                      Net_ReadNexgunBeamParticle();
 +              case TE_CSQC_VORTEXBEAMPARTICLE:
 +                      Net_ReadVortexBeamParticle();
                        bHandled = true;
                        break;
                case TE_CSQC_TEAMNAGGER:
                        Net_TeamNagger();
                        bHandled = true;
                        break;
 -              case TE_CSQC_LIGHTNINGARC:
 -                      Net_ReadLightningarc();
 +              case TE_CSQC_ARC:
 +                      Net_ReadArc();
                        bHandled = true;
                        break;
                case TE_CSQC_PINGPLREPORT:
                        cl_notice_read();
                        bHandled = true;
                        break;
 +              case TE_CSQC_SHOCKWAVEPARTICLE:
 +                      Net_ReadShockwaveParticle();
 +                      bHandled = true;
 +                      break;
                default:
                        // No special logic for this temporary entity; return 0 so the engine can handle it
                        bHandled = false;
diff --combined qcsrc/client/View.qc
index 607e35b50fb68a994aaa9207d3b2de0b4b2bbdaa,85dfe547c15518ca455ff455bdd2dfe4cade9904..d1071309404cd0b78a2440cdfb2d12963dc3ddf4
@@@ -104,7 -104,7 +104,7 @@@ vector GetCurrentFov(float fov
  
        zoomdir = button_zoom;
        if(hud == HUD_NORMAL)
 -      if((activeweapon == WEP_NEX && nex_scope) || (activeweapon == WEP_RIFLE && rifle_scope)) // do NOT use switchweapon here
 +      if((activeweapon == WEP_VORTEX && vortex_scope) || (activeweapon == WEP_RIFLE && rifle_scope)) // do NOT use switchweapon here
                zoomdir += button_attack2;
        if(spectatee_status > 0 || isdemo())
        {
@@@ -280,15 -280,15 +280,15 @@@ float TrueAimCheck(
        ta = trueaim;
        mv = MOVE_NOMONSTERS;
  
 -      switch(activeweapon)
 +      switch(activeweapon) // WEAPONTODO
        {
                case WEP_TUBA: // no aim
                case WEP_PORTO: // shoots from eye
                case WEP_HOOK: // no trueaim
 -              case WEP_GRENADE_LAUNCHER: // toss curve
 +              case WEP_MORTAR: // toss curve
                        return SHOTTYPE_HITWORLD;
 -              case WEP_NEX:
 -              case WEP_MINSTANEX:
 +              case WEP_VORTEX:
 +              case WEP_VAPORIZER:
                        mv = MOVE_NORMAL;
                        break;
                case WEP_RIFLE:
                                return EnemyHitCheck();
                        }
                        break;
 -              case WEP_ROCKET_LAUNCHER: // projectile has a size!
 +              case WEP_DEVASTATOR: // projectile has a size!
                        mi = '-3 -3 -3';
                        ma = '3 3 3';
                        break;
@@@ -365,7 -365,6 +365,7 @@@ float camera_mode
  const float CAMERA_FREE = 1;
  const float CAMERA_CHASE = 2;
  float reticle_type;
 +string reticle_image;
  string NextFrameCommand;
  void CSQC_SPIDER_HUD();
  void CSQC_RAPTOR_HUD();
@@@ -378,7 -377,7 +378,7 @@@ float pickup_crosshair_time, pickup_cro
  float hit_time, typehit_time;
  float nextsound_hit_time, nextsound_typehit_time;
  float hitindication_crosshair_time, hitindication_crosshair_size;
 -float use_nex_chargepool;
 +float use_vortex_chargepool;
  
  float myhealth, myhealth_prev;
  float myhealth_flash;
@@@ -867,64 -866,50 +867,64 @@@ void CSQC_UpdateView(float w, float h
                R_EndPolygon();
        }
  
 -      // Draw the aiming reticle for weapons that use it
 -      // reticle_type is changed to the item we are zooming / aiming with, to decide which reticle to use
 -      // It must be a persisted float for fading out to work properly (you let go of the zoom button for
 -      // the view to go back to normal, so reticle_type would become 0 as we fade out)
 -      if(spectatee_status || is_dead || hud != HUD_NORMAL)
 -              reticle_type = 0; // prevent reticle from showing during the respawn zoom effect or for spectators
 -      else if((activeweapon == WEP_NEX || activeweapon == WEP_RIFLE || activeweapon == WEP_MINSTANEX) && (button_zoom || zoomscript_caught))
 -              reticle_type = 2; // nex zoom
 -      else if(button_zoom || zoomscript_caught)
 -              reticle_type = 1; // normal zoom
 -      else if((activeweapon == WEP_NEX) && button_attack2)
 -              reticle_type = 2; // nex zoom
 -
 -      if(reticle_type && autocvar_cl_reticle)
 +      if(autocvar_cl_reticle)
        {
 -              if(autocvar_cl_reticle_stretch)
 +              // Draw the aiming reticle for weapons that use it
 +              // reticle_type is changed to the item we are zooming / aiming with, to decide which reticle to use
 +              // It must be a persisted float for fading out to work properly (you let go of the zoom button for
 +              // the view to go back to normal, so reticle_type would become 0 as we fade out)
 +              if(spectatee_status || is_dead || hud != HUD_NORMAL)
                {
 -                      reticle_size_x = vid_conwidth;
 -                      reticle_size_y = vid_conheight;
 -                      reticle_pos_x = 0;
 -                      reticle_pos_y = 0;
 +                      // no zoom reticle while dead
 +                      reticle_type = 0;
                }
 -              else
 +              else if(WEP_ACTION(activeweapon, WR_ZOOMRETICLE) && autocvar_cl_reticle_weapon)
                {
 -                      reticle_size_x = max(vid_conwidth, vid_conheight);
 -                      reticle_size_y = max(vid_conwidth, vid_conheight);
 -                      reticle_pos_x = (vid_conwidth - reticle_size_x) / 2;
 -                      reticle_pos_y = (vid_conheight - reticle_size_y) / 2;
 +                      if(reticle_image != "") { reticle_type = 2; }
 +                      else { reticle_type = 0; }
                }
 -
 -              f = current_zoomfraction;
 -              if(zoomscript_caught)
 -                      f = 1;
 -              if(autocvar_cl_reticle_item_normal)
 +              else if(button_zoom || zoomscript_caught)
                {
 -                      if(reticle_type == 1 && f)
 -                              drawpic(reticle_pos, "gfx/reticle_normal", reticle_size, '1 1 1', f * autocvar_cl_reticle_item_normal, DRAWFLAG_NORMAL);
 +                      // normal zoom
 +                      reticle_type = 1;
                }
 -              if(autocvar_cl_reticle_item_nex)
 +
 +              if(reticle_type)
                {
 -                      if(reticle_type == 2 && f)
 -                              drawpic(reticle_pos, "gfx/reticle_nex", reticle_size, '1 1 1', f * autocvar_cl_reticle_item_nex, DRAWFLAG_NORMAL);
 +                      if(autocvar_cl_reticle_stretch)
 +                      {
 +                              reticle_size_x = vid_conwidth;
 +                              reticle_size_y = vid_conheight;
 +                              reticle_pos_x = 0;
 +                              reticle_pos_y = 0;
 +                      }
 +                      else
 +                      {
 +                              reticle_size_x = max(vid_conwidth, vid_conheight);
 +                              reticle_size_y = max(vid_conwidth, vid_conheight);
 +                              reticle_pos_x = (vid_conwidth - reticle_size_x) / 2;
 +                              reticle_pos_y = (vid_conheight - reticle_size_y) / 2;
 +                      }
 +
 +                      if(zoomscript_caught)
 +                              f = 1;
 +                      else 
 +                              f = current_zoomfraction;
 +
 +                      if(f)
 +                      {
 +                              switch(reticle_type)
 +                              {
 +                                      case 1: drawpic(reticle_pos, "gfx/reticle_normal", reticle_size, '1 1 1', f * autocvar_cl_reticle_normal_alpha, DRAWFLAG_NORMAL); break;
 +                                      case 2: drawpic(reticle_pos, reticle_image, reticle_size, '1 1 1', f * autocvar_cl_reticle_weapon_alpha, DRAWFLAG_NORMAL); break;
 +                              }
 +                      }
                }
        }
 +      else
 +      {
 +              if(reticle_type != 0) { reticle_type = 0; }
 +      }
  
  
        // improved polyblend
                                shottype = SHOTTYPE_HITWORLD;
  
                        vector wcross_color = '0 0 0', wcross_size = '0 0 0';
 -                      string wcross_wep = "", wcross_name;
 +                      string wcross_name = "";
                        float wcross_scale, wcross_blur;
  
 -                      if (autocvar_crosshair_per_weapon || (autocvar_crosshair_color_special == 1))
 +                      if(autocvar_crosshair_per_weapon || (autocvar_crosshair_color_special == 1))
                        {
                                e = get_weaponinfo(switchingweapon);
 -                              if (e && e.netname != "")
 +                              if(e)
                                {
 -                                      wcross_wep = e.netname;
                                        if(autocvar_crosshair_per_weapon)
                                        {
 -                                              wcross_resolution *= cvar(strcat("crosshair_", wcross_wep, "_size"));
 -                                              if (wcross_resolution == 0)
 -                                                      return;
 -                                              wcross_alpha *= cvar(strcat("crosshair_", wcross_wep, "_alpha"));
 -                                              if (wcross_alpha == 0)
 -                                                      return;
 -
 -                                              wcross_style = cvar_string(strcat("crosshair_", wcross_wep));
 -                                              if(wcross_style == "" || wcross_style == "0")
 -                                                      wcross_style = wcross_wep;
 +                                              // WEAPONTODO: access these through some general settings (with non-balance config settings)
 +                                              //wcross_resolution *= cvar(strcat("crosshair_", wcross_wep, "_size"));
 +                                              //if (wcross_resolution == 0)
 +                                                      //return;
 +
 +                                              //wcross_style = cvar_string(strcat("crosshair_", wcross_wep));
 +                                              wcross_resolution *= e.w_crosshair_size;
 +                                              wcross_name = e.w_crosshair;
                                        }
                                }
                        }
  
 -                      //printf("crosshair style: %s\n", wcross_style);
 -                      wcross_name = strcat("gfx/crosshair", wcross_style);
 +                      if(wcross_name == "")
 +                              wcross_name = strcat("gfx/crosshair", wcross_style);
  
                        // MAIN CROSSHAIR COLOR DECISION
                        switch(autocvar_crosshair_color_special)
                        {
                                case 1: // crosshair_color_per_weapon
                                {
 -                                      if(wcross_wep != "")
 +                                      if(e)
                                        {
 -                                              wcross_color = stov(cvar_string(sprintf("crosshair_%s_color", wcross_wep)));
 +                                              wcross_color = e.wpcolor;
                                                break;
                                        }
                                        else { goto normalcolor; }
                                        weapon_clipload = getstati(STAT_WEAPON_CLIPLOAD);
                                        weapon_clipsize = getstati(STAT_WEAPON_CLIPSIZE);
  
 -                                      float nex_charge, nex_chargepool;
 -                                      nex_charge = getstatf(STAT_NEX_CHARGE);
 -                                      nex_chargepool = getstatf(STAT_NEX_CHARGEPOOL);
 +                                      float vortex_charge, vortex_chargepool;
 +                                      vortex_charge = getstatf(STAT_VORTEX_CHARGE);
 +                                      vortex_chargepool = getstatf(STAT_VORTEX_CHARGEPOOL);
  
 -                                      if(nex_charge_movingavg == 0) // this should only happen if we have just loaded up the game
 -                                              nex_charge_movingavg = nex_charge;
 +                                      if(vortex_charge_movingavg == 0) // this should only happen if we have just loaded up the game
 +                                              vortex_charge_movingavg = vortex_charge;
  
  
                                        // handle the values
 -                                      if (autocvar_crosshair_ring && activeweapon == WEP_NEX && nex_charge && autocvar_crosshair_ring_nex) // ring around crosshair representing velocity-dependent damage for the nex
 +                                      if (autocvar_crosshair_ring && activeweapon == WEP_VORTEX && vortex_charge && autocvar_crosshair_ring_vortex) // ring around crosshair representing velocity-dependent damage for the vortex
                                        {
 -                                              if (nex_chargepool || use_nex_chargepool) {
 -                                                      use_nex_chargepool = 1;
 -                                                      ring_inner_value = nex_chargepool;
 +                                              if (vortex_chargepool || use_vortex_chargepool) {
 +                                                      use_vortex_chargepool = 1;
 +                                                      ring_inner_value = vortex_chargepool;
                                                } else {
 -                                                      nex_charge_movingavg = (1 - autocvar_crosshair_ring_nex_currentcharge_movingavg_rate) * nex_charge_movingavg + autocvar_crosshair_ring_nex_currentcharge_movingavg_rate * nex_charge;
 -                                                      ring_inner_value = bound(0, autocvar_crosshair_ring_nex_currentcharge_scale * (nex_charge - nex_charge_movingavg), 1);
 +                                                      vortex_charge_movingavg = (1 - autocvar_crosshair_ring_vortex_currentcharge_movingavg_rate) * vortex_charge_movingavg + autocvar_crosshair_ring_vortex_currentcharge_movingavg_rate * vortex_charge;
 +                                                      ring_inner_value = bound(0, autocvar_crosshair_ring_vortex_currentcharge_scale * (vortex_charge - vortex_charge_movingavg), 1);
                                                }
  
 -                                              ring_inner_alpha = autocvar_crosshair_ring_nex_inner_alpha;
 -                                              ring_inner_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;
 +                                              ring_inner_alpha = autocvar_crosshair_ring_vortex_inner_alpha;
 +                                              ring_inner_rgb = eX * autocvar_crosshair_ring_vortex_inner_color_red + eY * autocvar_crosshair_ring_vortex_inner_color_green + eZ * autocvar_crosshair_ring_vortex_inner_color_blue;
                                                ring_inner_image = "gfx/crosshair_ring_inner.tga";
  
                                                // draw the outer ring to show the current charge of the weapon
 -                                              ring_value = nex_charge;
 -                                              ring_alpha = autocvar_crosshair_ring_nex_alpha;
 +                                              ring_value = vortex_charge;
 +                                              ring_alpha = autocvar_crosshair_ring_vortex_alpha;
                                                ring_rgb = wcross_color;
                                                ring_image = "gfx/crosshair_ring_nexgun.tga";
                                        }
@@@ -1672,32 -1660,16 +1672,16 @@@ void CSQC_common_hud(void
        if(!(gametype == MAPINFO_TYPE_RACE || gametype == MAPINFO_TYPE_CTS))
                Accuracy_LoadLevels();
  
-     HUD_Main(); // always run these functions for alpha checks
-     HUD_DrawScoreboard();
+       HUD_Main(); // always run these functions for alpha checks
+       HUD_DrawScoreboard();
  
-     if (scoreboard_active) // scoreboard/accuracy
-         HUD_Reset();
-     else if (intermission == 2) // map voting screen
-     {
-         HUD_FinaleOverlay();
-         HUD_Reset();
-     }
-       /*
-       switch(hud)
+       if (scoreboard_active) // scoreboard/accuracy
+               HUD_Reset();
+       else if (intermission == 2) // map voting screen
        {
-               case HUD_SPIDERBOT:
-                       CSQC_SPIDER_HUD();
-                       break;
-               case HUD_WAKIZASHI:
-                       CSQC_WAKIZASHI_HUD();
-                       break;
-         case HUD_BUMBLEBEE:
-             CSQC_BUMBLE_HUD();
-             break;
+               MapVote_Draw();
+               HUD_Reset();
        }
-       */
  }
  
  
index 22a609960811244e94d29d2e8bea8415d0171dcf,5ba321ae17d89456f3411c36eff91d8144fcdf65..806cd22ce5a8082891074f0513116e94f965e3ed
@@@ -62,9 -62,8 +62,9 @@@ float autocvar_cl_particles_quality
  float autocvar_cl_projectiles_sloppy;
  float autocvar_cl_readpicture_force;
  var float autocvar_cl_reticle = 1;
 -float autocvar_cl_reticle_item_nex;
 -float autocvar_cl_reticle_item_normal;
 +var float autocvar_cl_reticle_normal_alpha = 1;
 +var float autocvar_cl_reticle_weapon = 1;
 +var float autocvar_cl_reticle_weapon_alpha = 1;
  float autocvar_cl_reticle_stretch;
  float autocvar_cl_spawn_event_particles;
  var float autocvar_cl_spawn_event_sound = 1;
@@@ -126,14 -125,14 +126,14 @@@ float autocvar_crosshair_ring_minelayer
  float autocvar_crosshair_ring_minelayer_alpha;
  float autocvar_crosshair_ring_hagar;
  float autocvar_crosshair_ring_hagar_alpha;
 -float autocvar_crosshair_ring_nex;
 -float autocvar_crosshair_ring_nex_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_vortex;
 +float autocvar_crosshair_ring_vortex_alpha;
 +float autocvar_crosshair_ring_vortex_currentcharge_movingavg_rate;
 +float autocvar_crosshair_ring_vortex_currentcharge_scale;
 +float autocvar_crosshair_ring_vortex_inner_alpha;
 +float autocvar_crosshair_ring_vortex_inner_color_blue;
 +float autocvar_crosshair_ring_vortex_inner_color_green;
 +float autocvar_crosshair_ring_vortex_inner_color_red;
  float autocvar_crosshair_ring_size;
  float autocvar_crosshair_ring_reload;
  float autocvar_crosshair_ring_reload_alpha;
@@@ -342,7 -341,17 +342,17 @@@ float autocvar_hud_panel_weapons_timeou
  float autocvar_hud_panel_weapons_timeout_fadefgmin;
  var float autocvar_hud_panel_weapons_timeout_speed_in = 0.25;
  var float autocvar_hud_panel_weapons_timeout_speed_out = 0.75;
+ vector autocvar_hud_progressbar_acceleration_color;
+ vector autocvar_hud_progressbar_acceleration_neg_color;
  float autocvar_hud_progressbar_alpha;
+ vector autocvar_hud_progressbar_armor_color;
+ vector autocvar_hud_progressbar_fuel_color;
+ vector autocvar_hud_progressbar_health_color;
+ vector autocvar_hud_progressbar_nexball_color;
+ vector autocvar_hud_progressbar_shield_color;
+ vector autocvar_hud_progressbar_speed_color;
+ vector autocvar_hud_progressbar_strength_color;
+ vector autocvar_hud_progressbar_superweapons_color;
  float autocvar_hud_showbinds;
  float autocvar_hud_showbinds_limit;
  float autocvar__hud_showbinds_reload;
diff --combined qcsrc/client/hud.qc
index 41805d18edfa57cd195790ef9afbe52aa6c04809,bb5eb4a68f534081953aa7d860c69602659d7fa3..a6d06d783bf745474c51d9e9c28e116e27d87a13
@@@ -264,8 -264,8 +264,8 @@@ HUD panel
  
  // draw the background/borders
  #define HUD_Panel_DrawBg(theAlpha)\
- if(panel_bg != "0" && panel_bg != "")\
-       draw_BorderPicture(panel_pos - '1 1 0' * panel_bg_border, panel_bg, panel_size + '1 1 0' * 2 * panel_bg_border, panel_bg_color, panel_bg_alpha * theAlpha, '1 1 0' * (panel_bg_border/BORDER_MULTIPLIER))
+ if(panel.current_panel_bg != "0" && panel.current_panel_bg != "")\
+       draw_BorderPicture(panel_pos - '1 1 0' * panel_bg_border, panel.current_panel_bg, panel_size + '1 1 0' * 2 * panel_bg_border, panel_bg_color, panel_bg_alpha * theAlpha, '1 1 0' * (panel_bg_border/BORDER_MULTIPLIER))
  
  //basically the same code of draw_ButtonPicture and draw_VertButtonPicture for the menu
  void HUD_Panel_DrawProgressBar(vector theOrigin, vector theSize, string pic, float length_ratio, float vertical, float baralign, vector theColor, float theAlpha, float drawflag)
@@@ -408,6 -408,42 +408,6 @@@ float weaponorder_cmp(float i, float j
        return aj - ai; // the string is in REVERSE order (higher prio at the right is what we want, but higher prio first is the string)
  }
  
 -float GetAmmoStat(float i)
 -{
 -      switch(i)
 -      {
 -              case 0: return STAT_SHELLS;
 -              case 1: return STAT_NAILS;
 -              case 2: return STAT_ROCKETS;
 -              case 3: return STAT_CELLS;
 -              case 4: return STAT_FUEL;
 -              default: return -1;
 -      }
 -}
 -
 -float GetAmmoTypeForWep(float i)
 -{
 -      switch(i)
 -      {
 -              case WEP_SHOTGUN: return 0;
 -              case WEP_UZI: return 1;
 -              case WEP_GRENADE_LAUNCHER: return 2;
 -              case WEP_MINE_LAYER: return 2;
 -              case WEP_ELECTRO: return 3;
 -              case WEP_CRYLINK: return 3;
 -              case WEP_HLAC: return 3;
 -              case WEP_MINSTANEX: return 3;
 -              case WEP_NEX: return 3;
 -              case WEP_RIFLE: return 1;
 -              case WEP_HAGAR: return 2;
 -              case WEP_ROCKET_LAUNCHER: return 2;
 -              case WEP_SEEKER: return 2;
 -              case WEP_FIREBALL: return 4;
 -              case WEP_HOOK: return 3;
 -              default: return -1;
 -      }
 -}
 -
  void HUD_Weapons(void)
  {
        // declarations
        float timein_effect_length = autocvar_hud_panel_weapons_timeout_speed_in; //? 0.375 : 0);
        float timeout_effect_length = autocvar_hud_panel_weapons_timeout_speed_out; //? 0.75 : 0);
  
 -      float ammo_type, ammo_full;
 +      float ammo_full;
        float barsize_x = 0, barsize_y = 0, baroffset_x = 0, baroffset_y = 0;
        vector ammo_color = '1 0 1';
        float ammo_alpha = 1;
  
        // update generic hud functions
        HUD_Panel_UpdateCvars();
-       HUD_Panel_ApplyFadeAlpha();
  
        draw_beginBoldFont();
  
                weapon_size_y = old_panel_size_y / rows;
  
                // change table values to include only the owned weapons
-               // weapon_size won't be changed
+               float columns_save = columns;
                if(weapon_count <= rows)
                {
                        rows = weapon_count;
                else
                        columns = ceil(weapon_count / rows);
  
+               // enlarge weapon_size to match desired aspect ratio in order to capitalize on panel space
+               if(columns < columns_save)
+                       weapon_size_x = min(old_panel_size_x / columns, aspect * weapon_size_y);
                // reduce size of the panel
                panel_size_x = columns * weapon_size_x;
                panel_size_y = rows * weapon_size_y;
                if(weapons_stat & WepSet_FromWeapon(self.weapon))
                {
                        // draw the weapon image
 -                      drawpic_aspect_skin(weapon_pos, strcat("weapon", self.netname), weapon_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
 +                      drawpic_aspect_skin(weapon_pos, self.model2, weapon_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
  
                        // draw weapon label string
                        switch(autocvar_hud_panel_weapons_label)
                                        break;
  
                                case 3: // weapon name
 -                                      drawstring(weapon_pos, self.netname, '1 1 0' * 0.5 * weapon_size_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
 +                                      drawstring(weapon_pos, strtolower(self.message), '1 1 0' * 0.5 * weapon_size_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
                                        break;
  
                                default: // nothing
                        }
  
                        // draw ammo status bar
 -                      if(autocvar_hud_panel_weapons_ammo && self.weapon != WEP_TUBA && self.weapon != WEP_LASER && self.weapon != WEP_PORTO)
 +                      if(autocvar_hud_panel_weapons_ammo && (self.ammo_field != ammo_none))
                        {
 -                              a = 0;
 -                              ammo_type = GetAmmoTypeForWep(self.weapon);
 -                              if(ammo_type != -1)
 -                                      a = getstati(GetAmmoStat(ammo_type)); // how much ammo do we have?
 +                              a = getstati(GetAmmoStat(self.ammo_field)); // how much ammo do we have?
  
                                if(a > 0)
                                {
 -                                      switch(ammo_type) {
 -                                              case 0: ammo_full = autocvar_hud_panel_weapons_ammo_full_shells; break;
 -                                              case 1: ammo_full = autocvar_hud_panel_weapons_ammo_full_nails; break;
 -                                              case 2: ammo_full = autocvar_hud_panel_weapons_ammo_full_rockets; break;
 -                                              case 3: ammo_full = autocvar_hud_panel_weapons_ammo_full_cells; break;
 -                                              case 4: ammo_full = autocvar_hud_panel_weapons_ammo_full_fuel; break;
 +                                      switch(self.ammo_field)
 +                                      {
 +                                              case ammo_shells:  ammo_full = autocvar_hud_panel_weapons_ammo_full_shells;  break;
 +                                              case ammo_nails:   ammo_full = autocvar_hud_panel_weapons_ammo_full_nails;   break;
 +                                              case ammo_rockets: ammo_full = autocvar_hud_panel_weapons_ammo_full_rockets; break;
 +                                              case ammo_cells:   ammo_full = autocvar_hud_panel_weapons_ammo_full_cells;   break;
 +                                              case ammo_fuel:    ammo_full = autocvar_hud_panel_weapons_ammo_full_fuel;    break;
                                                default: ammo_full = 60;
                                        }
  
                                                weapon_pos_x + baroffset_x,
                                                weapon_pos_y + baroffset_y,
                                                barsize_x * bound(0, a/ammo_full, 1),
 -                                              barsize_y);
 -                                      drawpic_aspect_skin(weapon_pos, "weapon_ammo", weapon_size, ammo_color, ammo_alpha, DRAWFLAG_NORMAL);
 +                                              barsize_y
 +                                      );
 +
 +                                      drawpic_aspect_skin(
 +                                              weapon_pos,
 +                                              "weapon_ammo",
 +                                              weapon_size,
 +                                              ammo_color,
 +                                              ammo_alpha,
 +                                              DRAWFLAG_NORMAL
 +                                      );
 +
                                        drawresetcliparea();
                                }
                        }
                }
                else // draw a "ghost weapon icon" if you don't have the weapon
                {
 -                      drawpic_aspect_skin(weapon_pos, strcat("weapon", self.netname), weapon_size, '0 0 0', panel_fg_alpha * 0.5, DRAWFLAG_NORMAL);
 +                      drawpic_aspect_skin(weapon_pos, self.model2, weapon_size, '0 0 0', panel_fg_alpha * 0.5, DRAWFLAG_NORMAL);
                }
  
                // draw the complain message
  }
  
  // Ammo (#1)
 -//
 -// TODO: macro
 -float GetAmmoItemCode(float i)
 +void DrawAmmoItem(vector myPos, vector mySize, .float ammotype, float currently_selected, float infinite_ammo)
  {
 -      switch(i)
 +      float a = 0;
 +      if(ammotype != ammo_none)
        {
 -              case 0: return IT_SHELLS;
 -              case 1: return IT_NAILS;
 -              case 2: return IT_ROCKETS;
 -              case 3: return IT_CELLS;
 -              case 4: return IT_FUEL;
 -              default: return -1;
 -      }
 -}
 -
 -string GetAmmoPicture(float i)
 -{
 -      switch(i)
 -      {
 -              case 0: return "ammo_shells";
 -              case 1: return "ammo_bullets";
 -              case 2: return "ammo_rockets";
 -              case 3: return "ammo_cells";
 -              case 4: return "ammo_fuel";
 -              default: return "";
 +              if(autocvar__hud_configure)
 +              {
 +                      currently_selected = (ammotype == ammo_rockets); //rockets always selected
 +                      a = 60;
 +              }
 +              else
 +              {
 +                      // how much ammo do we have of this ammotype?
 +                      a = getstati(GetAmmoStat(ammotype));
 +              }
        }
 -}
 -
 -void DrawAmmoItem(vector myPos, vector mySize, float itemcode, float currently_selected, float infinite_ammo)
 -{
 -      float a;
 -      if(autocvar__hud_configure)
 +      else
        {
 -              currently_selected = (itemcode == 2); //rockets always selected
 -              a = 31 + mod(itemcode*93, 128);
 +              #if 0
 +              infinite_ammo = TRUE;
 +              #else
 +              return; // just don't draw infinite ammo at all.
 +              #endif
        }
 -      else
 -              a = getstati(GetAmmoStat(itemcode)); // how much ammo do we have of type itemcode?
  
        vector color;
        if(infinite_ammo)
                picpos = myPos;
        }
  
 -      if (currently_selected)
 +      if(currently_selected)
                drawpic_aspect_skin(myPos, "ammo_current_bg", mySize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
  
      if(a > 0 && autocvar_hud_panel_ammo_progressbar)
              drawstring_aspect(numpos, ftos(a), eX * (2/3) * mySize_x + eY * mySize_y, '0 0 0', panel_fg_alpha * theAlpha * 0.5, DRAWFLAG_NORMAL);
      }
        if(a > 0 || infinite_ammo)
 -              drawpic_aspect_skin(picpos, GetAmmoPicture(itemcode), '1 1 0' * mySize_y, '1 1 1', panel_fg_alpha * theAlpha, DRAWFLAG_NORMAL);
 +              drawpic_aspect_skin(picpos, GetAmmoPicture(ammotype), '1 1 0' * mySize_y, '1 1 1', panel_fg_alpha * theAlpha, DRAWFLAG_NORMAL);
        else // "ghost" ammo icon
 -              drawpic_aspect_skin(picpos, GetAmmoPicture(itemcode), '1 1 0' * mySize_y, '0 0 0', panel_fg_alpha * theAlpha * 0.5, DRAWFLAG_NORMAL);
 +              drawpic_aspect_skin(picpos, GetAmmoPicture(ammotype), '1 1 0' * mySize_y, '0 0 0', panel_fg_alpha * theAlpha * 0.5, DRAWFLAG_NORMAL);
  }
  
  void HUD_Ammo(void)
  {
-     if(hud != HUD_NORMAL) return;
+       if(hud != HUD_NORMAL) return;
        if(!autocvar__hud_configure)
        {
                if(!autocvar_hud_panel_ammo) return;
        }
  
        HUD_Panel_UpdateCvars();
-       HUD_Panel_ApplyFadeAlpha();
  
        draw_beginBoldFont();
  
                mySize -= '2 2 0' * panel_bg_padding;
        }
  
+       const float AMMO_COUNT = 4;
        float rows = 0, columns, row, column;
        vector ammo_size;
 -      if (autocvar_hud_panel_ammo_onlycurrent)
 +      if(autocvar_hud_panel_ammo_onlycurrent)
                ammo_size = mySize;
        else
        {
                ammo_size_y = newSize;
        }
  
 -      float i, stat_items, currently_selected, infinite_ammo;
 -      infinite_ammo = FALSE;
 -      if (autocvar_hud_panel_ammo_onlycurrent)
 +      float i;
 +      float infinite_ammo = (getstati(STAT_ITEMS, 0, 24) & IT_UNLIMITED_WEAPON_AMMO);
 +      if(autocvar_hud_panel_ammo_onlycurrent)
        {
                if(autocvar__hud_configure)
                {
 -                      DrawAmmoItem(pos, ammo_size, 2, true, FALSE); //show rockets
 +                      DrawAmmoItem(pos, ammo_size, ammo_rockets, TRUE, FALSE);
                }
                else
                {
 -                      stat_items = getstati(STAT_ITEMS, 0, 24);
 -                      if (stat_items & IT_UNLIMITED_WEAPON_AMMO)
 -                              infinite_ammo = TRUE;
 -                      for (i = 0; i < AMMO_COUNT; ++i) {
 -                              currently_selected = stat_items & GetAmmoItemCode(i);
 -                              if (currently_selected)
 -                              {
 -                                      DrawAmmoItem(pos, ammo_size, i, true, infinite_ammo);
 -                                      break;
 -                              }
 -                      }
 +                      DrawAmmoItem(
 +                              pos,
 +                              ammo_size,
 +                              (get_weaponinfo(switchweapon)).ammo_field,
 +                              TRUE,
 +                              infinite_ammo
 +                      );
                }
        }
        else
        {
 -              stat_items = getstati(STAT_ITEMS, 0, 24);
 -              if (stat_items & IT_UNLIMITED_WEAPON_AMMO)
 -                      infinite_ammo = TRUE;
 +              .float ammotype;
                row = column = 0;
 -              for (i = 0; i < AMMO_COUNT; ++i) {
 -                      currently_selected = stat_items & GetAmmoItemCode(i);
 -                      DrawAmmoItem(pos + eX * column * (ammo_size_x + offset_x) + eY * row * (ammo_size_y + offset_y), ammo_size, i, currently_selected, infinite_ammo);
 +              for(i = 0; i < AMMO_COUNT; ++i)
 +              {
 +                      ammotype = GetAmmoFieldFromNum(i);
 +                      DrawAmmoItem(
 +                              pos + eX * column * (ammo_size_x + offset_x) + eY * row * (ammo_size_y + offset_y),
 +                              ammo_size,
 +                              ammotype,
 +                              ((get_weaponinfo(switchweapon)).ammo_field == ammotype),
 +                              infinite_ammo
 +                      );
 +
                        ++row;
                        if(row >= rows)
                        {
@@@ -1115,7 -1158,6 +1118,6 @@@ void HUD_Powerups(void
        }
  
        HUD_Panel_UpdateCvars();
-       HUD_Panel_ApplyFadeAlpha();
  
        draw_beginBoldFont();
  
                const float maxshield = 30;
                float shield = ceil(shield_time);
                if(autocvar_hud_panel_powerups_progressbar)
-               {
-                       HUD_Panel_GetProgressBarColor(shield);
-                       HUD_Panel_DrawProgressBar(pos + shield_offset, mySize, autocvar_hud_panel_powerups_progressbar_shield, shield/maxshield, is_vertical, shield_baralign, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
-               }
+                       HUD_Panel_DrawProgressBar(pos + shield_offset, mySize, autocvar_hud_panel_powerups_progressbar_shield, shield/maxshield, is_vertical, shield_baralign, autocvar_hud_progressbar_shield_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
                if(autocvar_hud_panel_powerups_text)
                {
                        if(shield > 1)
                const float maxstrength = 30;
                float strength = ceil(strength_time);
                if(autocvar_hud_panel_powerups_progressbar)
-               {
-                       HUD_Panel_GetProgressBarColor(strength);
-                       HUD_Panel_DrawProgressBar(pos + strength_offset, mySize, autocvar_hud_panel_powerups_progressbar_strength, strength/maxstrength, is_vertical, strength_baralign, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
-               }
+                       HUD_Panel_DrawProgressBar(pos + strength_offset, mySize, autocvar_hud_panel_powerups_progressbar_strength, strength/maxstrength, is_vertical, strength_baralign, autocvar_hud_progressbar_strength_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
                if(autocvar_hud_panel_powerups_text)
                {
                        if(strength > 1)
                const float maxsuperweapons = 30;
                float superweapons = ceil(superweapons_time);
                if(autocvar_hud_panel_powerups_progressbar)
-               {
-                       HUD_Panel_GetProgressBarColor(superweapons);
-                       HUD_Panel_DrawProgressBar(pos + superweapons_offset, mySize, autocvar_hud_panel_powerups_progressbar_superweapons, superweapons/maxsuperweapons, is_vertical, superweapons_baralign, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
-               }
+                       HUD_Panel_DrawProgressBar(pos + superweapons_offset, mySize, autocvar_hud_panel_powerups_progressbar_superweapons, superweapons/maxsuperweapons, is_vertical, superweapons_baralign, autocvar_hud_progressbar_superweapons_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
                if(autocvar_hud_panel_powerups_text)
                {
                        if(superweapons > 1)
@@@ -1356,7 -1389,6 +1349,6 @@@ void HUD_HealthArmor(void
        }
  
        HUD_Panel_UpdateCvars();
-       HUD_Panel_ApplyFadeAlpha();
        vector pos, mySize;
        pos = panel_pos;
        mySize = panel_size;
                {
                        biggercount = "health";
                        if(autocvar_hud_panel_healtharmor_progressbar)
-                       {
-                               HUD_Panel_GetProgressBarColor(health);
-                               HUD_Panel_DrawProgressBar(pos, mySize, autocvar_hud_panel_healtharmor_progressbar_health, x/maxtotal, 0, (baralign == 1 || baralign == 2), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
-                       }
+                               HUD_Panel_DrawProgressBar(pos, mySize, autocvar_hud_panel_healtharmor_progressbar_health, x/maxtotal, 0, (baralign == 1 || baralign == 2), autocvar_hud_progressbar_health_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
                        if(armor)
              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);
                {
                        biggercount = "armor";
                        if(autocvar_hud_panel_healtharmor_progressbar)
-                       {
-                               HUD_Panel_GetProgressBarColor(armor);
-                               HUD_Panel_DrawProgressBar(pos, mySize, autocvar_hud_panel_healtharmor_progressbar_armor, x/maxtotal, 0, (baralign == 1 || baralign == 2), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
-                       }
+                               HUD_Panel_DrawProgressBar(pos, mySize, autocvar_hud_panel_healtharmor_progressbar_armor, x/maxtotal, 0, (baralign == 1 || baralign == 2), autocvar_hud_progressbar_armor_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
                        if(health)
              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);
                        DrawNumIcon(pos, mySize, x, biggercount, 0, iconalign, HUD_Get_Num_Color(x, maxtotal), 1);
  
                if(fuel)
-               {
-                       HUD_Panel_GetProgressBarColor(fuel);
-                       HUD_Panel_DrawProgressBar(pos, eX * mySize_x + eY * 0.2 * mySize_y, "progressbar", fuel/100, 0, (baralign == 1 || baralign == 3), progressbar_color, panel_fg_alpha * 0.8, DRAWFLAG_NORMAL);
-               }
+                       HUD_Panel_DrawProgressBar(pos, eX * mySize_x + eY * 0.2 * mySize_y, "progressbar", fuel/100, 0, (baralign == 1 || baralign == 3), autocvar_hud_progressbar_fuel_color, panel_fg_alpha * 0.8, DRAWFLAG_NORMAL);
        }
        else
        {
                {
                        if(autocvar_hud_panel_healtharmor_progressbar)
                        {
-                               HUD_Panel_GetProgressBarColor(health);
                                float p_health, pain_health_alpha;
                                p_health = health;
                                pain_health_alpha = 1;
                                                if (time - health_damagetime < 1)
                                                {
                                                        float health_damagealpha = 1 - (time - health_damagetime)*(time - health_damagetime);
-                                                       HUD_Panel_DrawProgressBar(pos + health_offset, mySize, autocvar_hud_panel_healtharmor_progressbar_health, health_beforedamage/maxhealth, is_vertical, health_baralign, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * health_damagealpha, DRAWFLAG_NORMAL);
+                                                       HUD_Panel_DrawProgressBar(pos + health_offset, mySize, autocvar_hud_panel_healtharmor_progressbar_health, health_beforedamage/maxhealth, is_vertical, health_baralign, autocvar_hud_progressbar_health_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * health_damagealpha, DRAWFLAG_NORMAL);
                                                }
                                        }
                                        prev_health = health;
                                                pain_health_alpha = BLINK_BASE + BLINK_FACTOR * cos(time * BLINK_FREQ);
                                        }
                                }
-                               HUD_Panel_DrawProgressBar(pos + health_offset, mySize, autocvar_hud_panel_healtharmor_progressbar_health, p_health/maxhealth, is_vertical, health_baralign, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * pain_health_alpha, DRAWFLAG_NORMAL);
+                               HUD_Panel_DrawProgressBar(pos + health_offset, mySize, autocvar_hud_panel_healtharmor_progressbar_health, p_health/maxhealth, is_vertical, health_baralign, autocvar_hud_progressbar_health_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * pain_health_alpha, DRAWFLAG_NORMAL);
                        }
                        if(autocvar_hud_panel_healtharmor_text)
                                DrawNumIcon(pos + health_offset, mySize, health, "health", is_vertical, health_iconalign, HUD_Get_Num_Color(health, maxhealth), 1);
                {
                        if(autocvar_hud_panel_healtharmor_progressbar)
                        {
-                               HUD_Panel_GetProgressBarColor(armor);
                                float p_armor;
                                p_armor = armor;
                                if (autocvar_hud_panel_healtharmor_progressbar_gfx)
                                                if (time - armor_damagetime < 1)
                                                {
                                                        float armor_damagealpha = 1 - (time - armor_damagetime)*(time - armor_damagetime);
-                                                       HUD_Panel_DrawProgressBar(pos + armor_offset, mySize, autocvar_hud_panel_healtharmor_progressbar_armor, armor_beforedamage/maxarmor, is_vertical, armor_baralign, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * armor_damagealpha, DRAWFLAG_NORMAL);
+                                                       HUD_Panel_DrawProgressBar(pos + armor_offset, mySize, autocvar_hud_panel_healtharmor_progressbar_armor, armor_beforedamage/maxarmor, is_vertical, armor_baralign, autocvar_hud_progressbar_armor_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * armor_damagealpha, DRAWFLAG_NORMAL);
                                                }
                                        }
                                        prev_armor = armor;
                                }
-                               HUD_Panel_DrawProgressBar(pos + armor_offset, mySize, autocvar_hud_panel_healtharmor_progressbar_armor, p_armor/maxarmor, is_vertical, armor_baralign, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+                               HUD_Panel_DrawProgressBar(pos + armor_offset, mySize, autocvar_hud_panel_healtharmor_progressbar_armor, p_armor/maxarmor, is_vertical, armor_baralign, autocvar_hud_progressbar_armor_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
                        }
                        if(autocvar_hud_panel_healtharmor_text)
                                DrawNumIcon(pos + armor_offset, mySize, armor, "armor", is_vertical, armor_iconalign, HUD_Get_Num_Color(armor, maxarmor), 1);
                                mySize_x *= 2; //restore full panel size
                        else if (panel_ar < 1/4)
                                mySize_y *= 2; //restore full panel size
-                       HUD_Panel_GetProgressBarColor(fuel);
-                       HUD_Panel_DrawProgressBar(pos, mySize, "progressbar", fuel/100, is_vertical, fuel_baralign, progressbar_color, panel_fg_alpha * 0.8, DRAWFLAG_NORMAL);
+                       HUD_Panel_DrawProgressBar(pos, mySize, "progressbar", fuel/100, is_vertical, fuel_baralign, autocvar_hud_progressbar_fuel_color, panel_fg_alpha * 0.8, DRAWFLAG_NORMAL);
                }
        }
  }
@@@ -1609,7 -1629,6 +1589,6 @@@ void HUD_Notify(void
        }
  
        HUD_Panel_UpdateCvars();
-       HUD_Panel_ApplyFadeAlpha();
        vector pos, mySize;
        pos = panel_pos;
        mySize = panel_size;
                                a = entries - 1 - i;
                        attacker = textShortenToWidth(sprintf(_("Player %d"), a+1), 0.48 * mySize_x - height, fontsize, stringwidth_colors);
                        victim = textShortenToWidth(sprintf(_("Player %d"), a+2), 0.48 * mySize_x - height, fontsize, stringwidth_colors);
 -                      icon = strcat("weapon", get_weaponinfo(WEP_FIRST + mod(floor(a*2.4), WEP_LAST)).netname);
 +                      icon = get_weaponinfo(WEP_FIRST + mod(floor(a*2.4), WEP_LAST)).model2;
                        a = bound(0, (when - a) / 4, 1);
                        goto hud_config_notifyprint;
                }
@@@ -1746,7 -1765,6 +1725,6 @@@ void HUD_Timer(void
        }
  
        HUD_Panel_UpdateCvars();
-       HUD_Panel_ApplyFadeAlpha();
  
        draw_beginBoldFont();
  
@@@ -1810,11 -1828,15 +1788,15 @@@ void HUD_Radar(void
                {
                        if (autocvar_hud_panel_radar == 0) return;
                        if (autocvar_hud_panel_radar != 2 && !teamplay) return;
+                       if(radar_panel_modified)
+                       {
+                               panel.update_time = time; // forces reload of panel attributes
+                               radar_panel_modified = false;
+                       }
                }
        }
  
        HUD_Panel_UpdateCvars();
-       HUD_Panel_ApplyFadeAlpha();
  
        float f = 0;
  
                panel_pos_x = (vid_conwidth - panel_size_x) / 2;
                panel_pos_y = (vid_conheight - panel_size_y) / 2;
  
+               string panel_bg;
                panel_bg = strcat(hud_skin_path, "/border_default"); // always use the default border when maximized
-               if(precache_pic(panel_bg) == "") { panel_bg = "gfx/hud/default/border_default"; } // fallback
+               if(precache_pic(panel_bg) == "")
+                       panel_bg = "gfx/hud/default/border_default"; // fallback
+               if(!radar_panel_modified && panel_bg != panel.current_panel_bg)
+                       radar_panel_modified = true;
+               if(panel.current_panel_bg)
+                       strunzone(panel.current_panel_bg);
+               panel.current_panel_bg = strzone(panel_bg);
  
                switch(hud_panel_radar_maximized_zoommode)
                {
  // Score (#7)
  //
  void HUD_UpdatePlayerTeams();
- void HUD_Score_Rankings(vector pos, vector mySize, entity me, float team_count)
+ void HUD_Score_Rankings(vector pos, vector mySize, entity me)
  {
        float score;
        entity tm = world, pl;
@@@ -2106,7 -2135,6 +2095,6 @@@ void HUD_Score(void
        }
  
        HUD_Panel_UpdateCvars();
-       HUD_Panel_ApplyFadeAlpha();
        vector pos, mySize;
        pos = panel_pos;
        mySize = panel_size;
        } else if (!teamplay) { // non-teamgames
                if ((spectatee_status == -1 && !autocvar__hud_configure) || autocvar_hud_panel_score_rankings)
                {
-                       HUD_Score_Rankings(pos, mySize, me, 0);
+                       HUD_Score_Rankings(pos, mySize, me);
                        return;
                }
                // me vector := [team/connected frags id]
                drawstring_aspect(pos + eX * 0.75 * mySize_x, distribution_str, eX * 0.25 * mySize_x + eY * (1/3) * mySize_y, distribution_color, panel_fg_alpha, DRAWFLAG_NORMAL);
                draw_endBoldFont();
        } else { // teamgames
-               float scores_count = 0, row, column, rows = 0, columns = 0;
+               float row, column, rows = 0, columns = 0;
                local noref vector offset = '0 0 0';
                vector score_pos, score_size; //for scores other than myteam
-               if (spectatee_status == -1 || autocvar_hud_panel_score_rankings)
+               if(autocvar_hud_panel_score_rankings)
+               {
+                       HUD_Score_Rankings(pos, mySize, me);
+                       return;
+               }
+               if(spectatee_status == -1)
                {
-                       for(tm = teams.sort_next; tm, tm.team != NUM_SPECTATOR; tm = tm.sort_next)
-                               ++scores_count;
-                       if (autocvar_hud_panel_score_rankings)
-                       {
-                               HUD_Score_Rankings(pos, mySize, me, scores_count);
-                               return;
-                       }
                        rows = mySize_y/mySize_x;
-                       rows = bound(1, floor((sqrt(4 * (3/1) * rows * scores_count + rows * rows) + rows + 0.5) / 2), scores_count);
+                       rows = bound(1, floor((sqrt(4 * (3/1) * rows * team_count + rows * rows) + rows + 0.5) / 2), team_count);
                        //                               ^^^ ammo item aspect goes here
  
-                       columns = ceil(scores_count/rows);
+                       columns = ceil(team_count/rows);
  
                        score_size = eX * mySize_x*(1/columns) + eY * mySize_y*(1/rows);
  
@@@ -2301,7 -2327,6 +2287,6 @@@ void HUD_RaceTimer (void
        }
  
        HUD_Panel_UpdateCvars();
-       HUD_Panel_ApplyFadeAlpha();
  
        draw_beginBoldFont();
  
@@@ -2502,7 -2527,6 +2487,6 @@@ void HUD_Vote(void
                return;
  
        HUD_Panel_UpdateCvars();
-       HUD_Panel_ApplyFadeAlpha();
  
        if(uid2name_dialog)
        {
@@@ -2653,11 -2677,6 +2637,6 @@@ void DrawCAItem(vector myPos, vector my
  void HUD_Mod_CA(vector myPos, vector mySize)
  {
        mod_active = 1; // required in each mod function that always shows something
-       entity tm;
-       float teams_count = 0;
-       for(tm = teams.sort_next; tm; tm = tm.sort_next)
-               if(tm.team != NUM_SPECTATOR)
-                       ++teams_count;
  
        float layout;
        if(gametype == MAPINFO_TYPE_CA)
        float rows, columns, aspect_ratio;
        rows = mySize_y/mySize_x;
        aspect_ratio = (layout) ? 2 : 1;
-       rows = bound(1, floor((sqrt((4 * aspect_ratio * teams_count + rows) * rows) + rows + 0.5) / 2), teams_count);
-       columns = ceil(teams_count/rows);
+       rows = bound(1, floor((sqrt((4 * aspect_ratio * team_count + rows) * rows) + rows + 0.5) / 2), team_count);
+       columns = ceil(team_count/rows);
  
        int i;
        float row = 0, column = 0;
        vector pos, itemSize;
        itemSize = eX * mySize_x*(1/columns) + eY * mySize_y*(1/rows);
-       for(i=0; i<teams_count; ++i)
+       for(i=0; i<team_count; ++i)
        {
                pos = myPos + eX * column * itemSize_x + eY * row * itemSize_y;
  
@@@ -3053,12 -3072,7 +3032,7 @@@ void HUD_Mod_NexBall(vector pos, vecto
                if (p > 1)
                        p = 2 - p;
  
-               //Draw the filling
-               HUD_Panel_GetProgressBarColor(nexball);
-               if(mySize_x > mySize_y)
-                       HUD_Panel_DrawProgressBar(pos, mySize, "progressbar", p, 0, 0, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
-               else
-                       HUD_Panel_DrawProgressBar(pos, mySize, "progressbar", p, 1, 0, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+               HUD_Panel_DrawProgressBar(pos, mySize, "progressbar", p, (mySize_x <= mySize_y), 0, autocvar_hud_progressbar_nexball_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
        }
  
        if (stat_items & IT_KEY1)
@@@ -3284,24 -3298,19 +3258,19 @@@ void DrawDomItem(vector myPos, vector m
  void HUD_Mod_Dom(vector myPos, vector mySize)
  {
        mod_active = 1; // required in each mod function that always shows something
-       entity tm;
-       float teams_count = 0;
-       for(tm = teams.sort_next; tm; tm = tm.sort_next)
-               if(tm.team != NUM_SPECTATOR)
-                       ++teams_count;
  
        float layout = autocvar_hud_panel_modicons_dom_layout;
        float rows, columns, aspect_ratio;
        rows = mySize_y/mySize_x;
        aspect_ratio = (layout) ? 3 : 1;
-       rows = bound(1, floor((sqrt((4 * aspect_ratio * teams_count + rows) * rows) + rows + 0.5) / 2), teams_count);
-       columns = ceil(teams_count/rows);
+       rows = bound(1, floor((sqrt((4 * aspect_ratio * team_count + rows) * rows) + rows + 0.5) / 2), team_count);
+       columns = ceil(team_count/rows);
  
        int i;
        float row = 0, column = 0;
        vector pos, itemSize;
        itemSize = eX * mySize_x*(1/columns) + eY * mySize_y*(1/rows);
-       for(i=0; i<teams_count; ++i)
+       for(i=0; i<team_count; ++i)
        {
                pos = myPos + eX * column * itemSize_x + eY * row * itemSize_y;
  
        }
  }
  
+ void HUD_ModIcons_SetFunc()
+ {
+       switch(gametype)
+       {
+               case MAPINFO_TYPE_KEYHUNT:              HUD_ModIcons_GameType = HUD_Mod_KH; break;
+               case MAPINFO_TYPE_CTF:                  HUD_ModIcons_GameType = HUD_Mod_CTF; break;
+               case MAPINFO_TYPE_NEXBALL:              HUD_ModIcons_GameType = HUD_Mod_NexBall; break;
+               case MAPINFO_TYPE_CTS:
+               case MAPINFO_TYPE_RACE:         HUD_ModIcons_GameType = HUD_Mod_Race; break;
+               case MAPINFO_TYPE_CA:
+               case MAPINFO_TYPE_FREEZETAG:    HUD_ModIcons_GameType = HUD_Mod_CA; break;
+               case MAPINFO_TYPE_DOMINATION:   HUD_ModIcons_GameType = HUD_Mod_Dom; break;
+               case MAPINFO_TYPE_KEEPAWAY:     HUD_ModIcons_GameType = HUD_Mod_Keepaway; break;
+       }
+ }
  float mod_prev; // previous state of mod_active to check for a change
  float mod_alpha;
  float mod_change; // "time" when mod_active changed
@@@ -3325,18 -3350,13 +3310,13 @@@ void HUD_ModIcons(void
        if(!autocvar__hud_configure)
        {
                if(!autocvar_hud_panel_modicons) return;
-               if (gametype != MAPINFO_TYPE_CTF && gametype != MAPINFO_TYPE_KEYHUNT && gametype != MAPINFO_TYPE_NEXBALL && gametype != MAPINFO_TYPE_CTS && gametype != MAPINFO_TYPE_RACE && gametype != MAPINFO_TYPE_CA && gametype != MAPINFO_TYPE_FREEZETAG && gametype != MAPINFO_TYPE_KEEPAWAY && gametype != MAPINFO_TYPE_DOMINATION) return;
+               if(!HUD_ModIcons_GameType) return;
        }
  
        HUD_Panel_UpdateCvars();
-       HUD_Panel_ApplyFadeAlpha();
  
        draw_beginBoldFont();
  
-       vector pos, mySize;
-       pos = panel_pos;
-       mySize = panel_size;
        if(mod_active != mod_prev) {
                mod_change = time;
                mod_prev = mod_active;
  
        if(panel_bg_padding)
        {
-               pos += '1 1 0' * panel_bg_padding;
-               mySize -= '2 2 0' * panel_bg_padding;
+               panel_pos += '1 1 0' * panel_bg_padding;
+               panel_size -= '2 2 0' * panel_bg_padding;
        }
  
-       // these MUST be ran in order to update mod_active
-       if(gametype == MAPINFO_TYPE_KEYHUNT)
-               HUD_Mod_KH(pos, mySize);
-       else if(gametype == MAPINFO_TYPE_CTF || autocvar__hud_configure)
-               HUD_Mod_CTF(pos, mySize); // forcealpha only needed for ctf icons, as only they are shown in config mode
-       else if(gametype == MAPINFO_TYPE_NEXBALL)
-               HUD_Mod_NexBall(pos, mySize);
-       else if(gametype == MAPINFO_TYPE_CTS || gametype == MAPINFO_TYPE_RACE)
-               HUD_Mod_Race(pos, mySize);
-       else if(gametype == MAPINFO_TYPE_CA || gametype == MAPINFO_TYPE_FREEZETAG)
-               HUD_Mod_CA(pos, mySize);
-       else if(gametype == MAPINFO_TYPE_DOMINATION)
-               HUD_Mod_Dom(pos, mySize);
-       else if(gametype == MAPINFO_TYPE_KEEPAWAY)
-               HUD_Mod_Keepaway(pos, mySize);
+       if(autocvar__hud_configure)
+               HUD_Mod_CTF(panel_pos, panel_size);
+       else
+               HUD_ModIcons_GameType(panel_pos, panel_size);
  
        draw_endBoldFont();
  }
@@@ -3386,7 -3395,6 +3355,6 @@@ void HUD_PressedKeys(void
        }
  
        HUD_Panel_UpdateCvars();
-       HUD_Panel_ApplyFadeAlpha();
        vector pos, mySize;
        pos = panel_pos;
        mySize = panel_size;
@@@ -3454,24 -3462,32 +3422,32 @@@ void HUD_Chat(void
                        return;
                }
                if(autocvar__con_chat_maximized)
+               {
                        if(!hud_draw_maximized) return;
+               }
+               else if(chat_panel_modified)
+               {
+                       panel.update_time = time; // forces reload of panel attributes
+                       chat_panel_modified = false;
+               }
        }
  
        HUD_Panel_UpdateCvars();
-       HUD_Panel_ApplyFadeAlpha();
  
        if(autocvar__con_chat_maximized && !autocvar__hud_configure) // draw at full screen height if maximized
        {
                panel_pos_y = panel_bg_border;
                panel_size_y = vid_conheight - panel_bg_border * 2;
-               if(panel_bg == "0") // force a border when maximized
+               if(panel.current_panel_bg == "0") // force a border when maximized
                {
-                       if(precache_pic(panel_bg) == "") {
-                               panel_bg = strcat(hud_skin_path, "/border_default");
-                               if(precache_pic(panel_bg) == "") {
-                                       panel_bg = "gfx/hud/default/border_default";
-                               }
-                       }
+                       string panel_bg;
+                       panel_bg = strcat(hud_skin_path, "/border_default");
+                       if(precache_pic(panel_bg) == "")
+                               panel_bg = "gfx/hud/default/border_default";
+                       if(panel.current_panel_bg)
+                               strunzone(panel.current_panel_bg);
+                       panel.current_panel_bg = strzone(panel_bg);
+                       chat_panel_modified = true;
                }
                panel_bg_alpha = max(0.75, panel_bg_alpha); // force an theAlpha of at least 0.75
        }
@@@ -3532,7 -3548,6 +3508,6 @@@ void HUD_EngineInfo(void
        }
  
        HUD_Panel_UpdateCvars();
-       HUD_Panel_ApplyFadeAlpha();
        vector pos, mySize;
        pos = panel_pos;
        mySize = panel_size;
@@@ -3593,7 -3608,6 +3568,6 @@@ void HUD_InfoMessages(void
        }
  
        HUD_Panel_UpdateCvars();
-       HUD_Panel_ApplyFadeAlpha();
        vector pos, mySize;
        pos = panel_pos;
        mySize = panel_size;
@@@ -3780,7 -3794,6 +3754,6 @@@ void HUD_Physics(void
        }
  
        HUD_Panel_UpdateCvars();
-       HUD_Panel_ApplyFadeAlpha();
  
        draw_beginBoldFont();
  
        //draw speed
        if(speed)
        if(autocvar_hud_panel_physics_progressbar == 1 || autocvar_hud_panel_physics_progressbar == 2)
-       {
-               HUD_Panel_GetProgressBarColor(speed);
-               HUD_Panel_DrawProgressBar(panel_pos + speed_offset, panel_size, "progressbar", speed/max_speed, 0, speed_baralign, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
-       }
+               HUD_Panel_DrawProgressBar(panel_pos + speed_offset, panel_size, "progressbar", speed/max_speed, 0, speed_baralign, autocvar_hud_progressbar_speed_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
        vector tmp_offset = '0 0 0', tmp_size = '0 0 0';
        if (autocvar_hud_panel_physics_text == 1 || autocvar_hud_panel_physics_text == 2)
        {
                                        peak_offset_x = (1 - min(top_speed, max_speed)/max_speed) * panel_size_x;
                  else // if (speed_baralign == 2)
                      peak_offset_x = min(top_speed, max_speed)/max_speed * panel_size_x * 0.5;
-                               //if speed is not 0 the speed progressbar already fetched the color
-                               if (speed == 0)
-                                       HUD_Panel_GetProgressBarColor(speed);
                                peak_size_x = floor(panel_size_x * 0.01 + 1.5);
                  peak_size_y = panel_size_y;
                  if (speed_baralign == 2) // draw two peaks, on both sides
                  {
-                     drawfill(panel_pos + speed_offset + eX * (0.5 * panel_size_x + peak_offset_x - peak_size_x), peak_size, progressbar_color, f * autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
-                     drawfill(panel_pos + speed_offset + eX * (0.5 * panel_size_x - peak_offset_x + peak_size_x), peak_size, progressbar_color, f * autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+                     drawfill(panel_pos + speed_offset + eX * (0.5 * panel_size_x + peak_offset_x - peak_size_x), peak_size, autocvar_hud_progressbar_speed_color, f * autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+                     drawfill(panel_pos + speed_offset + eX * (0.5 * panel_size_x - peak_offset_x + peak_size_x), peak_size, autocvar_hud_progressbar_speed_color, f * autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
                  }
                  else
-                     drawfill(panel_pos + speed_offset + eX * (peak_offset_x - peak_size_x), peak_size, progressbar_color, f * autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+                     drawfill(panel_pos + speed_offset + eX * (peak_offset_x - peak_size_x), peak_size, autocvar_hud_progressbar_speed_color, f * autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
                        }
  
                        //top speed
        if(acceleration)
        if(autocvar_hud_panel_physics_progressbar == 1 || autocvar_hud_panel_physics_progressbar == 3)
        {
-               if (acceleration < 0)
-                       HUD_Panel_GetProgressBarColor(acceleration_neg);
+               vector progressbar_color;
+               if(acceleration < 0)
+                       progressbar_color = autocvar_hud_progressbar_acceleration_neg_color;
                else
-                       HUD_Panel_GetProgressBarColor(acceleration);
+                       progressbar_color = autocvar_hud_progressbar_acceleration_color;
  
                f = acceleration/autocvar_hud_panel_physics_acceleration_max;
                if (autocvar_hud_panel_physics_acceleration_progressbar_nonlinear)
@@@ -4175,14 -4183,19 +4143,19 @@@ void HUD_CenterPrint (void
                }
        }
  
+       // this panel fades only when the menu does
+       float hud_fade_alpha_save = 0;
+       if(scoreboard_fade_alpha)
+       {
+               hud_fade_alpha_save = hud_fade_alpha;
+               hud_fade_alpha = 1 - autocvar__menu_alpha;
+       }
        HUD_Panel_UpdateCvars();
  
-       // this panel doesn't fade when showing the scoreboard
-       if(autocvar__menu_alpha)
-               HUD_Panel_ApplyFadeAlpha();
        if(scoreboard_fade_alpha)
        {
+               hud_fade_alpha = hud_fade_alpha_save;
                // move the panel below the scoreboard
                if (scoreboard_bottom >= 0.96 * vid_conheight)
                        return;
@@@ -4380,21 -4393,13 +4353,13 @@@ void HUD_Main (void
        if(scoreboard_fade_alpha)
                hud_fade_alpha = (1 - scoreboard_fade_alpha);
  
-       if(autocvar__hud_configure)
-               if(isdemo())
-                       HUD_Configure_Exit_Force();
+       HUD_Configure_Frame();
  
        if(intermission == 2) // no hud during mapvote
-       {
-               if (autocvar__hud_configure)
-                       HUD_Configure_Exit_Force();
                hud_fade_alpha = 0;
-       }
-       else if(autocvar__menu_alpha == 0 && scoreboard_fade_alpha == 0)
-               hud_fade_alpha = 1;
  
        // panels that we want to be active together with the scoreboard
-       // they must call HUD_Panel_ApplyFadeAlpha(); only when showing the menu
+       // they must fade only when the menu does
        if(scoreboard_fade_alpha == 1)
        {
                (panel = HUD_PANEL(CENTERPRINT)).panel_draw();
                hud_skin_prev = strzone(autocvar_hud_skin);
        }
  
-       // HUD configure visible grid
-       if(autocvar__hud_configure && autocvar_hud_configure_grid && autocvar_hud_configure_grid_alpha)
-       {
-               hud_configure_gridSize_x = bound(0.005, cvar("hud_configure_grid_xsize"), 0.2);
-               hud_configure_gridSize_y = bound(0.005, cvar("hud_configure_grid_ysize"), 0.2);
-               hud_configure_realGridSize_x = hud_configure_gridSize_x * vid_conwidth;
-               hud_configure_realGridSize_y = hud_configure_gridSize_y * vid_conheight;
-               vector s;
-               // x-axis
-               s = eX + eY * vid_conheight;
-               for(i = 1; i < 1/hud_configure_gridSize_x; ++i)
-                       drawfill(eX * i * hud_configure_realGridSize_x, s, '0.5 0.5 0.5', autocvar_hud_configure_grid_alpha, DRAWFLAG_NORMAL);
-               // y-axis
-               s = eY + eX * vid_conwidth;
-               for(i = 1; i < 1/hud_configure_gridSize_y; ++i)
-                       drawfill(eY * i * hud_configure_realGridSize_y, s, '0.5 0.5 0.5', autocvar_hud_configure_grid_alpha, DRAWFLAG_NORMAL);
-       }
  #ifdef COMPAT_XON050_ENGINE
      current_player = (spectatee_status > 0) ? spectatee_status : player_localentnum;
  #else
        if(autocvar__con_chat_maximized)
                (panel = HUD_PANEL(CHAT)).panel_draw();
  
-       if(autocvar__hud_configure)
-       {
-               if(tab_panel)
-               {
-                       panel = tab_panel;
-                       HUD_Panel_UpdatePosSize()
-                       drawfill(panel_pos - '1 1 0' * panel_bg_border, panel_size + '2 2 0' * panel_bg_border, '1 1 1', .2, DRAWFLAG_NORMAL);
-               }
-               if(highlightedPanel)
-               {
-                       panel = highlightedPanel;
-                       HUD_Panel_UpdatePosSize()
-                       HUD_Panel_HlBorder(panel_bg_border + 1.5 * hlBorderSize, '0 0.5 1', 0.25 * (1 - autocvar__menu_alpha));
-               }
-               if(!hud_configure_prev || hud_configure_prev == -1)
-               {
-                       if(autocvar_hud_cursormode) { setcursormode(1); }
-                       hudShiftState = 0;
-                       for(i = HUD_PANEL_NUM - 1; i >= 0; --i)
-                               hud_panel[panel_order[i]].update_time = time;
-               }
-       }
-       else if(hud_configure_prev && hud_configure_prev != -1 && autocvar_hud_cursormode)
-               setcursormode(0);
+       HUD_Configure_PostDraw();
  
        hud_configure_prev = autocvar__hud_configure;
-       if (!autocvar__hud_configure) // hud config mode disabled, enable normal theAlpha stuff again
-               if (menu_enabled)
-                       menu_enabled = 0;
  }
index 9b42da8aa8586ae14d58731259d3969522ad3127,fbdbc45f3a3c25a0c5f4f650c7cba9cfe2349b53..4b00f1290856bff5ce90a15a243cb41b0700fafc
@@@ -1,5 -1,6 +1,6 @@@
  entity players;
  entity teams;
+ var float team_count; // real teams
  
  void AuditLists()
  {
@@@ -81,6 -82,8 +82,8 @@@ float RegisterTeam(entity Team
        if(teams.sort_next)
                teams.sort_next.sort_prev = Team;
        teams.sort_next = Team;
+       if(Team.team && Team.team != NUM_SPECTATOR)
+               ++team_count;
        AuditLists();
        return true;
  }
@@@ -101,6 -104,8 +104,8 @@@ void RemoveTeam(entity Team
        parent.sort_next = Team.sort_next;
        if(Team.sort_next)
                Team.sort_next.sort_prev = parent;
+       if(Team.team && Team.team != NUM_SPECTATOR)
+               --team_count;
        AuditLists();
  }
  
@@@ -573,20 -578,6 +578,20 @@@ vector getplayerorigin(float pl
        return GETPLAYERORIGIN_ERROR;
  }
  
 +vector getcsqcplayercolor(float pl)
 +{
 +      entity e;
 +      
 +      e = CSQCModel_server2csqc(pl);
 +      if(e)
 +      {
 +              if(e.colormap > 0)
 +                      return colormapPaletteColor(((e.colormap >= 1024) ? e.colormap : stof(getplayerkeyvalue(e.colormap - 1, "colors"))) & 0x0F, TRUE);
 +      }
 +      
 +      return '1 1 1';
 +}
 +
  float getplayeralpha(float pl)
  {
        entity e;
index da697aafe8a929893bd513c2bde2b076d055b846,dd419ae2261ddb475fc764ddcf39695a9dfed4d7..23f4c1d770bc08508510682cc4371b23602aa77b
@@@ -54,20 -54,6 +54,6 @@@ string TranslateScoresLabel(string l
        }
  }
  
- void MapVote_Draw();
- void HUD_FinaleOverlay()
- {
-       /*vector pos;
-       pos_x = (vid_conwidth - 1)/2;
-       pos_y = 16;
-       pos_z = 0;*/
-       //drawpic(pos, "gfx/finale", '0 0 0', '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
-       //drawstring(pos, "END", hud_fontsize, '1 1 1', 1, DRAWFLAG_NORMAL);
-       MapVote_Draw();
- }
  void Cmd_HUD_SetFields(float argc);
  void HUD_InitScores()
  {
@@@ -969,7 -955,7 +955,7 @@@ float average_accuracy
  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 weapon_cnt = WEP_COUNT - 3; // either vaporizer/nex are hidden, no port-o-launch, no tuba
        float rows;
        if(autocvar_scoreboard_accuracy_doublerows)
                rows = 2;
        if(rows == 2)
                pos_x += weapon_width / 2;
  
 -      if(switchweapon == WEP_MINSTANEX)
 +      if(switchweapon == WEP_VAPORIZER)
                g_minstagib = 1; // TODO: real detection for minstagib?
  
        float weapon_stats;
                self = get_weaponinfo(i);
                if (!self.weapon)
                        continue;
 -              if ((i == WEP_NEX && g_minstagib) || i == WEP_PORTO || (i == WEP_MINSTANEX && !g_minstagib) || i == WEP_TUBA) // skip port-o-launch, nex || minstanex and tuba
 +              if ((i == WEP_VORTEX && g_minstagib) || i == WEP_PORTO || (i == WEP_VAPORIZER && !g_minstagib) || i == WEP_TUBA) // skip port-o-launch, vortex || vaporizer and tuba
                        continue;
                weapon_stats = weapon_accuracy[i-WEP_FIRST];
  
                        weapon_alpha = 0.2 * scoreboard_alpha_fg;
  
                // weapon icon
 -              drawpic_aspect_skin(pos, strcat("weapon", self.netname), '1 0 0' * weapon_width + '0 1 0' * weapon_height, '1 1 1', weapon_alpha, DRAWFLAG_NORMAL);
 +              drawpic_aspect_skin(pos, self.model2, '1 0 0' * weapon_width + '0 1 0' * weapon_height, '1 1 1', weapon_alpha, DRAWFLAG_NORMAL);
                // the accuracy
                if(weapon_stats >= 0) {
                        weapons_with_stats += 1;
index c174d7656af19b8209faedbc05d5162d10b6751f,dd7ae36b91fc09897bacb967633819e7cc61db34..68ecfd74b022f2dc77f04afdad869c02cd1f644d
@@@ -115,39 -115,31 +115,31 @@@ void drawhealthbar(vector org, float ro
  // returns location of sprite text
  vector drawspritearrow(vector o, float ang, vector rgb, float a, float t)
  {
-       float SQRT2 = 1.414;
-       float BORDER; BORDER = 1.5 * t;
-       float TSIZE; TSIZE = 8 * t;
-       float RLENGTH; RLENGTH = 8 * t;
-       float RWIDTH; RWIDTH = 4 * t;
-       float MLENGTH; MLENGTH = 4 * t;
+       float size   = 9.0 * t;
+       float border = 1.5 * t;
+       float margin = 4.0 * t;
+       float borderDiag = border * 1.414;
+       vector arrowX  = eX * size;
+       vector arrowY  = eY * (size+borderDiag);
+       vector borderX = eX * (size+borderDiag);
+       vector borderY = eY * (size+borderDiag+border);
  
        R_BeginPolygon("", DRAWFLAG_NORMAL);
-       R_PolygonVertex(o + rotate(eX * -(TSIZE + BORDER * (1 + SQRT2)) + eY * (TSIZE + BORDER), ang), '0 0 0', '0 0 0', a);
-       R_PolygonVertex(o + rotate(eX *  (TSIZE + BORDER * (1 + SQRT2)) + eY * (TSIZE + BORDER), ang), '0 0 0', '0 0 0', a);
-       R_PolygonVertex(o + rotate(eY * -(        BORDER *      SQRT2),                          ang), '0 0 0', '0 0 0', a);
-       R_EndPolygon();
-       R_BeginPolygon("", DRAWFLAG_NORMAL);
-       R_PolygonVertex(o + rotate(eX * -(RWIDTH + BORDER) + eY * (TSIZE           + BORDER), ang), '0 0 0', '0 0 0', a);
-       R_PolygonVertex(o + rotate(eX * -(RWIDTH + BORDER) + eY * (TSIZE + RLENGTH + BORDER), ang), '0 0 0', '0 0 0', a);
-       R_PolygonVertex(o + rotate(eX *  (RWIDTH + BORDER) + eY * (TSIZE + RLENGTH + BORDER), ang), '0 0 0', '0 0 0', a);
-       R_PolygonVertex(o + rotate(eX *  (RWIDTH + BORDER) + eY * (TSIZE           + BORDER), ang), '0 0 0', '0 0 0', a);
+       R_PolygonVertex(o,                                  '0 0 0', '0 0 0', a);
+       R_PolygonVertex(o + rotate(arrowY  - borderX, ang), '0 0 0', '0 0 0', a);
+       R_PolygonVertex(o + rotate(borderY - borderX, ang), '0 0 0', '0 0 0', a);
+       R_PolygonVertex(o + rotate(borderY + borderX, ang), '0 0 0', '0 0 0', a);
+       R_PolygonVertex(o + rotate(arrowY  + borderX, ang), '0 0 0', '0 0 0', a);
        R_EndPolygon();
  
        R_BeginPolygon("", DRAWFLAG_ADDITIVE);
-       R_PolygonVertex(o + rotate(eX * -TSIZE + eY * TSIZE, ang), '0 0 0', rgb, a);
-       R_PolygonVertex(o + rotate(eX *  TSIZE + eY * TSIZE, ang), '0 0 0', rgb, a);
-       R_PolygonVertex(o + rotate('0 0 0',                  ang), '0 0 0', rgb, a);
-       R_EndPolygon();
-       R_BeginPolygon("", DRAWFLAG_ADDITIVE);
-       R_PolygonVertex(o + rotate(eX * -RWIDTH + eY *  TSIZE,            ang), '0 0 0', rgb, a);
-       R_PolygonVertex(o + rotate(eX * -RWIDTH + eY * (TSIZE + RLENGTH), ang), '0 0 0', rgb, a);
-       R_PolygonVertex(o + rotate(eX *  RWIDTH + eY * (TSIZE + RLENGTH), ang), '0 0 0', rgb, a);
-       R_PolygonVertex(o + rotate(eX *  RWIDTH + eY *  TSIZE,            ang), '0 0 0', rgb, a);
+       R_PolygonVertex(o + rotate(eY * borderDiag, ang), '0 0 0', rgb, a);
+       R_PolygonVertex(o + rotate(arrowY - arrowX, ang), '0 0 0', rgb, a);
+       R_PolygonVertex(o + rotate(arrowY + arrowX, ang), '0 0 0', rgb, a);
        R_EndPolygon();
  
-       return
-               o + rotate(eY * (TSIZE + RLENGTH + MLENGTH), ang);
+       return o + rotate(eY * (borderDiag+size+margin), ang);
  }
  
  // returns location of sprite healthbar
@@@ -225,20 -217,30 +217,20 @@@ float spritelookupblinkvalue(string s
  }
  vector spritelookupcolor(string s, vector def)
  {
 +      if(substring(s, 0, 4) == "wpn-")
 +              return (get_weaponinfo(stof(substring(s, 4, strlen(s)))).wpcolor);
 +
        switch(s)
        {
                case "keycarrier-friend": return '0 1 0';
 -              case "wpn-laser":         return '1 0.5 0.5';
 -              case "wpn-shotgun":       return '0.5 0.25 0';
 -              case "wpn-uzi":           return '1 1 0';
 -              case "wpn-gl":            return '1 0 0';
 -              case "wpn-electro":       return '0 0.5 1';
 -              case "wpn-crylink":       return '1 0.5 1';
 -              case "wpn-nex":           return '0.5 1 1';
 -              case "wpn-hagar":         return '1 1 0.5';
 -              case "wpn-rl":            return '1 1 0';
 -              case "wpn-porto":         return '0.5 0.5 0.5';
 -              case "wpn-minstanex":     return '0.5 1 1';
 -              case "wpn-hookgun":       return '0 0.5 0';
 -              case "wpn-fireball":      return '1 0.5 0';
 -              case "wpn-hlac":          return '0 1 0';
 -              case "wpn-campingrifle":  return '0.5 1 0';
 -              case "wpn-minelayer":     return '0.75 1 0';
                default:                  return def;
        }
  }
  string spritelookuptext(string s)
  {
 +      if(substring(s, 0, 4) == "wpn-")
 +              return (get_weaponinfo(stof(substring(s, 4, strlen(s)))).message);
 +
        switch(s)
        {
                case "as-push": return _("Push");
                case "nb-ball": return _("Ball");
                case "ka-ball": return _("Ball");
                case "ka-ballcarrier": return _("Ball carrier");
 -              case "wpn-laser": return _("Laser");
 -              case "wpn-shotgun": return _("Shotgun");
 -              case "wpn-uzi": return _("Machine Gun");
 -              case "wpn-gl": return _("Mortar");
 -              case "wpn-electro": return _("Electro");
 -              case "wpn-crylink": return _("Crylink");
 -              case "wpn-nex": return _("Nex");
 -              case "wpn-hagar": return _("Hagar");
 -              case "wpn-rl": return _("Rocket Launcher");
 -              case "wpn-porto": return _("Port-O-Launch");
 -              case "wpn-minstanex": return _("Minstanex");
 -              case "wpn-hookgun": return _("Hook");
 -              case "wpn-fireball": return _("Fireball");
 -              case "wpn-hlac": return _("HLAC");
 -              case "wpn-campingrifle": return _("Rifle");
 -              case "wpn-minelayer": return _("Mine Layer");
                case "dom-neut": return _("Control point");
                case "dom-red": return _("Control point");
                case "dom-blue": return _("Control point");
index 075b95827f5b7f40e23a9bcca09ddb7734cac8be,674c95b14ea735e2b67e0cb063f21702e2a1c754..9521c79e2a70f48638155899467b6967864173c4
@@@ -80,6 -80,33 +80,6 @@@ 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_rifle_bursttime;
 -float autocvar_g_balance_rifle_primary_ammo;
 -float autocvar_g_balance_rifle_primary_animtime;
 -float autocvar_g_balance_rifle_primary_bullethail;
 -float autocvar_g_balance_rifle_primary_burstcost;
 -float autocvar_g_balance_rifle_primary_damage;
 -float autocvar_g_balance_rifle_primary_force;
 -float autocvar_g_balance_rifle_primary_refire;
 -float autocvar_g_balance_rifle_primary_shots;
 -float autocvar_g_balance_rifle_primary_solidpenetration;
 -float autocvar_g_balance_rifle_primary_spread;
 -float autocvar_g_balance_rifle_primary_tracer;
 -float autocvar_g_balance_rifle_secondary;
 -float autocvar_g_balance_rifle_secondary_ammo;
 -float autocvar_g_balance_rifle_secondary_animtime;
 -float autocvar_g_balance_rifle_secondary_bullethail;
 -float autocvar_g_balance_rifle_secondary_burstcost;
 -float autocvar_g_balance_rifle_secondary_damage;
 -float autocvar_g_balance_rifle_secondary_force;
 -float autocvar_g_balance_rifle_secondary_reload;
 -float autocvar_g_balance_rifle_secondary_refire;
 -float autocvar_g_balance_rifle_secondary_shots;
 -float autocvar_g_balance_rifle_secondary_solidpenetration;
 -float autocvar_g_balance_rifle_secondary_spread;
 -float autocvar_g_balance_rifle_secondary_tracer;
 -float autocvar_g_balance_rifle_reload_ammo;
 -float autocvar_g_balance_rifle_reload_time;
  float autocvar_g_balance_cloaked_alpha;
  float autocvar_g_balance_contents_damagerate;
  float autocvar_g_balance_contents_drowndelay;
@@@ -87,11 -114,134 +87,11 @@@ float autocvar_g_balance_contents_playe
  float autocvar_g_balance_contents_playerdamage_lava;
  float autocvar_g_balance_contents_playerdamage_slime;
  float autocvar_g_balance_contents_projectiledamage;
 -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_joindelay;
 -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_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_joindelay;
 -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_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_crylink_secondary_spreadtype;
 -float autocvar_g_balance_crylink_reload_ammo;
 -float autocvar_g_balance_crylink_reload_time;
  float autocvar_g_balance_damagepush_speedfactor;
 -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_combo_safeammocheck;
 -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_damagedbycontents;
 -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_electro_reload_ammo;
 -float autocvar_g_balance_electro_reload_time;
  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_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_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;
@@@ -110,6 -260,75 +110,6 @@@ float autocvar_g_balance_grapplehook_sp
  float autocvar_g_balance_grapplehook_speed_pull;
  float autocvar_g_balance_grapplehook_stretch;
  float autocvar_g_balance_grapplehook_damagedbycontents;
 -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_lifetime_stick;
 -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_lifetime_bounce;
 -float autocvar_g_balance_grenadelauncher_secondary_lifetime_stick;
 -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_grenadelauncher_reload_ammo;
 -float autocvar_g_balance_grenadelauncher_reload_time;
 -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_health;
 -float autocvar_g_balance_hagar_primary_damageforcescale;
 -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_load;
 -float autocvar_g_balance_hagar_secondary_load_speed;
 -float autocvar_g_balance_hagar_secondary_load_spread;
 -float autocvar_g_balance_hagar_secondary_load_spread_bias;
 -float autocvar_g_balance_hagar_secondary_load_max;
 -float autocvar_g_balance_hagar_secondary_load_hold;
 -float autocvar_g_balance_hagar_secondary_load_releasedeath;
 -float autocvar_g_balance_hagar_secondary_load_abort;
 -float autocvar_g_balance_hagar_secondary_load_linkexplode;
 -float autocvar_g_balance_hagar_secondary_load_animtime;
 -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_health;
 -float autocvar_g_balance_hagar_secondary_damageforcescale;
 -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_hagar_secondary_speed;
 -float autocvar_g_balance_hagar_secondary_spread;
 -float autocvar_g_balance_hagar_reload_ammo;
 -float autocvar_g_balance_hagar_reload_time;
  float autocvar_g_balance_health_limit;
  float autocvar_g_balance_health_regen;
  float autocvar_g_balance_health_regenlinear;
@@@ -117,6 -336,54 +117,6 @@@ float autocvar_g_balance_health_regenst
  float autocvar_g_balance_health_rot;
  float autocvar_g_balance_health_rotlinear;
  float autocvar_g_balance_health_rotstable;
 -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_hlac_reload_ammo;
 -float autocvar_g_balance_hlac_reload_time;
 -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_hook_secondary_health;
 -float autocvar_g_balance_hook_secondary_damageforcescale;
  float autocvar_g_balance_keyhunt_damageforcescale;
  float autocvar_g_balance_keyhunt_delay_collect;
  float autocvar_g_balance_keyhunt_delay_return;
@@@ -134,6 -401,102 +134,6 @@@ float autocvar_g_balance_keyhunt_score_
  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_other_scale;
 -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_other_scale;
 -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_laser_reload_ammo;
 -float autocvar_g_balance_laser_reload_time;
 -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_lifetime_countdown;
 -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_minelayer_reload_ammo;
 -float autocvar_g_balance_minelayer_reload_time;
 -float autocvar_g_balance_minstanex_ammo;
 -float autocvar_g_balance_minstanex_laser_ammo;
 -float autocvar_g_balance_minstanex_laser_animtime;
 -float autocvar_g_balance_minstanex_laser_refire;
 -float autocvar_g_balance_minstanex_animtime;
 -float autocvar_g_balance_minstanex_refire;
 -float autocvar_g_balance_minstanex_reload_ammo;
 -float autocvar_g_balance_minstanex_reload_time;
 -float autocvar_g_balance_nex_charge;
 -float autocvar_g_balance_nex_charge_animlimit;
 -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_nex_reload_ammo;
 -float autocvar_g_balance_nex_reload_time;
  float autocvar_g_balance_nexball_primary_animtime;
  float autocvar_g_balance_nexball_primary_refire;
  float autocvar_g_balance_nexball_primary_speed;
@@@ -165,6 -528,15 +165,6 @@@ float autocvar_g_balance_pause_health_r
  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_porto_secondary;
 -float autocvar_g_balance_porto_secondary_animtime;
 -float autocvar_g_balance_porto_secondary_lifetime;
 -float autocvar_g_balance_porto_secondary_refire;
 -float autocvar_g_balance_porto_secondary_speed;
  float autocvar_g_balance_powerup_invincible_takedamage;
  float autocvar_g_balance_powerup_invincible_time;
  float autocvar_g_balance_powerup_strength_damage;
@@@ -173,10 -545,133 +173,10 @@@ float autocvar_g_balance_powerup_streng
  float autocvar_g_balance_powerup_strength_selfforce;
  float autocvar_g_balance_powerup_strength_time;
  float autocvar_g_balance_superweapons_time;
 -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_rocketlauncher_reload_ammo;
 -float autocvar_g_balance_rocketlauncher_reload_time;
 -float autocvar_g_balance_seeker_type;
 -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_animtime;
 -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_refire;
 -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_seeker_tag_tracker_lifetime;
 -float autocvar_g_balance_seeker_reload_ammo;
 -float autocvar_g_balance_seeker_reload_time;
  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_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_solidpenetration;
 -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_side;
 -float autocvar_g_balance_shotgun_secondary_melee_swing_up;
 -float autocvar_g_balance_shotgun_secondary_melee_time;
 -float autocvar_g_balance_shotgun_secondary_melee_traces;
 -float autocvar_g_balance_shotgun_secondary_melee_no_doubleslap;
 -float autocvar_g_balance_shotgun_secondary_melee_nonplayerdamage;
 -float autocvar_g_balance_shotgun_secondary_melee_multihit;
 -float autocvar_g_balance_shotgun_secondary_refire;
 -float autocvar_g_balance_shotgun_reload_ammo;
 -float autocvar_g_balance_shotgun_reload_time;
  float autocvar_g_balance_teams;
  float autocvar_g_balance_teams_prevent_imbalance;
  float autocvar_g_balance_teams_scorefactor;
 -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_burst;
 -float autocvar_g_balance_uzi_burst_ammo;
 -float autocvar_g_balance_uzi_burst_animtime;
 -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_solidpenetration;
 -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_uzi_reload_ammo;
 -float autocvar_g_balance_uzi_reload_time;
  float autocvar_g_ballistics_density_corpse;
  float autocvar_g_ballistics_density_player;
  float autocvar_g_ballistics_mindistance;
@@@ -777,3 -1272,9 +777,9 @@@ float autocvar_g_campcheck_damage
  float autocvar_g_campcheck_distance;
  float autocvar_g_campcheck_interval;
  float autocvar_g_jump_grunt;
+ float autocvar_g_spawn_near_teammate_distance;
+ float autocvar_g_spawn_near_teammate_ignore_spawnpoint;
+ float autocvar_g_spawn_near_teammate_ignore_spawnpoint_delay;
+ float autocvar_g_spawn_near_teammate_ignore_spawnpoint_delay_death;
+ float autocvar_g_spawn_near_teammate_ignore_spawnpoint_check_health;
+ float autocvar_g_spawn_near_teammate_ignore_spawnpoint_closetodeath;
index cf917c8ccda60e95e46832e6d8abe0c267162bbe,5dc6f2e39346ff99098d6fe4a3a0768012b3db0a..f5861909162a60c2351045ca49035ac0c9e59993
@@@ -355,7 -355,7 +355,7 @@@ string formatmessage(string msg
                                wep = self.switchweapon;
                        if (!wep)
                                wep = self.cnt;
 -                      replacement = W_Name(wep);
 +                      replacement = WEP_NAME(wep);
                } else if (escape == "W") {
                        if (self.items & IT_SHELLS) replacement = "shells";
                        else if (self.items & IT_NAILS) replacement = "bullets";
@@@ -460,6 -460,7 +460,6 @@@ void GetCvars_handleFloatOnce(string th
                        stuffcmd(self, strcat("cl_cmd sendcvar ", name, "\n"));
        }
  }
 -float w_getbestweapon(entity e);
  string W_FixWeaponOrder_ForceComplete_AndBuildImpulseList(string wo)
  {
        string o;
@@@ -626,7 -627,9 +626,7 @@@ float warmup_start_health
  float warmup_start_armorvalue;
  float g_weapon_stay;
  
 -entity get_weaponinfo(float w);
 -
 -float want_weapon(string cvarprefix, entity weaponinfo, float allguns)
 +float want_weapon(entity weaponinfo, float allguns) // WEAPONTODO: what still needs done? 
  {
        var float i = weaponinfo.weapon;
        var float d = 0;
        else if (g_nexball)
                d = 0; // weapon is set a few lines later
        else
 -              d = (i == WEP_LASER || i == WEP_SHOTGUN);
 +              d = !(!weaponinfo.weaponstart);
  
        if(g_grappling_hook) // if possible, redirect off-hand hook to on-hand hook
                d |= (i == WEP_HOOK);
 -      if(weaponinfo.spawnflags & WEP_FLAG_MUTATORBLOCKED) // never default mutator blocked guns
 +      if(!g_cts && (weaponinfo.spawnflags & WEP_FLAG_MUTATORBLOCKED)) // never default mutator blocked guns
                d = 0;
  
 -      var float t = cvar(strcat(cvarprefix, weaponinfo.netname));
 +      var float t = weaponinfo.weaponstartoverride;
  
        //print(strcat("want_weapon: ", weaponinfo.netname, " - d: ", ftos(d), ", t: ", ftos(t), ". \n"));
  
@@@ -776,7 -779,7 +776,7 @@@ void readplayerstartcvars(
                for (i = WEP_FIRST; i <= WEP_LAST; ++i)
                {
                        e = get_weaponinfo(i);
 -                      float w = want_weapon("g_start_weapon_", e, FALSE);
 +                      float w = want_weapon(e, FALSE);
                        if(w & 1)
                                start_weapons |= WepSet_FromWeapon(i);
                        if(w & 2)
                        for (i = WEP_FIRST; i <= WEP_LAST; ++i)
                        {
                                e = get_weaponinfo(i);
 -                              float w = want_weapon("g_start_weapon_", e, g_warmup_allguns);
 +                              float w = want_weapon(e, g_warmup_allguns);
                                if(w & 1)
                                        warmup_start_weapons |= WepSet_FromWeapon(i);
                                if(w & 2)
        {
                e = get_weaponinfo(i);
                if(precache_weapons & WepSet_FromWeapon(i))
 -                      weapon_action(i, WR_PRECACHE);
 +                      WEP_ACTION(i, WR_INIT);
        }
  
        start_ammo_shells = max(0, start_ammo_shells);
@@@ -908,7 -911,7 +908,7 @@@ void readlevelcvars(void
                { if(cvar(mut_cvar) && dependence) { MUTATOR_ADD(mut_name); } }
  
        CHECK_MUTATOR_ADD("g_dodging", mutator_dodging, 1);
-       CHECK_MUTATOR_ADD("g_spawn_near_teammate", mutator_spawn_near_teammate, 1);
+       CHECK_MUTATOR_ADD("g_spawn_near_teammate", mutator_spawn_near_teammate, teamplay);
        CHECK_MUTATOR_ADD("g_physical_items", mutator_physical_items, 1);
        CHECK_MUTATOR_ADD("g_touchexplode", mutator_touchexplode, 1);
        CHECK_MUTATOR_ADD("g_minstagib", mutator_minstagib, 1);
@@@ -1388,6 -1391,18 +1388,6 @@@ void precache(
          precache_sound ("weapons/hook_impact.wav"); // hook
      }
  
 -    if(autocvar_sv_precacheweapons)
 -    {
 -        //precache weapon models/sounds
 -        float wep;
 -        wep = WEP_FIRST;
 -        while (wep <= WEP_LAST)
 -        {
 -            weapon_action(wep, WR_PRECACHE);
 -            wep = wep + 1;
 -        }
 -    }
 -
      precache_model("models/elaser.mdl");
      precache_model("models/laser.mdl");
      precache_model("models/ebomb.mdl");
index 32a3c906c60586bc16b7ebed35a866c0f8550e77,2fad6022673c855e4fae529dfe8dc6158bba0954..515d3901dea02fb65ecb11fb2d12b493799558ab
@@@ -72,7 -72,7 +72,7 @@@ void nade_boom(
  
        self.takedamage = DAMAGE_NO;
        RadiusDamage(self, self.realowner, autocvar_g_nades_nade_damage, autocvar_g_nades_nade_edgedamage,
 -                               autocvar_g_nades_nade_radius, self, autocvar_g_nades_nade_force, self.projectiledeathtype, self.enemy);
 +                               autocvar_g_nades_nade_radius, self, world, autocvar_g_nades_nade_force, self.projectiledeathtype, self.enemy);
  
        remove(self);
  }
@@@ -101,22 -101,22 +101,22 @@@ void nade_beep(
  
  void nade_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
  {
 -      if(DEATH_ISWEAPON(deathtype, WEP_LASER))
 +      if(DEATH_ISWEAPON(deathtype, WEP_BLASTER))
                return;
  
 -      if(DEATH_ISWEAPON(deathtype, WEP_NEX) || DEATH_ISWEAPON(deathtype, WEP_MINSTANEX))
 +      if(DEATH_ISWEAPON(deathtype, WEP_VORTEX) || DEATH_ISWEAPON(deathtype, WEP_VAPORIZER))
        {
                force *= 6;
                damage = self.max_health * 0.55;
        }
  
 -      if(DEATH_ISWEAPON(deathtype, WEP_UZI))
 +      if(DEATH_ISWEAPON(deathtype, WEP_MACHINEGUN))
                damage = self.max_health * 0.1;
  
 -      if(DEATH_ISWEAPON(deathtype, WEP_SHOTGUN) && !(deathtype & HITTYPE_SECONDARY))
 +      if((DEATH_ISWEAPON(deathtype, WEP_SHOCKWAVE) || DEATH_ISWEAPON(deathtype, WEP_SHOTGUN)) && !(deathtype & HITTYPE_SECONDARY)) // WEAPONTODO
                damage = self.max_health * 1.1;
  
 -      if(DEATH_ISWEAPON(deathtype, WEP_SHOTGUN) && (deathtype & HITTYPE_SECONDARY))
 +      if((DEATH_ISWEAPON(deathtype, WEP_SHOCKWAVE) || DEATH_ISWEAPON(deathtype, WEP_SHOTGUN)) && (deathtype & HITTYPE_SECONDARY))
        {
                damage = self.max_health * 0.1;
                force *= 15;
@@@ -169,16 -169,15 +169,15 @@@ void toss_nade(entity e, vector _veloci
        if (trace_startsolid)
                setorigin(_nade, e.origin);
  
-       if(e.crouch)
-               _nade.velocity = '0 0 -10';
+       if(self.v_angle_x >= 70 && self.v_angle_x <= 110)
+               _nade.velocity = '0 0 100';
        else if(autocvar_g_nades_nade_newton_style == 1)
                _nade.velocity = e.velocity + _velocity;
        else if(autocvar_g_nades_nade_newton_style == 2)
                _nade.velocity = _velocity;
        else
                _nade.velocity = W_CalculateProjectileVelocity(e.velocity, _velocity, TRUE);
-       //_nade.solid = SOLID_BBOX; // TODO: remember why this was needed
+               
        _nade.touch = nade_touch;
        _nade.health = autocvar_g_nades_nade_health;
        _nade.max_health = _nade.health;