Merge branch 'master' into Mario/entcs
authorMario <mario@smbclan.net>
Sun, 21 Aug 2016 08:01:06 +0000 (18:01 +1000)
committerMario <mario@smbclan.net>
Sun, 21 Aug 2016 08:01:06 +0000 (18:01 +1000)
1  2 
qcsrc/client/_all.qh
qcsrc/client/hud/hud.qc
qcsrc/client/hud/hud.qh
qcsrc/client/view.qc
qcsrc/common/weapons/weapon/arc.qc
qcsrc/common/weapons/weapon/vaporizer.qc
qcsrc/server/teamplay.qc

diff --combined qcsrc/client/_all.qh
index 828f02794a7d0c8847a8a9277a740efe44735ab5,5e5b55e313ae38a9355221fb79aabcb8401c429e..077b5f450a5ff2eee4b0ca4dd52a5aee382c77ee
@@@ -1,4 -1,5 +1,5 @@@
  #pragma once
+ //#include "_mod.qh"
  
  #include <common/util.qh>
  
@@@ -10,5 -11,3 +11,5 @@@
  #include "defs.qh"
  #include "main.qh"
  #include "miscfunctions.qh"
 +
 +#include <common/ent_cs.qh>
diff --combined qcsrc/client/hud/hud.qc
index ef8afcb19638c709557e392edb93a8f63812062f,91dc98fdcb2c32f7efa917bafd3b8912c1574644..f9ac20627518e16b4fbcec3b225b8540a6908e21
@@@ -1,11 -1,13 +1,13 @@@
  #include "hud.qh"
  
+ #include "panel/scoreboard.qh"
  #include "hud_config.qh"
  #include "../mapvoting.qh"
  #include "../teamradar.qh"
  #include <common/t_items.qh>
  #include <common/deathtypes/all.qh>
- #include <common/items/all.qc>
+ #include <common/items/_mod.qh>
  #include <common/mapinfo.qh>
  #include <common/vehicles/all.qh>
  #include <common/mutators/mutator/waypoints/all.qh>
@@@ -334,8 -336,6 +336,6 @@@ void DrawNumIcon(vector myPos, vector m
        DrawNumIcon_expanding(myPos, mySize, x, icon, vertical, icon_right_align, color, theAlpha, 0);
  }
  
- #include "all.inc"
  /*
  ==================
  Main HUD system
@@@ -357,6 -357,8 +357,8 @@@ void HUD_Vehicle(
        }
  }
  
+ bool HUD_Minigame_Showpanels();
  bool HUD_Panel_CheckFlags(int showflags)
  {
      TC(int, showflags);
@@@ -413,6 -415,7 +415,7 @@@ bool Hud_Shake_Update(
        return true;
  }
  
+ entity CSQCModel_server2csqc(int i);
  void calc_followmodel_ofs(entity view);
  void Hud_Dynamic_Frame()
  {
@@@ -556,11 -559,11 +559,11 @@@ void HUD_Main(
                {
                        string hud_dock_color = autocvar_hud_dock_color;
                        if(hud_dock_color == "shirt") {
 -                              f = stof(getplayerkeyvalue(current_player, "colors"));
 +                              f = entcs_GetClientColors(current_player);
                                color = colormapPaletteColor(floor(f / 16), 0);
                        }
                        else if(hud_dock_color == "pants") {
 -                              f = stof(getplayerkeyvalue(current_player, "colors"));
 +                              f = entcs_GetClientColors(current_player);
                                color = colormapPaletteColor(f % 16, 1);
                        }
                        else
diff --combined qcsrc/client/hud/hud.qh
index 66db85fd8638618eb1cda825899c546a5cff9d40,7ee177524bea40d90eb5c547183ddba56a7859a4..3aa5d8f8c9071996445568e3d33f0621ba61f27d
@@@ -1,6 -1,6 +1,6 @@@
  #pragma once
  
- #include <common/weapons/all.qh>
+ #include <common/weapons/_all.qh>
  
  bool HUD_Radar_Clickable();
  void HUD_Radar_Mouse();
@@@ -280,9 -280,9 +280,9 @@@ REGISTER_HUD_PANEL(SCOREBOARD,      Sco
                        panel_bg_color = autocvar_hud_panel_bg_color;                                                           \
                } else {                                                                                                    \
                        if (panel_bg_color_str == "shirt") {                                                                    \
 -                              panel_bg_color = colormapPaletteColor(floor(stof(getplayerkeyvalue(current_player, "colors")) / 16), 0); \
 +                              panel_bg_color = colormapPaletteColor(floor(entcs_GetClientColors(current_player) / 16), 0); \
                        } else if (panel_bg_color_str == "pants") {                                                             \
 -                              panel_bg_color = colormapPaletteColor(stof(getplayerkeyvalue(current_player, "colors")) % 16, 1); \
 +                              panel_bg_color = colormapPaletteColor(entcs_GetClientColors(current_player) % 16, 1); \
                        } else {                                                                                                \
                                panel_bg_color = stov(panel_bg_color_str);                                                          \
                        }                                                                                                       \
diff --combined qcsrc/client/view.qc
index ddd16ec02e420fd6a128d14a4b2039744a98f0b1,c629ab30c32bdd33987f3f087f465ee88f15a56c..2226200521e27683e51cc5f640324be655ce447c
@@@ -1,7 -1,7 +1,7 @@@
  #include "view.qh"
  
  #include "announcer.qh"
- #include "hud/all.qh"
+ #include "hud/_mod.qh"
  #include "mapvoting.qh"
  #include "shownames.qh"
  #include "hud/panel/scoreboard.qh"
  #include <common/constants.qh>
  #include <common/debug.qh>
  #include <common/mapinfo.qh>
- #include <common/gamemodes/all.qh>
+ #include <common/gamemodes/_mod.qh>
  #include <common/physics/player.qh>
  #include <common/stats.qh>
  #include <common/triggers/target/music.qh>
  #include <common/teams.qh>
  
  #include <common/vehicles/all.qh>
- #include <common/weapons/all.qh>
+ #include <common/weapons/_all.qh>
  #include <common/viewloc.qh>
  #include <common/minigames/cl_minigames.qh>
  #include <common/minigames/cl_minigames_hud.qh>
@@@ -293,7 -293,7 +293,7 @@@ void viewmodel_draw(entity this
        else if (wasinvehicle) a = 1;
        wasinvehicle = invehicle;
        Weapon wep = activeweapon;
 -      int c = stof(getplayerkeyvalue(current_player, "colors"));
 +      int c = entcs_GetClientColors(current_player);
        vector g = weaponentity_glowmod(wep, c);
        entity me = CSQCModel_server2csqc(player_localentnum - 1);
        int fx = ((me.csqcmodel_effects & EFMASK_CHEAP)
index abd30509f04c8e9447261d066189c58fdb554c2a,895d2c13b0b009aadbe205c7580fa72ec01fb5e3..1f8b8e7f085e7d6e6484095e3cb4a6cb279dcea5
@@@ -1,3 -1,4 +1,4 @@@
+ #include "arc.qh"
  #ifndef IMPLEMENTATION
  CLASS(Arc, Weapon)
  /* ammotype  */ ATTRIB(Arc, ammo_field, .int, ammo_cells);
@@@ -6,7 -7,7 +7,7 @@@
  /* rating    */ ATTRIB(Arc, bot_pickupbasevalue, float, BOT_PICKUP_RATING_HIGH);
  /* color     */ ATTRIB(Arc, wpcolor, vector, '1 1 1');
  /* modelname */ ATTRIB(Arc, mdl, string, "arc");
- #ifndef MENUQC
+ #ifdef GAMEQC
  /* model     */ ATTRIB(Arc, m_model, Model, MDL_ARC_ITEM);
  #endif
  /* crosshair */ ATTRIB(Arc, w_crosshair, string, "gfx/crosshairhlac");
@@@ -74,7 -75,7 +75,7 @@@ ENDCLASS(Arc
  REGISTER_WEAPON(ARC, arc, NEW(Arc));
  
  
- #ifndef MENUQC
+ #ifdef GAMEQC
  const float ARC_MAX_SEGMENTS = 20;
  vector arc_shotorigin[4];
  .vector beam_start;
@@@ -1397,7 -1398,7 +1398,7 @@@ NET_HANDLE(ENT_CLIENT_ARC_BEAM, bool is
        {
                this.beam_type = ReadByte();
  
 -              vector beamcolor = ((autocvar_cl_arcbeam_teamcolor) ? colormapPaletteColor(stof(getplayerkeyvalue(this.sv_entnum - 1, "colors")) & 0x0F, true) : '1 1 1');
 +              vector beamcolor = ((autocvar_cl_arcbeam_teamcolor) ? colormapPaletteColor(entcs_GetClientColors(this.sv_entnum - 1) & 0x0F, true) : '1 1 1');
                switch(this.beam_type)
                {
                        case ARC_BT_MISS:
index 7badd5d2bc7d24f9f018363da342bb5d8d83374e,91cf8e9da4353e30556ba7d520d2d1f5015c88a6..d9c215e24b9d0ca5541875eee81f3fb99331c5c2
@@@ -1,3 -1,4 +1,4 @@@
+ #include "vaporizer.qh"
  #ifndef IMPLEMENTATION
  CLASS(Vaporizer, Weapon)
  /* ammotype  */ ATTRIB(Vaporizer, ammo_field, .int, ammo_cells);
@@@ -6,7 -7,7 +7,7 @@@
  /* rating    */ ATTRIB(Vaporizer, bot_pickupbasevalue, float, BOT_PICKUP_RATING_HIGH);
  /* color     */ ATTRIB(Vaporizer, wpcolor, vector, '0.5 1 1');
  /* modelname */ ATTRIB(Vaporizer, mdl, string, "minstanex");
- #ifndef MENUQC
+ #ifdef GAMEQC
  /* model     */ ATTRIB(Vaporizer, m_model, Model, MDL_VAPORIZER_ITEM);
  #endif
  /* crosshair */ ATTRIB(Vaporizer, w_crosshair, string, "gfx/crosshairminstanex");
@@@ -111,7 -112,7 +112,7 @@@ void VaporizerBeam_Draw(entity this
        //entity e = CSQCModel_server2csqc(this.sv_entnum - 1);
        //if (e == NULL)
        //{
 -              rgb = colormapPaletteColor(stof(getplayerkeyvalue(this.sv_entnum - 1, "colors")) & 0x0F, true);
 +              rgb = colormapPaletteColor(entcs_GetClientColors(this.sv_entnum - 1) & 0x0F, true);
                //rgb = '1 1 1';
        //}
        //else
diff --combined qcsrc/server/teamplay.qc
index 9af668f14e9f1b7805ae7172be18adf9b3d63c0a,f429628b01a05d1d82541292fbeeb14aa2989cf5..de7f2f992617320717d079bd86ea8c8c68f91ed6
@@@ -1,6 -1,6 +1,6 @@@
  #include "teamplay.qh"
  
- #include "cl_client.qh"
+ #include "client.qh"
  #include "race.qh"
  #include "scores.qh"
  #include "scores_rules.qh"
@@@ -9,10 -9,10 +9,10 @@@
  
  #include "command/vote.qh"
  
- #include "mutators/all.qh"
+ #include "mutators/_mod.qh"
  
  #include "../common/deathtypes/all.qh"
- #include "../common/gamemodes/all.qh"
+ #include "../common/gamemodes/_mod.qh"
  #include "../common/teams.qh"
  
  void TeamchangeFrags(entity e)
@@@ -158,16 -158,6 +158,16 @@@ string getwelcomemessage(entity this
        return s;
  }
  
 +void setcolor(entity this, int clr)
 +{
 +#if 0
 +      this.clientcolors = clr;
 +      this.team = (clr & 15) + 1;
 +#else
 +      builtin_setcolor(this, clr);
 +#endif
 +}
 +
  void SetPlayerColors(entity pl, float _color)
  {
        /*string s;
@@@ -552,7 -542,7 +552,7 @@@ int JoinBestTeam(entity this, bool only
                                SetPlayerColors(this, selectedteam - 1);
  
                                // when JoinBestTeam is called by client.qc/ClientKill_Now_TeamChange the players team is -1 and thus skipped
-                               // when JoinBestTeam is called by cl_client.qc/ClientConnect the player_id is 0 the log attempt is rejected
+                               // when JoinBestTeam is called by client.qc/ClientConnect the player_id is 0 the log attempt is rejected
                                LogTeamchange(this.playerid, this.team, 99);
                        }
                        return selectedteam;