fix setorigin use in CSQC
authorRudolf Polzer <divverent@xonotic.org>
Mon, 14 Jan 2013 12:42:22 +0000 (13:42 +0100)
committerRudolf Polzer <divverent@xonotic.org>
Mon, 14 Jan 2013 12:42:22 +0000 (13:42 +0100)
13 files changed:
qcsrc/client/Main.qc
qcsrc/client/casings.qc
qcsrc/client/gibs.qc
qcsrc/client/laser.qc
qcsrc/client/modeleffects.qc
qcsrc/client/particles.qc
qcsrc/client/projectile.qc
qcsrc/client/shownames.qc
qcsrc/client/teamradar.qc
qcsrc/client/tturrets.qc
qcsrc/client/wall.qc
qcsrc/client/waypointsprites.qc
qcsrc/csqcmodellib/interpolate.qc

index d6fd09e..b75fc16 100644 (file)
@@ -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)
        {
index a43d172..70ed9f4 100644 (file)
@@ -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;
index 5f6599f..9e1c6e7 100644 (file)
@@ -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);
index a91e13b..c5475d7 100644 (file)
@@ -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)
        {
index 1b54653..0508a86 100644 (file)
@@ -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();
index 6e24893..3e2222f 100644 (file)
@@ -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()
index 10f47b4..2503280 100644 (file)
@@ -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)
index 31a6cb5..8b4f7a0 100644 (file)
@@ -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;
                        
index f3ec99b..e5dcc00 100644 (file)
@@ -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)
index 272a246..6f3b030 100644 (file)
@@ -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();
index e68a62c..3d5aa13 100644 (file)
@@ -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);
index d3d57ab..39b60a6 100644 (file)
@@ -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)
index ac0ba6e..55f1341 100644 (file)
@@ -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)