]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
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 d6fd09e6daf5f910f183ac7cbdb8376389b7563d..b75fc166e585359c982d319e8bf1de0c168e60d7 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 a43d1726fcdce42a09aa30356391dc25cca57ac1..70ed9f4b07d74b597a39d67968bf99bdba7cd807 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 5f6599f183da88394acab16ff586b69a793bef75..9e1c6e7a1395faf93d89ca7234aad0d031bdbbf2 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 a91e13b01991e52517af210079478858eb0faae7..c5475d7a63a3cb738f1cb387930169794f233a6f 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 1b546534919412bfb7f92bb48ac6d71ed00014d6..0508a8669a984ab102530a5403c1e59a7aa20667 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 6e24893b02e005b08d9b3e142dad4d70e6c1efd7..3e2222f4aae07fc017cde94d3895caa779919bc3 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 10f47b446634a6a53a2f21d827bd6ca704490941..25032806eb9df5029a3066f69eb5b4aacf643cde 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 31a6cb5e8719f1e5f520f885dae46cd66db88330..8b4f7a09f6996bbc22c5dcad8e9403e80908fe2e 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 f3ec99bfeebb526424a95dd5bf21cc7e84433b8f..e5dcc00f2c911ffe2d650ed83007d309aa0f6f22 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 272a24610204128247559cf76ecd6fca41bef53b..6f3b030502196171db72a24520b89fb7a9713979 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 e68a62c986a886823cf62cbc90b4b9dea8358dae..3d5aa138ffb07f0689dd544db9919f1a9e092301 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 d3d57aba9e8cbcd52ad7606466f912dc394032a9..39b60a66b0c767d1342bec2dcb5e8645d6cd332a 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 ac0ba6e7d70ac7cb56fbc8673a4abec027b513b9..55f134126fd7472eb1a33b1ba9a8a7d00d0b979a 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)