void send_CSQC_teamnagger() {
- WriteByte(MSG_BROADCAST, SVC_TEMPENTITY);
- WriteByte(MSG_BROADCAST, TE_CSQC_TEAMNAGGER);
+ WriteHeader(MSG_BROADCAST, TE_CSQC_TEAMNAGGER);
}
bool ClientData_Send(entity this, entity to, int sf)
if(e.porto_v_angle_held)
sf |= 8; // angles held
- WriteByte(MSG_ENTITY, ENT_CLIENT_CLIENTDATA);
+ WriteHeader(MSG_ENTITY, ENT_CLIENT_CLIENTDATA);
WriteByte(MSG_ENTITY, sf);
if(sf & 2)
void ClientData_Attach()
{SELFPARAM();
- Net_LinkEntity(self.clientdata = spawn(), false, 0, ClientData_Send);
- self.clientdata.drawonlytoclient = self;
- self.clientdata.owner = self;
+ Net_LinkEntity(this.clientdata = new(clientdata), false, 0, ClientData_Send);
+ make_pure(this.clientdata);
+ self.clientdata.drawonlytoclient = this;
+ self.clientdata.owner = this;
}
void ClientData_Detach()
self.weaponmodel = "";
for (int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
{
- self.weaponentity[slot] = NULL;
+ self.weaponentities[slot] = NULL;
}
self.exteriorweaponentity = world;
self.killcount = FRAGS_SPECTATOR;
this.revival_time = 0;
this.air_finished = time + 12;
- entity spawnevent = spawn();
+ entity spawnevent = new(spawnevent);
+ make_pure(spawnevent);
spawnevent.owner = this;
Net_LinkEntity(spawnevent, false, 0.5, SpawnEvent_Send);
for (int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
{
- CL_SpawnWeaponentity(this, slot);
+ CL_SpawnWeaponentity(this, weaponentities[slot]);
}
this.alpha = default_player_alpha;
this.colormod = '1 1 1' * autocvar_g_player_brightness;
// changes and just have a console command to update this?
bool ClientInit_SendEntity(entity this, entity to, int sf)
{
- WriteByte(MSG_ENTITY, ENT_CLIENT_INIT);
+ WriteHeader(MSG_ENTITY, ENT_CLIENT_INIT);
WriteByte(MSG_ENTITY, g_nexball_meter_period * 32);
WriteInt24_t(MSG_ENTITY, compressShotOrigin(hook_shotorigin[0]));
WriteInt24_t(MSG_ENTITY, compressShotOrigin(hook_shotorigin[1]));
void ClientInit_Spawn()
{SELFPARAM();
- entity e = spawn();
- e.classname = "clientinit";
+
+ entity e = new(clientinit);
+ make_pure(e);
e.think = ClientInit_CheckUpdate;
Net_LinkEntity(e, false, 0, ClientInit_SendEntity);
SetNewParms
=============
*/
-void SetNewParms (void)
+void SetNewParms ()
{
// initialize parms for a new player
parm1 = -(86400 * 366);
SetChangeParms
=============
*/
-void SetChangeParms (void)
+void SetChangeParms ()
{SELFPARAM();
// save parms for level change
parm1 = self.parm_idlesince - time;
DecodeLevelParms
=============
*/
-void DecodeLevelParms (void)
+void DecodeLevelParms ()
{SELFPARAM();
// load parms
self.parm_idlesince = parm1;
}
-void ClientKill (void)
+void ClientKill ()
{SELFPARAM();
if(gameover) return;
if(self.player_blocked) return;
Called once (not at each match start) when a client begins a connection to the server
=============
*/
-void ClientPreConnect (void)
+void ClientPreConnect ()
{SELFPARAM();
if(autocvar_sv_eventlog)
{
Called when a client connects to the server
=============
*/
-void DecodeLevelParms (void);
-void ClientConnect (void)
+void DecodeLevelParms ();
+void ClientConnect ()
{SELFPARAM();
float t;
*/
.entity chatbubbleentity;
void ReadyCount();
-void ClientDisconnect (void)
+void ClientDisconnect ()
{SELFPARAM();
if(self.vehicle)
vehicles_exit(VHEF_RELEASE);
// spawn a chatbubble entity if needed
if (!self.chatbubbleentity)
{
- self.chatbubbleentity = spawn();
+ self.chatbubbleentity = new(chatbubbleentity);
self.chatbubbleentity.owner = self;
self.chatbubbleentity.exteriormodeltoclient = self;
self.chatbubbleentity.think = ChatBubbleThink;
else self.colormod = '1 1 1';
}*/
-void respawn(void)
+void respawn()
{SELFPARAM();
if(self.alpha >= 0 && autocvar_g_respawn_ghosts)
{
_sound (self, CH_INFO, samp, VOL_BASE, ATTEN_NORM);
}
-void player_powerups (void)
+void player_powerups ()
{SELFPARAM();
// add a way to see what the items were BEFORE all of these checks for the mutator hook
int items_prev = self.items;
return current;
}
-void player_regen (void)
+void player_regen ()
{SELFPARAM();
float max_mod, regen_mod, rot_mod, limit_mod;
max_mod = regen_mod = rot_mod = limit_mod = 1;
if(!teamplay || autocvar_g_campaign || autocvar_g_balance_teams || (self.wasplayer && autocvar_g_changeteam_banned) || self.team_forced > 0)
{
self.classname = STR_PLAYER;
- nades_RemoveBonus(self);
if(autocvar_g_campaign || autocvar_g_balance_teams)
{ JoinBestTeam(self, false, true); }
{
if(self.BUTTON_INFO) // BUTTON_INFO hides initial MOTD
self.motd_actived_time = -2; // wait until BUTTON_INFO gets released
- else if(self.motd_actived_time == -2 || IS_PLAYER(self))
+ else if(self.motd_actived_time == -2 || IS_PLAYER(self) || IS_SPEC(self))
{
// instanctly hide MOTD
self.motd_actived_time = 0;
void() nexball_setstatus;
.float last_vehiclecheck;
.int items_added;
-void PlayerPreThink (void)
+void PlayerPreThink ()
{SELFPARAM();
WarpZone_PlayerPhysics_FixVAngle();
// WEAPONTODO: THIS SHIT NEEDS TO GO EVENTUALLY
// It cannot be predicted by the engine!
- int slot = 0; // TODO: unhardcode
- if((self.weapon == WEP_SHOCKWAVE.m_id || self.weapon == WEP_SHOTGUN.m_id) && self.weaponentity[slot].wframe == WFRAME_FIRE2 && time < self.weapon_nextthink)
+ .entity weaponentity = weaponentities[0]; // TODO: unhardcode
+ if((self.weapon == WEP_SHOCKWAVE.m_id || self.weapon == WEP_SHOTGUN.m_id) && self.(weaponentity).wframe == WFRAME_FIRE2 && time < self.(weaponentity).weapon_nextthink)
do_crouch = 0;
if (do_crouch)
=============
*/
.float idlekick_lasttimeleft;
-void PlayerPostThink (void)
+void PlayerPostThink ()
{SELFPARAM();
if(sv_maxidle > 0 && frametime) // WORKAROUND: only use dropclient in server frames (frametime set). Never use it in cl_movement frames (frametime zero).
if(IS_REAL_CLIENT(self))