From: FruitieX Date: Thu, 29 Jul 2010 17:53:12 +0000 (+0300) Subject: handle CR and nex scope sending in a better way X-Git-Tag: xonotic-v0.1.0preview~391 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=d31d658cac27f3558c90698a6dc32cbc77e4c8d2;p=xonotic%2Fxonotic-data.pk3dir.git handle CR and nex scope sending in a better way --- diff --git a/qcsrc/client/Main.qc b/qcsrc/client/Main.qc index 78b45fae3..d1a76320f 100644 --- a/qcsrc/client/Main.qc +++ b/qcsrc/client/Main.qc @@ -1050,6 +1050,9 @@ void Ent_Init() g_balance_grenadelauncher_secondary_bouncefactor = ReadCoord(); g_balance_grenadelauncher_secondary_bouncestop = ReadCoord(); + nex_scope = !ReadByte(); + campingrifle_scope = !ReadByte(); + if(!postinit) PostInit(); } @@ -1277,14 +1280,6 @@ void Net_WeaponComplain() { complain_weapon_time = time; } -void Net_CampingrifleScope() { - campingrifle_scope = TRUE; -} - -void Net_NexScope() { - nex_scope = TRUE; -} - // CSQC_Parse_TempEntity : Handles all temporary entity network data in the CSQC layer. // You must ALWAYS first acquire the temporary ID, which is sent as a byte. // Return value should be 1 if CSQC handled the temporary entity, otherwise return 0 to have the engine process the event. @@ -1355,14 +1350,6 @@ float CSQC_Parse_TempEntity() Net_WeaponComplain(); bHandled = true; break; - case TE_CSQC_CAMPINGRIFLE_SCOPE: - Net_CampingrifleScope(); - bHandled = true; - break; - case TE_CSQC_NEX_SCOPE: - Net_NexScope(); - bHandled = true; - break; default: // No special logic for this temporary entity; return 0 so the engine can handle it bHandled = false; diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index 9244c93eb..dcebed41a 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -1083,6 +1083,8 @@ float ClientInit_SendEntity(entity to, float sf) WriteByte(MSG_ENTITY, self.cnt * 255.0); // g_balance_weaponswitchdelay WriteCoord(MSG_ENTITY, self.bouncefactor); // g_balance_grenadelauncher_secondary_bouncefactor WriteCoord(MSG_ENTITY, self.bouncestop); // g_balance_grenadelauncher_secondary_bouncestop + WriteByte(MSG_ENTITY, cvar("g_balance_nex_secondary")); // client has to know if it should zoom or not + WriteByte(MSG_ENTITY, cvar("g_balance_campingrifle_secondary")); // client has to know if it should zoom or not return TRUE; } diff --git a/qcsrc/server/w_campingrifle.qc b/qcsrc/server/w_campingrifle.qc index f14d5689b..1cd280e00 100644 --- a/qcsrc/server/w_campingrifle.qc +++ b/qcsrc/server/w_campingrifle.qc @@ -173,7 +173,6 @@ void W_CampingRifle_BulletHail(float mode, void(void) AttackFunc, float fr, floa } .float bot_secondary_campingriflemooth; -.float sent_campingrifle_scope; float w_campingrifle(float req) { float full; @@ -231,17 +230,6 @@ float w_campingrifle(float req) self.campingrifle_accumulator += cvar("g_balance_campingrifle_secondary_burstcost"); } } - else - { - if(clienttype(self) == CLIENTTYPE_REAL) - if(!self.sent_campingrifle_scope) - { - msg_entity = self; - WriteByte(MSG_ONE, SVC_TEMPENTITY); - WriteByte(MSG_ONE, TE_CSQC_CAMPINGRIFLE_SCOPE); - self.sent_campingrifle_scope = 1; - } - } } } } diff --git a/qcsrc/server/w_nex.qc b/qcsrc/server/w_nex.qc index 3a85e113a..a6ec07d6a 100644 --- a/qcsrc/server/w_nex.qc +++ b/qcsrc/server/w_nex.qc @@ -64,7 +64,6 @@ void W_Nex_Attack (float issecondary) void spawnfunc_weapon_nex (void); // defined in t_items.qc -.float sent_nex_scope; float w_nex(float req) { if (req == WR_AIM) @@ -92,17 +91,6 @@ float w_nex(float req) weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_nex_secondary_animtime"), w_ready); } } - else - { - if(clienttype(self) == CLIENTTYPE_REAL) - if(!self.sent_nex_scope) - { - msg_entity = self; - WriteByte(MSG_ONE, SVC_TEMPENTITY); - WriteByte(MSG_ONE, TE_CSQC_NEX_SCOPE); - self.sent_nex_scope = 1; - } - } } } else if (req == WR_PRECACHE)