From b0ee866d8377cb5572a0b22a4f4bdcdccb5091f9 Mon Sep 17 00:00:00 2001 From: TimePath Date: Fri, 20 Nov 2015 16:54:41 +1100 Subject: [PATCH] entcs: unset .has_origin when player model leaves PVS --- qcsrc/common/ent_cs.qc | 8 ++++++-- qcsrc/common/ent_cs.qh | 5 +++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/qcsrc/common/ent_cs.qc b/qcsrc/common/ent_cs.qc index d5dbf51b6..f90ddddea 100644 --- a/qcsrc/common/ent_cs.qc +++ b/qcsrc/common/ent_cs.qc @@ -9,7 +9,7 @@ PROP(false, origin, \ { WriteShort(MSG_ENTITY, this.origin.x); WriteShort(MSG_ENTITY, this.origin.y); \ WriteShort(MSG_ENTITY, this.origin.z); }, \ - { this.has_origin = true; vector v; v.x = ReadShort(); v.y = ReadShort(); v.z = ReadShort(); setorigin(this, v); }) \ + { this.has_sv_origin = true; vector v; v.x = ReadShort(); v.y = ReadShort(); v.z = ReadShort(); setorigin(this, v); }) \ \ PROP(false, angles_y, \ { WriteByte(MSG_ENTITY, this.angles.y / 360 * 256); }, \ @@ -136,6 +136,10 @@ this.model = strzone(e.model); } } + else + { + this.has_origin = this.has_sv_origin; + } } NET_HANDLE(ENT_CLIENT_ENTCS, bool isnew) @@ -150,7 +154,7 @@ } InterpolateOrigin_Undo(); int sf = ReadShort(); - this.has_origin = false; + this.has_sv_origin = false; this.m_entcs_private = boolean(sf & 1); int i = 1; #define X(public, fld, sv, cl) { if (sf & BIT(i)) cl; } i += 1; diff --git a/qcsrc/common/ent_cs.qh b/qcsrc/common/ent_cs.qh index c8eea2658..1e82e1563 100644 --- a/qcsrc/common/ent_cs.qh +++ b/qcsrc/common/ent_cs.qh @@ -5,9 +5,10 @@ REGISTER_NET_LINKED(ENT_CLIENT_ENTCS) /** True when private information such as origin is available */ .bool m_entcs_private; - -/** True when a recent origin is available */ +/** True when origin is available */ .bool has_origin; +/** True when a recent server sent origin has been received */ +.bool has_sv_origin; #ifdef SVQC /** -- 2.39.2