]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Port spectatortime to ClientState
authorMario <mario@smbclan.net>
Sat, 15 Jul 2017 20:40:53 +0000 (06:40 +1000)
committerMario <mario@smbclan.net>
Sat, 15 Jul 2017 20:40:53 +0000 (06:40 +1000)
qcsrc/server/client.qc
qcsrc/server/client.qh
qcsrc/server/command/sv_cmd.qc

index aa19f060e4298ad2c239fd0da3179964796c01a5..128ef3dd6ddcc1d4532d8e9b82f34f5a4e9175ab 100644 (file)
@@ -291,7 +291,7 @@ void PutObserverInServer(entity this)
 
        accuracy_resend(this);
 
-       this.spectatortime = time;
+       CS(this).spectatortime = time;
        if(this.bot_attack)
                IL_REMOVE(g_bot_targets, this);
        this.bot_attack = false;
@@ -1224,7 +1224,7 @@ void ClientConnect(entity this)
 
        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);
@@ -2042,7 +2042,7 @@ void checkSpectatorBlock(entity this)
        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);
                }
index 510a6e271380553b8668bb35c2de8d161eaae6fc..03ff4775762f5db4d6f27ef34c0a3c0deba6f6bd 100644 (file)
@@ -82,6 +82,7 @@ CLASS(Client, Object)
     ATTRIB(Client, usekeypressed, bool, this.usekeypressed);
     ATTRIB(Client, motd_actived_time, float, this.motd_actived_time);
     ATTRIB(Client, jointime, float, this.jointime);
+    ATTRIB(Client, spectatortime, float, this.spectatortime);
 
     METHOD(Client, m_unwind, bool(Client this));
 
index 145e75952a81f9fd9e555292f26f666ee43473f8..4d181c4659d7dca887f99ca1c1c6f888911b7781 100644 (file)
@@ -1144,7 +1144,7 @@ void GameCommand_nospectators(float request)
                        FOREACH_CLIENT(IS_REAL_CLIENT(it) && (IS_SPEC(it) || IS_OBSERVER(it)) && !it.caplayer, LAMBDA(
                                if(!it.caplayer)
                                {
-                                       it.spectatortime = time;
+                                       CS(it).spectatortime = time;
                                        Send_Notification(NOTIF_ONE_ONLY, it, MSG_INFO, INFO_SPECTATE_WARNING, autocvar_g_maxplayers_spectator_blocktime);
                                }
                        ));