From: terencehill Date: Tue, 2 Mar 2021 22:58:25 +0000 (+0100) Subject: Shownames: interpolate player name movement (when player isn't in client's PVS) X-Git-Tag: xonotic-v0.8.5~533 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=ffb140fde6f4282a68860d01de5b96f22332feb4;p=xonotic%2Fxonotic-data.pk3dir.git Shownames: interpolate player name movement (when player isn't in client's PVS) --- diff --git a/qcsrc/common/ent_cs.qc b/qcsrc/common/ent_cs.qc index 93c871043..a3691386b 100644 --- a/qcsrc/common/ent_cs.qc +++ b/qcsrc/common/ent_cs.qc @@ -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) {