]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Port zoomstate and spectatee_status to ClientState
authorMario <mario@smbclan.net>
Sun, 16 Jul 2017 10:33:06 +0000 (20:33 +1000)
committerMario <mario@smbclan.net>
Sun, 16 Jul 2017 10:33:06 +0000 (20:33 +1000)
qcsrc/server/client.qc
qcsrc/server/client.qh

index b29f785b9cdc5e49f89fa50b4903e9a2ff9643d5..9b105a28aec00d5ab6e31d3d61b79b8dee762481 100644 (file)
@@ -111,8 +111,8 @@ bool ClientData_Send(entity this, entity to, int sf)
 
        sf = 0;
        if (e.race_completed)       sf |= 1; // forced scoreboard
-       if (to.spectatee_status)    sf |= 2; // spectator ent number follows
-       if (e.zoomstate)            sf |= 4; // zoomed
+       if (CS(to).spectatee_status)    sf |= 2; // spectator ent number follows
+       if (CS(e).zoomstate)            sf |= 4; // zoomed
        if (autocvar_sv_showspectators) sf |= 16; // show spectators
 
        WriteHeader(MSG_ENTITY, ENT_CLIENT_CLIENTDATA);
@@ -120,7 +120,7 @@ bool ClientData_Send(entity this, entity to, int sf)
 
        if (sf & 2)
        {
-               WriteByte(MSG_ENTITY, to.spectatee_status);
+               WriteByte(MSG_ENTITY, CS(to).spectatee_status);
        }
 
        if(sf & 16)
@@ -1662,9 +1662,9 @@ void player_regen(entity this)
 bool zoomstate_set;
 void SetZoomState(entity this, float newzoom)
 {
-       if(newzoom != this.zoomstate)
+       if(newzoom != CS(this).zoomstate)
        {
-               this.zoomstate = newzoom;
+               CS(this).zoomstate = newzoom;
                ClientData_Touch(this);
        }
        zoomstate_set = true;
@@ -1742,7 +1742,7 @@ void SpectateCopy(entity this, entity spectatee)
                this.fixangle = true;
        setorigin(this, spectatee.origin);
        setsize(this, spectatee.mins, spectatee.maxs);
-       SetZoomState(this, spectatee.zoomstate);
+       SetZoomState(this, CS(spectatee).zoomstate);
 
        for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
        {
@@ -1822,10 +1822,10 @@ bool SpectateSet(entity this)
 
 void SetSpectatee_status(entity this, int spectatee_num)
 {
-       int oldspectatee_status = this.spectatee_status;
-       this.spectatee_status = spectatee_num;
+       int oldspectatee_status = CS(this).spectatee_status;
+       CS(this).spectatee_status = spectatee_num;
 
-       if (this.spectatee_status != oldspectatee_status)
+       if (CS(this).spectatee_status != oldspectatee_status)
        {
                ClientData_Touch(this);
                if (g_race || g_cts) race_InitSpectator();
index be6cc0d605e308191fb601024937f05b741f2551..ae4a08f90f6c7f11b4b5373ccfbf9ab0cd104ad9 100644 (file)
@@ -91,6 +91,8 @@ CLASS(Client, Object)
     ATTRIB(Client, killcount, int, this.killcount);
     ATTRIB(Client, version_mismatch, bool, this.version_mismatch);
     ATTRIB(Client, version, int, this.version);
+    ATTRIB(Client, spectatee_status, int, this.spectatee_status);
+    ATTRIB(Client, zoomstate, bool, this.zoomstate);
 
     METHOD(Client, m_unwind, bool(Client this));