X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fent_cs.qc;h=a3d3cc8be6aabec15490439354428ec71dd7956f;hb=e02f1855a702f26f0ec2a130fe805ec6343c42b1;hp=0098dbc5ea2cf26eb63109298443850c8b2cff15;hpb=8595e467f23b92a423e80896fa943cfa23896f54;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/ent_cs.qc b/qcsrc/common/ent_cs.qc index 0098dbc5e..a3d3cc8be 100644 --- a/qcsrc/common/ent_cs.qc +++ b/qcsrc/common/ent_cs.qc @@ -52,7 +52,7 @@ bool entcs_send(entity this, entity to, int sf) { entity player = this.owner; - sf |= 1; + sf |= BIT(0) | BIT(1); if (IS_PLAYER(to) || to.caplayer) // unless spectating, { bool same_team = (to == player) || (teamplay && player.team == to.team); @@ -122,23 +122,19 @@ void entcs_think() { SELFPARAM(); - this.nextthink = time; - entity e = CSQCModel_server2csqc(this.sv_entnum + 1); - bool exists = e != NULL; - if (exists) + entity e = CSQCModel_server2csqc(this.sv_entnum); + if (e == NULL) { - this.has_origin = true; - this.origin = e.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) - { - if (this.model) strunzone(this.model); - this.model = strzone(e.model); - } + this.has_origin = this.has_sv_origin; + return; } - else + this.has_origin = true; + this.origin = e.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) { - this.has_origin = this.has_sv_origin; + if (this.model) strunzone(this.model); + this.model = strzone(e.model); } } @@ -150,12 +146,11 @@ this.classname = "entcs_receiver"; this.entremove = Ent_RemoveEntCS; this.think = entcs_think; - this.nextthink = time; } InterpolateOrigin_Undo(this); int sf = ReadShort(); this.has_sv_origin = false; - this.m_entcs_private = boolean(sf & 1); + this.m_entcs_private = boolean(sf & BIT(0)); int i = 1; #define X(public, fld, sv, cl) { if (sf & BIT(i)) cl; } i += 1; ENTCS_NETPROPS(X); @@ -163,6 +158,7 @@ entcs_receiver(this.sv_entnum, this); this.iflags |= IFLAG_ORIGIN; InterpolateOrigin_Note(this); + this.think(); return true; }