From: Rudolf Polzer Date: Mon, 14 Jan 2013 12:42:22 +0000 (+0100) Subject: fix setorigin use in CSQC X-Git-Tag: xonotic-v0.7.0~126 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a9348aa104fa1e9b69b7e6c3ede8a5e93c4ee3dd;p=xonotic%2Fxonotic-data.pk3dir.git fix setorigin use in CSQC --- diff --git a/qcsrc/client/Main.qc b/qcsrc/client/Main.qc index d6fd09e6d..b75fc166e 100644 --- a/qcsrc/client/Main.qc +++ b/qcsrc/client/Main.qc @@ -430,6 +430,7 @@ void Ent_ReadEntCS() self.origin_x = ReadShort(); self.origin_y = ReadShort(); self.origin_z = ReadShort(); + setorigin(self, self.origin); } if(sf & 4) { diff --git a/qcsrc/client/casings.qc b/qcsrc/client/casings.qc index a43d1726f..70ed9f4b0 100644 --- a/qcsrc/client/casings.qc +++ b/qcsrc/client/casings.qc @@ -84,6 +84,7 @@ void Ent_Casing(float isNew) casing.origin_x = ReadCoord(); casing.origin_y = ReadCoord(); casing.origin_z = ReadCoord(); + setorigin(casing, casing.origin); casing.velocity = decompressShortVector(ReadShort()); casing.angles_x = ReadByte() * 360 / 256; casing.angles_y = ReadByte() * 360 / 256; diff --git a/qcsrc/client/gibs.qc b/qcsrc/client/gibs.qc index 5f6599f18..9e1c6e7a1 100644 --- a/qcsrc/client/gibs.qc +++ b/qcsrc/client/gibs.qc @@ -138,7 +138,8 @@ void TossGib (string mdlname, vector safeorg, vector org, vector vconst, vector org = trace_endpos; } - gib.move_origin = gib.origin = org; + gib.move_origin = org; + setorigin(gib, org); gib.move_velocity = vconst * autocvar_cl_gibs_velocity_scale + vrand * autocvar_cl_gibs_velocity_random + '0 0 1' * autocvar_cl_gibs_velocity_up; gib.move_avelocity = prandomvec() * vlen(gib.move_velocity) * autocvar_cl_gibs_avelocity_scale; gib.move_time = time; @@ -193,7 +194,7 @@ void Ent_GibSplash(float isNew) if(amount <= 0 || !isNew) return; - self.origin = org; // for the sounds + setorigin(self, org); // for the sounds specnum = (type & 0x78) / 8; // blood/gibmodel type: using four bits (0..7, bit indexes 3,4,5) issilent = (type & 0x40); diff --git a/qcsrc/client/laser.qc b/qcsrc/client/laser.qc index a91e13b01..c5475d7a6 100644 --- a/qcsrc/client/laser.qc +++ b/qcsrc/client/laser.qc @@ -85,6 +85,7 @@ void Ent_Laser() self.origin_x = ReadCoord(); self.origin_y = ReadCoord(); self.origin_z = ReadCoord(); + setorigin(self, self.origin); } if(f & 8) { diff --git a/qcsrc/client/modeleffects.qc b/qcsrc/client/modeleffects.qc index 1b5465349..0508a8669 100644 --- a/qcsrc/client/modeleffects.qc +++ b/qcsrc/client/modeleffects.qc @@ -6,7 +6,7 @@ void ModelEffect_Draw() { self.angles = self.angles + frametime * self.avelocity; - self.origin = self.origin + frametime * self.velocity; + setorigin(self, self.origin + frametime * self.velocity); self.scale = self.scale1 + (self.scale2 - self.scale1) * (time - self.teleport_time) / (self.lifetime + self.fadetime - self.teleport_time); self.alpha = self.cnt * bound(0, 1 - (time - self.lifetime) / self.fadetime, 1); if(self.alpha < ALPHA_MIN_VISIBLE) @@ -41,6 +41,7 @@ void Ent_ModelEffect(float isNew) e.origin_x = ReadCoord(); e.origin_y = ReadCoord(); e.origin_z = ReadCoord(); + setorigin(e, e.origin); if(f & 1) { e.velocity_x = ReadCoord(); diff --git a/qcsrc/client/particles.qc b/qcsrc/client/particles.qc index 6e24893b0..3e2222f4a 100644 --- a/qcsrc/client/particles.qc +++ b/qcsrc/client/particles.qc @@ -57,7 +57,7 @@ void Draw_PointParticles() } if(self.noise != "") { - self.origin = p; + setorigin(self, p); sound(self, CH_AMBIENT, self.noise, VOL_BASE * self.volume, self.atten); } self.just_toggled = 0; @@ -68,7 +68,7 @@ void Draw_PointParticles() --i; } } - self.origin = o; + setorigin(self, o); } void Ent_PointParticles_Remove() diff --git a/qcsrc/client/projectile.qc b/qcsrc/client/projectile.qc index 10f47b446..25032806e 100644 --- a/qcsrc/client/projectile.qc +++ b/qcsrc/client/projectile.qc @@ -222,6 +222,7 @@ void Ent_Projectile() self.origin_x = ReadCoord(); self.origin_y = ReadCoord(); self.origin_z = ReadCoord(); + setorigin(self, self.origin); if(self.count & 0x80) { self.velocity_x = ReadCoord(); @@ -421,6 +422,7 @@ void Ent_Projectile() default: break; } + setsize(self, self.mins, self.maxs); } if(self.gravity) diff --git a/qcsrc/client/shownames.qc b/qcsrc/client/shownames.qc index 31a6cb5e8..8b4f7a09f 100644 --- a/qcsrc/client/shownames.qc +++ b/qcsrc/client/shownames.qc @@ -215,7 +215,7 @@ void Draw_ShowNames_All() e.sameteam = 0; } - e.origin = getplayerorigin(i); + setorigin(e, getplayerorigin(i)); if(e.origin == GETPLAYERORIGIN_ERROR) continue; diff --git a/qcsrc/client/teamradar.qc b/qcsrc/client/teamradar.qc index f3ec99bfe..e5dcc00f2 100644 --- a/qcsrc/client/teamradar.qc +++ b/qcsrc/client/teamradar.qc @@ -211,6 +211,7 @@ void Ent_RadarLink() self.origin_x = ReadCoord(); self.origin_y = ReadCoord(); self.origin_z = ReadCoord(); + setorigin(self, self.origin); } if(sendflags & 2) diff --git a/qcsrc/client/tturrets.qc b/qcsrc/client/tturrets.qc index 272a24610..6f3b03050 100644 --- a/qcsrc/client/tturrets.qc +++ b/qcsrc/client/tturrets.qc @@ -542,7 +542,8 @@ entity turret_gibtoss(string _model, vector _from, vector _to, vector _cmod, flo gib.gravity = 1; gib.move_movetype = MOVETYPE_BOUNCE; - gib.move_origin = gib.origin = _from; + gib.move_origin = _from; + setorigin(gib, _from); gib.move_velocity = _to; gib.move_avelocity = prandomvec() * 32; gib.move_time = time; @@ -605,6 +606,7 @@ void ent_turret() self.origin_x = ReadCoord(); self.origin_y = ReadCoord(); self.origin_z = ReadCoord(); + setorigin(self, self.origin); self.angles_x = ReadAngle(); self.angles_y = ReadAngle(); diff --git a/qcsrc/client/wall.qc b/qcsrc/client/wall.qc index e68a62c98..3d5aa138f 100644 --- a/qcsrc/client/wall.qc +++ b/qcsrc/client/wall.qc @@ -98,6 +98,7 @@ void Ent_Wall() self.origin_x = ReadCoord(); self.origin_y = ReadCoord(); self.origin_z = ReadCoord(); + setorigin(self, self.origin); } if(f & 4) @@ -141,6 +142,7 @@ void Ent_Wall() } else self.mins = self.maxs = '0 0 0'; + setsize(self, self.mins, self.maxs); if(self.bgmscript) strunzone(self.bgmscript); diff --git a/qcsrc/client/waypointsprites.qc b/qcsrc/client/waypointsprites.qc index d3d57aba9..39b60a66b 100644 --- a/qcsrc/client/waypointsprites.qc +++ b/qcsrc/client/waypointsprites.qc @@ -688,6 +688,7 @@ void Ent_WaypointSprite() self.origin_x = ReadCoord(); self.origin_y = ReadCoord(); self.origin_z = ReadCoord(); + setorigin(self, self.origin); } if(sendflags & 1) diff --git a/qcsrc/csqcmodellib/interpolate.qc b/qcsrc/csqcmodellib/interpolate.qc index ac0ba6e7d..55f134126 100644 --- a/qcsrc/csqcmodellib/interpolate.qc +++ b/qcsrc/csqcmodellib/interpolate.qc @@ -116,7 +116,7 @@ void InterpolateOrigin_Do() } void InterpolateOrigin_Undo() { - self.origin = self.iorigin2; + setorigin(self, self.iorigin2); if(self.iflags & IFLAG_ANGLES) self.angles = fixedvectoangles2(self.iforward2, self.iup2); if(self.iflags & IFLAG_VELOCITY)