From 29d0eb9c0ef79d820a07dd7a8fd6cfcdb7e9d1df Mon Sep 17 00:00:00 2001 From: terencehill Date: Tue, 19 Jul 2016 14:40:22 +0200 Subject: [PATCH] Clean up STAT usage: this.camera_spectator --> STAT(CAMERA_SPECTATOR, this), remove camera_spectator_stat field --- qcsrc/common/stats.qh | 3 +-- qcsrc/server/cl_client.qc | 7 ++----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/qcsrc/common/stats.qh b/qcsrc/common/stats.qh index 4432929a1..1e55ad009 100644 --- a/qcsrc/common/stats.qh +++ b/qcsrc/common/stats.qh @@ -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) diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index 2d81f5962..942bc4699 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -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) -- 2.39.2