]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Shownames: interpolate player name movement (when player isn't in client's PVS)
authorterencehill <piuntn@gmail.com>
Tue, 2 Mar 2021 22:58:25 +0000 (23:58 +0100)
committerterencehill <piuntn@gmail.com>
Wed, 3 Mar 2021 01:32:15 +0000 (02:32 +0100)
qcsrc/common/ent_cs.qc

index 93c87104309bae528667f3b3d1637d833ecef68c..a3691386be379296ae2b494025666e320a13de18 100644 (file)
@@ -235,7 +235,8 @@ ENTCS_PROP(SOLID, true, sv_solid, solid, ENTCS_SET_NORMAL,
                if (IS_PLAYER(this.owner))
                        this.SendFlags |= BIT(ENTCS_PROP_ORIGIN_id);
 
-               setorigin(this, this.origin); // relink
+               // not needed, origin is just data to be sent
+               //setorigin(this, this.origin); // relink
        }
 
        void entcs_attach(entity player)
@@ -281,11 +282,17 @@ ENTCS_PROP(SOLID, true, sv_solid, solid, ENTCS_SET_NORMAL,
                entity e = CSQCModel_server2csqc(this.sv_entnum);
                if (e == NULL)
                {
+                       // player model is NOT in client's PVS
+                       InterpolateOrigin_Do(this);
                        this.has_origin = this.has_sv_origin;
                        return;
                }
                this.has_origin = true;
+               // when a player model is in client's PVS we use its origin directly
+               // (entcs networked origin is overriden)
                this.origin = e.origin;
+               InterpolateOrigin_Reset(this);
+               setorigin(this, this.origin);
                // `cl_forceplayermodels 1` sounds will be wrong until the player has been in the PVS, but so be it
                if (this.model != e.model)
                {