]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/state.qh
Merge branch 'master' into Mirio/balance
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / state.qh
index 4e80bfd2cd971338acba75cf50b55de0d9e74859..94b9bc325f26288ebe8ccc8ff8cf67756366c334 100644 (file)
@@ -6,15 +6,15 @@
  * Server: instance per client, clients decoupled from players
  */
 CLASS(PlayerState, Object)
-       ATTRIB(PlayerState, m_client, entity, NULL)
+       ATTRIB(PlayerState, m_client, entity);
        CONSTRUCTOR(PlayerState, entity client)
        {
                CONSTRUCT(PlayerState);
                this.m_client = client;
        }
-       ATTRIB(PlayerState, m_switchingweapon, Weapon, Weapons_from(-1))
-       ATTRIB(PlayerState, m_switchweapon, Weapon, Weapons_from(-1))
-       ATTRIB(PlayerState, m_weapon, Weapon, Weapons_from(-1))
+       ATTRIB(PlayerState, m_switchingweapon, Weapon, Weapons_from(-1));
+       ATTRIB(PlayerState, m_switchweapon, Weapon, Weapons_from(-1));
+       ATTRIB(PlayerState, m_weapon, Weapon, Weapons_from(-1));
        METHOD(PlayerState, ps_push, void(PlayerState this, entity cl))
        {
            TC(PlayerState, this);
@@ -25,7 +25,7 @@ CLASS(PlayerState, Object)
 ENDCLASS(PlayerState)
 
 .PlayerState _ps;
-#define PS(this) (this._ps)
+#define PS(this) ((this)._ps)
 
 // TODO: renew on death
 void PlayerState_attach(entity this);
@@ -37,7 +37,7 @@ void PlayerState_detach(entity this);
  * Server: instance per client
  */
 CLASS(ClientState, Object)
-       ATTRIB(ClientState, m_client, entity, NULL)
+       ATTRIB(ClientState, m_client, entity);
        CONSTRUCTOR(ClientState, entity client)
        {
                CONSTRUCT(ClientState);
@@ -50,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);