]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/state.qh
Merge branch 'master' into Mario/entrap_nade
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / state.qh
index 64ae3e7fe62f087accb4e01d0cfd65ba428940eb..110df1c575840421fb05a47ebb66cc16c89f8efa 100644 (file)
@@ -17,6 +17,7 @@ CLASS(PlayerState, Object)
        ATTRIB(PlayerState, m_weapon, Weapon, Weapons_from(-1))
        METHOD(PlayerState, ps_push, void(PlayerState this, entity cl))
        {
+           TC(PlayerState, this);
                STAT(ACTIVEWEAPON, cl) = this.m_weapon.m_id;
                STAT(SWITCHINGWEAPON, cl) = this.m_switchingweapon.m_id;
                STAT(SWITCHWEAPON, cl) = this.m_switchweapon.m_id;
@@ -24,11 +25,7 @@ CLASS(PlayerState, Object)
 ENDCLASS(PlayerState)
 
 .PlayerState _ps;
-#if NDEBUG
-       #define PS(this) (this._ps)
-#else
-       PlayerState PS(entity this) { assert(IS_CLIENT(this)); return this._ps; }
-#endif
+#define PS(this) ((this)._ps)
 
 // TODO: renew on death
 void PlayerState_attach(entity this);
@@ -53,7 +50,7 @@ ENDCLASS(ClientState)
 #if NDEBUG
        #define CS(this) (this._cs)
 #else
-       ClientState CS(entity this) { assert(IS_CLIENT(this)); assert(this._cs); return this._cs; }
+       ClientState CS(Client this) { TC(Client, this); assert(this._cs); return this._cs; }
 #endif
 
 void ClientState_attach(entity this);