]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Port wasplayer to ClientState
authorMario <mario@smbclan.net>
Tue, 18 Jul 2017 13:50:49 +0000 (23:50 +1000)
committerMario <mario@smbclan.net>
Tue, 18 Jul 2017 13:50:49 +0000 (23:50 +1000)
qcsrc/server/client.qc
qcsrc/server/client.qh
qcsrc/server/command/cmd.qc
qcsrc/server/defs.qh
qcsrc/server/teamplay.qc

index 400d4b5b8e0c199646ab9436825e9335ebbb0931..8f28e294d8e581eddec41179313e8c08b6a20308 100644 (file)
@@ -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;
index e23c69bae156fbb14850f372a68732e7eeb10f9c..af4d3d693a0bec4ba65d531bef22879c897cdfa6 100644 (file)
@@ -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));
 
index 6d7ee81af4ddc7807696a6085ebe11073ebba5c3..03f484d2e68f566e42c526a7239a88bacf0312ec 100644 (file)
@@ -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");
                                                                        }
index a18e54d2abf6574933d362d361eb0c68d8855ad6..7a268e31c573bd2fbf8fde5e00b4f5d206bbdc16 100644 (file)
@@ -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;
 
index d991794b75b69e9107c48577fe89602821a291bd..2d6ceb8e0257f3546820544f276cb873d946e863 100644 (file)
@@ -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
        }