]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
ENT_CLIENT_INIT: stop sending weapon settings
authorTimePath <andrew.hardaker1995@gmail.com>
Thu, 10 Dec 2015 02:46:00 +0000 (13:46 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Thu, 10 Dec 2015 02:46:00 +0000 (13:46 +1100)
qcsrc/client/defs.qh
qcsrc/client/main.qc
qcsrc/client/main.qh
qcsrc/client/view.qc
qcsrc/client/weapons/projectile.qc
qcsrc/server/cl_client.qc

index 069598e3b4613c457f86d0479fdba2a4077edb4c..3e959b084ef753251abe18a338253d14f38896c9 100644 (file)
@@ -108,13 +108,6 @@ int w_deathtype;
 float w_issilent, w_random;
 vector w_org, w_backoff;
 
-float rifle_scope;
-float vortex_scope;
-
-float minelayer_maxmines;
-
-float hagar_maxrockets;
-
 float bgmtime;
 
 string weaponorder_byimpulse;
@@ -130,5 +123,4 @@ float uid2name_dialog;
 
 #define player_currententnum (spectatee_status > 0 ? spectatee_status : player_localnum + 1)
 
-float g_balance_porto_secondary;
 #endif
index f2df818aa62e2123ce86509934beac37b578788b..94225889db1897c9696e1e3631d078313a690abf 100644 (file)
@@ -908,22 +908,10 @@ NET_HANDLE(ENT_CLIENT_INIT, bool isnew)
 
        armorblockpercent = ReadByte() / 255.0;
 
-       g_balance_mortar_bouncefactor = ReadCoord();
-       g_balance_mortar_bouncestop = ReadCoord();
-       g_balance_electro_secondary_bouncefactor = ReadCoord();
-       g_balance_electro_secondary_bouncestop = ReadCoord();
-
-       vortex_scope = !ReadByte();
-       rifle_scope = !ReadByte();
-
        serverflags = ReadByte();
 
-       minelayer_maxmines = ReadByte();
-
-       hagar_maxrockets = ReadByte();
-
        g_trueaim_minrange = ReadCoord();
-       g_balance_porto_secondary = ReadByte();
+
        return = true;
 
        MUTATOR_CALLHOOK(Ent_Init);
index 91d5de09bd1b36de04e1b32c4735bd52e18b480c..49a92bb45ca483a399ea675076121a345fb7afa4 100644 (file)
@@ -136,10 +136,6 @@ const int HOOK_END =      2;
 
 .float ping, ping_packetloss, ping_movementloss;
 
-float g_balance_mortar_bouncefactor;
-float g_balance_mortar_bouncestop;
-float g_balance_electro_secondary_bouncefactor;
-float g_balance_electro_secondary_bouncestop;
 float g_trueaim_minrange;
 
 float hud;
index 85fea0d1b77c81406d4f4930beffd48895f05e69..e24e5bdf23dde70f0bacad810b152fc3409ffa96 100644 (file)
@@ -350,7 +350,7 @@ void Porto_Draw(entity this)
 
        if(activeweapon != WEP_PORTO || spectatee_status || gametype == MAPINFO_TYPE_NEXBALL)
                return;
-       if(g_balance_porto_secondary)
+       if(WEP_CVAR(porto, secondary))
                return;
        if(intermission == 1)
                return;
@@ -448,7 +448,7 @@ vector GetCurrentFov(float fov)
        zoomdir = button_zoom;
        if(hud == HUD_NORMAL)
        if(switchweapon == activeweapon)
-       if((activeweapon == WEP_VORTEX && vortex_scope) || (activeweapon == WEP_RIFLE && rifle_scope)) // do NOT use switchweapon here
+       if((activeweapon == WEP_VORTEX && !WEP_CVAR(vortex, secondary)) || (activeweapon == WEP_RIFLE && !WEP_CVAR(rifle, secondary))) // do NOT use switchweapon here
                zoomdir += button_attack2;
        if(spectatee_status > 0 || isdemo())
        {
@@ -1169,16 +1169,16 @@ void HUD_Crosshair()
                                        ring_rgb = wcross_color;
                                        ring_image = "gfx/crosshair_ring_nexgun.tga";
                                }
-                               else if (autocvar_crosshair_ring && activeweapon == WEP_MINE_LAYER && minelayer_maxmines && autocvar_crosshair_ring_minelayer)
+                               else if (autocvar_crosshair_ring && activeweapon == WEP_MINE_LAYER && WEP_CVAR(minelayer, limit) && autocvar_crosshair_ring_minelayer)
                                {
-                                       ring_value = bound(0, STAT(LAYED_MINES) / minelayer_maxmines, 1); // if you later need to use the count of bullets in another place, then add a float for it. For now, no need to.
+                                       ring_value = bound(0, STAT(LAYED_MINES) / WEP_CVAR(minelayer, limit), 1); // if you later need to use the count of bullets in another place, then add a float for it. For now, no need to.
                                        ring_alpha = autocvar_crosshair_ring_minelayer_alpha;
                                        ring_rgb = wcross_color;
                                        ring_image = "gfx/crosshair_ring.tga";
                                }
                                else if (activeweapon == WEP_HAGAR && STAT(HAGAR_LOAD) && autocvar_crosshair_ring_hagar)
                                {
-                                       ring_value = bound(0, STAT(HAGAR_LOAD) / hagar_maxrockets, 1);
+                                       ring_value = bound(0, STAT(HAGAR_LOAD) / WEP_CVAR_SEC(hagar, load_max), 1);
                                        ring_alpha = autocvar_crosshair_ring_hagar_alpha;
                                        ring_rgb = wcross_color;
                                        ring_image = "gfx/crosshair_ring.tga";
index 2100c3f5fd41d4680937b0adfc63ff7c10cf642e..1b79f7d589ca31497f01e4ddddae42ae5fb7ceab 100644 (file)
@@ -344,8 +344,8 @@ NET_HANDLE(ENT_CLIENT_PROJECTILE, bool isnew)
                                self.maxs = '0 0 -4';
                                self.move_movetype = MOVETYPE_BOUNCE;
                                self.move_touch = func_null;
-                               self.move_bounce_factor = g_balance_electro_secondary_bouncefactor;
-                               self.move_bounce_stopspeed = g_balance_electro_secondary_bouncestop;
+                               self.move_bounce_factor = WEP_CVAR_SEC(electro, bouncefactor);
+                               self.move_bounce_stopspeed = WEP_CVAR_SEC(electro, bouncestop);
                                break;
                        case PROJECTILE_RPC:
                        case PROJECTILE_ROCKET:
@@ -362,8 +362,8 @@ NET_HANDLE(ENT_CLIENT_PROJECTILE, bool isnew)
                                self.maxs = '3 3 3';
                                self.move_movetype = MOVETYPE_BOUNCE;
                                self.move_touch = func_null;
-                               self.move_bounce_factor = g_balance_mortar_bouncefactor;
-                               self.move_bounce_stopspeed = g_balance_mortar_bouncestop;
+                               self.move_bounce_factor = WEP_CVAR(mortar, bouncefactor);
+                               self.move_bounce_stopspeed = WEP_CVAR(mortar, bouncestop);
                                break;
                        case PROJECTILE_SHAMBLER_LIGHTNING:
                                self.mins = '-8 -8 -8';
@@ -444,8 +444,8 @@ NET_HANDLE(ENT_CLIENT_PROJECTILE, bool isnew)
                            self.maxs = '0 0 -4';
                            self.move_movetype = MOVETYPE_BOUNCE;
                            self.move_touch = func_null;
-                           self.move_bounce_factor = g_balance_electro_secondary_bouncefactor;
-                           self.move_bounce_stopspeed = g_balance_electro_secondary_bouncestop;
+                           self.move_bounce_factor = WEP_CVAR_SEC(electro, bouncefactor);
+                           self.move_bounce_stopspeed = WEP_CVAR_SEC(electro, bouncestop);
                            break;
                        */
                        default:
index 7d26e4f7bad0da78b257faa78966b6fe4da40beb..89cb2718583b980e091644a7f92d8adfa1c19e77 100644 (file)
@@ -656,17 +656,8 @@ bool ClientInit_SendEntity(entity this, entity to, int sf)
        else
                WriteString(channel, "");
        WriteByte(channel, self.count * 255.0); // g_balance_armor_blockpercent
-       WriteCoord(channel, self.bouncefactor); // g_balance_mortar_bouncefactor // WEAPONTODO
-       WriteCoord(channel, self.bouncestop); // g_balance_mortar_bouncestop
-       WriteCoord(channel, self.ebouncefactor); // g_balance_mortar_bouncefactor
-       WriteCoord(channel, self.ebouncestop); // g_balance_mortar_bouncestop
-       WriteByte(channel, WEP_CVAR(vortex, secondary)); // client has to know if it should zoom or not // WEAPONTODO
-       WriteByte(channel, WEP_CVAR(rifle, secondary)); // client has to know if it should zoom or not // WEAPONTODO
        WriteByte(channel, serverflags); // client has to know if it should zoom or not
-       WriteByte(channel, WEP_CVAR(minelayer, limit)); // minelayer max mines // WEAPONTODO
-       WriteByte(channel, WEP_CVAR_SEC(hagar, load_max)); // hagar max loadable rockets // WEAPONTODO
        WriteCoord(channel, autocvar_g_trueaim_minrange);
-       WriteByte(channel, WEP_CVAR(porto, secondary)); // WEAPONTODO
 
        MUTATOR_CALLHOOK(Ent_Init);
 }
@@ -679,26 +670,6 @@ void ClientInit_CheckUpdate()
                self.count = autocvar_g_balance_armor_blockpercent;
                self.SendFlags |= 1;
        }
-       if(self.bouncefactor != autocvar_g_balance_mortar_bouncefactor) // WEAPONTODO
-       {
-               self.bouncefactor = autocvar_g_balance_mortar_bouncefactor;
-               self.SendFlags |= 1;
-       }
-       if(self.bouncestop != autocvar_g_balance_mortar_bouncestop)
-       {
-               self.bouncestop = autocvar_g_balance_mortar_bouncestop;
-               self.SendFlags |= 1;
-       }
-       if(self.ebouncefactor != autocvar_g_balance_electro_secondary_bouncefactor)
-       {
-               self.ebouncefactor = autocvar_g_balance_electro_secondary_bouncefactor;
-               self.SendFlags |= 1;
-       }
-       if(self.ebouncestop != autocvar_g_balance_electro_secondary_bouncestop)
-       {
-               self.ebouncestop = autocvar_g_balance_electro_secondary_bouncestop;
-               self.SendFlags |= 1;
-       }
 }
 
 void ClientInit_Spawn()