g_balance_grenadelauncher_secondary_bouncefactor = ReadCoord();
g_balance_grenadelauncher_secondary_bouncestop = ReadCoord();
+ nex_scope = !ReadByte();
+ campingrifle_scope = !ReadByte();
+
if(!postinit)
PostInit();
}
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.
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;
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;
}
}
.float bot_secondary_campingriflemooth;
-.float sent_campingrifle_scope;
float w_campingrifle(float req)
{
float full;
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;
- }
- }
}
}
}
void spawnfunc_weapon_nex (void); // defined in t_items.qc
-.float sent_nex_scope;
float w_nex(float req)
{
if (req == WR_AIM)
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)