From b5cf8b692a528e0339c0f7a597781b7f8ae1fdc9 Mon Sep 17 00:00:00 2001 From: TimePath Date: Thu, 10 Dec 2015 13:46:00 +1100 Subject: [PATCH] ENT_CLIENT_INIT: stop sending weapon settings --- qcsrc/client/defs.qh | 8 -------- qcsrc/client/main.qc | 14 +------------- qcsrc/client/main.qh | 4 ---- qcsrc/client/view.qc | 10 +++++----- qcsrc/client/weapons/projectile.qc | 12 ++++++------ qcsrc/server/cl_client.qc | 29 ----------------------------- 6 files changed, 12 insertions(+), 65 deletions(-) diff --git a/qcsrc/client/defs.qh b/qcsrc/client/defs.qh index 069598e3b..3e959b084 100644 --- a/qcsrc/client/defs.qh +++ b/qcsrc/client/defs.qh @@ -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 diff --git a/qcsrc/client/main.qc b/qcsrc/client/main.qc index f2df818aa..94225889d 100644 --- a/qcsrc/client/main.qc +++ b/qcsrc/client/main.qc @@ -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); diff --git a/qcsrc/client/main.qh b/qcsrc/client/main.qh index 91d5de09b..49a92bb45 100644 --- a/qcsrc/client/main.qh +++ b/qcsrc/client/main.qh @@ -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; diff --git a/qcsrc/client/view.qc b/qcsrc/client/view.qc index 85fea0d1b..e24e5bdf2 100644 --- a/qcsrc/client/view.qc +++ b/qcsrc/client/view.qc @@ -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"; diff --git a/qcsrc/client/weapons/projectile.qc b/qcsrc/client/weapons/projectile.qc index 2100c3f5f..1b79f7d58 100644 --- a/qcsrc/client/weapons/projectile.qc +++ b/qcsrc/client/weapons/projectile.qc @@ -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: diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index 7d26e4f7b..89cb27185 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -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() -- 2.39.2