]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Clean up STAT usage: this.camera_spectator --> STAT(CAMERA_SPECTATOR, this), remove... 339/head
authorterencehill <piuntn@gmail.com>
Tue, 19 Jul 2016 12:40:22 +0000 (14:40 +0200)
committerterencehill <piuntn@gmail.com>
Tue, 19 Jul 2016 12:40:22 +0000 (14:40 +0200)
qcsrc/common/stats.qh
qcsrc/server/cl_client.qc

index 4432929a1958ba8970ec6ebd8a1b7945944549d0..1e55ad009bf2919f8929c4b2585191833541e755 100644 (file)
@@ -246,8 +246,7 @@ REGISTER_STAT(DOM_PPS_PINK, float)
 REGISTER_STAT(TELEPORT_MAXSPEED, float, autocvar_g_teleport_maxspeed)
 REGISTER_STAT(TELEPORT_TELEFRAG_AVOID, int, autocvar_g_telefrags_avoid)
 
-.int camera_spectator;
-REGISTER_STAT(CAMERA_SPECTATOR, int, this.camera_spectator)
+REGISTER_STAT(CAMERA_SPECTATOR, int)
 
 REGISTER_STAT(SPECTATORSPEED, float)
 
index 2d81f5962dab98ed0ef52d2f1868bed323b957da..942bc4699d20dc6cb4416969ebfd417f864bff19 100644 (file)
@@ -1615,7 +1615,7 @@ void SpectateCopy(entity this, entity spectatee)
        this.angles = spectatee.v_angle;
        STAT(FROZEN, this) = STAT(FROZEN, spectatee);
        this.revive_progress = spectatee.revive_progress;
-       if(!PHYS_INPUT_BUTTON_USE(this) && this.camera_spectator != 2)
+       if(!PHYS_INPUT_BUTTON_USE(this) && STAT(CAMERA_SPECTATOR, this) != 2)
                this.fixangle = true;
        setorigin(this, spectatee.origin);
        setsize(this, spectatee.mins, spectatee.maxs);
@@ -1962,7 +1962,7 @@ void SpectatorThink(entity this)
 
                if (this.impulse == IMP_weapon_drop.impulse)
                {
-                       this.camera_spectator = (this.camera_spectator + 1) % 3;
+                       STAT(CAMERA_SPECTATOR, this) = (STAT(CAMERA_SPECTATOR, this) + 1) % 3;
                        this.impulse = 0;
                        return;
                }
@@ -2074,7 +2074,6 @@ Called every frame for each client before the physics are run
 .float usekeypressed;
 .float last_vehiclecheck;
 .int items_added;
-.float camera_spectator_stat = _STAT(CAMERA_SPECTATOR);
 void PlayerPreThink (entity this)
 {
        WarpZone_PlayerPhysics_FixVAngle(this);
@@ -2402,8 +2401,6 @@ void PlayerPreThink (entity this)
        // if a player goes unarmed after holding a loaded weapon, empty his clip size and remove the crosshair ammo ring
        if (PS(this).m_weapon == WEP_Null)
                this.clip_load = this.clip_size = 0;
-
-       this.camera_spectator_stat = this.camera_spectator;
 }
 
 void DrownPlayer(entity this)