FOREACH_CLIENT(IS_REAL_CLIENT(it) && it != e && IS_SPEC(it) && it.enemy == e, LAMBDA(it.clientdata.SendFlags = 1));
}
-.string netname_previous;
-
void SetSpectatee(entity this, entity spectatee);
void SetSpectatee_status(entity this, int spectatee_num);
accuracy_resend(this);
- this.spectatortime = time;
+ CS(this).spectatortime = time;
if(this.bot_attack)
IL_REMOVE(g_bot_targets, this);
this.bot_attack = false;
#ifdef WATERMARK
Send_Notification(NOTIF_ONE_ONLY, this, MSG_INFO, INFO_WATERMARK, WATERMARK);
#endif
- this.version_nagtime = time + 10 + random() * 10;
TRANSMUTE(Client, this);
+ CS(this).version_nagtime = time + 10 + random() * 10;
// identify the right forced team
if (autocvar_g_campaign)
this.just_joined = true; // stop spamming the eventlog with additional lines when the client connects
- this.netname_previous = strzone(this.netname);
+ CS(this).netname_previous = strzone(this.netname);
if(teamplay && IS_PLAYER(this))
Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(this.team, INFO_JOIN_CONNECT_TEAM), this.netname);
bot_relinkplayerlist();
- this.spectatortime = time;
+ CS(this).spectatortime = time;
if (blockSpectators)
{
Send_Notification(NOTIF_ONE_ONLY, this, MSG_INFO, INFO_SPECTATE_WARNING, autocvar_g_maxplayers_spectator_blocktime);
}
- this.jointime = time;
- this.allowed_timeouts = autocvar_sv_timeout_number;
+ CS(this).jointime = time;
+ CS(this).allowed_timeouts = autocvar_sv_timeout_number;
if (IS_REAL_CLIENT(this))
{
{
if (!autocvar_g_campaign && !IS_PLAYER(this))
{
- this.motd_actived_time = -1;
+ CS(this).motd_actived_time = -1;
Send_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CENTER_MOTD, getwelcomemessage(this));
}
}
PlayerStats_GameReport_FinalizePlayer(this);
if (this.vehicle) vehicles_exit(this.vehicle, VHEF_RELEASE);
- if (this.active_minigame) part_minigame(this);
+ if (CS(this).active_minigame) part_minigame(this);
if (IS_PLAYER(this)) Send_Effect(EFFECT_SPAWN_NEUTRAL, this.origin, '0 0 0', 1);
if (autocvar_sv_eventlog)
MUTATOR_CALLHOOK(ClientDisconnect, this);
+ if (CS(this).netname_previous) strunzone(CS(this).netname_previous); // needs to be before the CS entity is removed!
ClientState_detach(this);
Portal_ClearAll(this);
bot_relinkplayerlist();
- if (this.netname_previous) strunzone(this.netname_previous);
if (this.clientstatus) strunzone(this.clientstatus);
if (this.weaponorder_byimpulse) strunzone(this.weaponorder_byimpulse);
if (this.personal) delete(this.personal);
if ( !IS_DEAD(this.owner) && IS_PLAYER(this.owner) )
{
- if ( this.owner.active_minigame )
+ if ( CS(this.owner).active_minigame )
this.mdl = "models/sprites/minigame_busy.iqm";
else if (PHYS_INPUT_BUTTON_CHAT(this.owner))
this.mdl = "models/misc/chatbubble.spr";
if(!this.caplayer)
if(IS_REAL_CLIENT(this))
{
- if( time > (this.spectatortime + autocvar_g_maxplayers_spectator_blocktime) ) {
+ if( time > (CS(this).spectatortime + autocvar_g_maxplayers_spectator_blocktime) ) {
Send_Notification(NOTIF_ONE_ONLY, this, MSG_INFO, INFO_QUIT_KICK_SPECTATING);
dropclient(this);
}
void PrintWelcomeMessage(entity this)
{
- if(this.motd_actived_time == 0)
+ if(CS(this).motd_actived_time == 0)
{
if (autocvar_g_campaign) {
if ((IS_PLAYER(this) && PHYS_INPUT_BUTTON_INFO(this)) || (!IS_PLAYER(this))) {
- this.motd_actived_time = time;
+ CS(this).motd_actived_time = time;
Send_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CENTER_MOTD, campaign_message);
}
} else {
if (PHYS_INPUT_BUTTON_INFO(this)) {
- this.motd_actived_time = time;
+ CS(this).motd_actived_time = time;
Send_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CENTER_MOTD, getwelcomemessage(this));
}
}
}
- else if(this.motd_actived_time > 0) // showing MOTD or campaign message
+ else if(CS(this).motd_actived_time > 0) // showing MOTD or campaign message
{
if (autocvar_g_campaign) {
if (PHYS_INPUT_BUTTON_INFO(this))
- this.motd_actived_time = time;
- else if ((time - this.motd_actived_time > 2) && IS_PLAYER(this)) { // hide it some seconds after BUTTON_INFO has been released
- this.motd_actived_time = 0;
+ CS(this).motd_actived_time = time;
+ else if ((time - CS(this).motd_actived_time > 2) && IS_PLAYER(this)) { // hide it some seconds after BUTTON_INFO has been released
+ CS(this).motd_actived_time = 0;
Kill_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CPID_MOTD);
}
} else {
if (PHYS_INPUT_BUTTON_INFO(this))
- this.motd_actived_time = time;
- else if (time - this.motd_actived_time > 2) { // hide it some seconds after BUTTON_INFO has been released
- this.motd_actived_time = 0;
+ CS(this).motd_actived_time = time;
+ else if (time - CS(this).motd_actived_time > 2) { // hide it some seconds after BUTTON_INFO has been released
+ CS(this).motd_actived_time = 0;
Kill_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CPID_MOTD);
}
}
}
- else //if(this.motd_actived_time < 0) // just connected, motd is active
+ else //if(CS(this).motd_actived_time < 0) // just connected, motd is active
{
if(PHYS_INPUT_BUTTON_INFO(this)) // BUTTON_INFO hides initial MOTD
- this.motd_actived_time = -2; // wait until BUTTON_INFO gets released
- else if(this.motd_actived_time == -2 || IS_PLAYER(this) || IS_SPEC(this))
+ CS(this).motd_actived_time = -2; // wait until BUTTON_INFO gets released
+ else if(CS(this).motd_actived_time == -2 || IS_PLAYER(this) || IS_SPEC(this))
{
// instanctly hide MOTD
- this.motd_actived_time = 0;
+ CS(this).motd_actived_time = 0;
Kill_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CPID_MOTD);
}
}
this.netname = strzone(sprintf("Player#%d", this.playerid));
// stuffcmd(this, strcat("name ", this.netname, "\n")); // maybe?
}
- if (this.netname != this.netname_previous) {
+ if (this.netname != CS(this).netname_previous) {
if (autocvar_sv_eventlog) {
GameLogEcho(strcat(":name:", ftos(this.playerid), ":", playername(this, false)));
}
- if (this.netname_previous) strunzone(this.netname_previous);
- this.netname_previous = strzone(this.netname);
+ if (CS(this).netname_previous) strunzone(CS(this).netname_previous);
+ CS(this).netname_previous = strzone(this.netname);
}
// version nagging
- if (this.version_nagtime && this.cvar_g_xonoticversion && time > this.version_nagtime) {
- this.version_nagtime = 0;
+ if (CS(this).version_nagtime && this.cvar_g_xonoticversion && time > CS(this).version_nagtime) {
+ CS(this).version_nagtime = 0;
if (strstrofs(this.cvar_g_xonoticversion, "git", 0) >= 0 || strstrofs(this.cvar_g_xonoticversion, "autobuild", 0) >= 0) {
// git client
} else if (strstrofs(autocvar_g_xonoticversion, "git", 0) >= 0 || strstrofs(autocvar_g_xonoticversion, "autobuild", 0) >= 0) {
e.pusher = oldpusher;
}
- if (this.taunt_soundtime && time > this.taunt_soundtime) {
- this.taunt_soundtime = 0;
+ if (CS(this).taunt_soundtime && time > CS(this).taunt_soundtime) {
+ CS(this).taunt_soundtime = 0;
PlayerSound(this, playersound_taunt, CH_VOICE, VOL_BASEVOICE, VOICETYPE_AUTOTAUNT);
}