]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/state.qh
Link some positional entities (fixes prediction of jumppads in some odd old maps)
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / state.qh
index 177935445db8621fd8f573a17a67cd38969654c5..64ae3e7fe62f087accb4e01d0cfd65ba428940eb 100644 (file)
@@ -1,3 +1,5 @@
+#pragma once
+
 /**
  * Purpose: common player state, usable on client and server
  * Client: singleton representing the viewed player
@@ -28,19 +30,9 @@ ENDCLASS(PlayerState)
        PlayerState PS(entity this) { assert(IS_CLIENT(this)); return this._ps; }
 #endif
 
-void PlayerState_attach(entity this)
-{
-       // TODO: dynamic
-       // this._ps = NEW(PlayerState, this);
-}
-
-void PlayerState_detach(entity this)
-{
-       // TODO: dynamic
-       // if (!PS(this)) return;  // initial connect
-       // remove(PS(this));
-       // this._ps = NULL;
-}
+// TODO: renew on death
+void PlayerState_attach(entity this);
+void PlayerState_detach(entity this);
 
 /**
  * Purpose: common client state, usable on client and server
@@ -64,15 +56,5 @@ ENDCLASS(ClientState)
        ClientState CS(entity this) { assert(IS_CLIENT(this)); assert(this._cs); return this._cs; }
 #endif
 
-void ClientState_attach(entity this)
-{
-       this._cs = NEW(ClientState, this);
-       this._ps = NEW(PlayerState, this);  // TODO: dynamic
-}
-
-void ClientState_detach(entity this)
-{
-       remove(CS(this));
-       this._cs = NULL;
-       this._ps = NULL;  // TODO: dynamic
-}
+void ClientState_attach(entity this);
+void ClientState_detach(entity this);