From: Mario Date: Tue, 18 Jul 2017 13:50:49 +0000 (+1000) Subject: Port wasplayer to ClientState X-Git-Tag: xonotic-v0.8.5~2566 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8d1f829ba6ae9ff6dbfb4763df3fe2d2c474fc52;p=xonotic%2Fxonotic-data.pk3dir.git Port wasplayer to ClientState --- diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index 400d4b5b8..8f28e294d 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -501,7 +501,7 @@ void PutPlayerInServer(entity this) TRANSMUTE(Player, this); - this.wasplayer = true; + CS(this).wasplayer = true; this.iscreature = true; this.teleportable = TELEPORT_NORMAL; if(!this.damagedbycontents) @@ -1957,7 +1957,7 @@ void ShowRespawnCountdown(entity this) .bool team_selected; bool ShowTeamSelection(entity this) { - if(!teamplay || autocvar_g_campaign || autocvar_g_balance_teams || this.team_selected || (this.wasplayer && autocvar_g_changeteam_banned) || this.team_forced > 0) + if(!teamplay || autocvar_g_campaign || autocvar_g_balance_teams || this.team_selected || (CS(this).wasplayer && autocvar_g_changeteam_banned) || this.team_forced > 0) return false; stuffcmd(this, "menu_showteamselect\n"); return true; diff --git a/qcsrc/server/client.qh b/qcsrc/server/client.qh index e23c69bae..af4d3d693 100644 --- a/qcsrc/server/client.qh +++ b/qcsrc/server/client.qh @@ -107,6 +107,7 @@ CLASS(Client, Object) ATTRIB(Client, specialcommand_pos, int, this.specialcommand_pos); ATTRIB(Client, hitplotfh, int, this.hitplotfh); ATTRIB(Client, clientdata, entity, this.clientdata); + ATTRIB(Client, wasplayer, bool, this.wasplayer); METHOD(Client, m_unwind, bool(Client this)); diff --git a/qcsrc/server/command/cmd.qc b/qcsrc/server/command/cmd.qc index 6d7ee81af..03f484d2e 100644 --- a/qcsrc/server/command/cmd.qc +++ b/qcsrc/server/command/cmd.qc @@ -354,7 +354,7 @@ void ClientCommand_selectteam(entity caller, float request, float argc) { sprint(caller, "^7You already are on that team.\n"); } - else if (caller.wasplayer && autocvar_g_changeteam_banned) + else if (CS(caller).wasplayer && autocvar_g_changeteam_banned) { sprint(caller, "^1You cannot change team, forbidden by the server.\n"); } diff --git a/qcsrc/server/defs.qh b/qcsrc/server/defs.qh index a18e54d2a..7a268e31c 100644 --- a/qcsrc/server/defs.qh +++ b/qcsrc/server/defs.qh @@ -283,7 +283,7 @@ void ClientData_Touch(entity e); //vector debug_shotorg; // if non-zero, overrides the shot origin of all weapons -.float wasplayer; +.bool wasplayer; float servertime, serverprevtime, serverframetime; diff --git a/qcsrc/server/teamplay.qc b/qcsrc/server/teamplay.qc index d991794b7..2d6ceb8e0 100644 --- a/qcsrc/server/teamplay.qc +++ b/qcsrc/server/teamplay.qc @@ -650,7 +650,7 @@ void SV_ChangeTeam(entity this, float _color) return; } - if((autocvar_g_campaign) || (autocvar_g_changeteam_banned && this.wasplayer)) { + if((autocvar_g_campaign) || (autocvar_g_changeteam_banned && CS(this).wasplayer)) { Send_Notification(NOTIF_ONE, this, MSG_INFO, INFO_TEAMCHANGE_NOTALLOWED); return; // changing teams is not allowed }