]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Don't constantly unset onground status on casings (makes them a bit jumpy, but fixes...
authorMario <mario@smbclan.net>
Fri, 22 Jul 2016 20:50:25 +0000 (06:50 +1000)
committerMario <mario@smbclan.net>
Fri, 22 Jul 2016 20:50:25 +0000 (06:50 +1000)
qcsrc/common/effects/qc/casings.qc
qcsrc/common/physics/movetypes/movetypes.qc

index 4ef7b51bc48c3876291a6d7f59c53604ffd91481..30543adee55b35c77467a233dc0dcf481718bd22 100644 (file)
@@ -53,7 +53,7 @@ void Casing_Draw(entity this)
     {
         this.angles_x = 0;
         this.angles_z = 0;
-        UNSET_ONGROUND(this);
+        //UNSET_ONGROUND(this);
     }
 
     Movetype_Physics_MatchTicrate(this, autocvar_cl_casings_ticrate, autocvar_cl_casings_sloppy);
index c48b4717c0ca6ed41c3b0e5b2623263f2a6e1ff1..285bc164a02875547aa977f09bcf4520475a85eb 100644 (file)
@@ -653,7 +653,6 @@ void Movetype_Physics_MatchServer(entity this, bool sloppy)
 .vector tic_saved_angles;
 void Movetype_Physics_MatchTicrate(entity this, float tr, bool sloppy)  // SV_Physics_Entity
 {
-       // this will also detect new updates
 #define X(s) \
        if(this.(s) != this.tic_saved_##s) \
                this.tic_##s = this.(s)
@@ -678,6 +677,12 @@ void Movetype_Physics_MatchTicrate(entity this, float tr, bool sloppy)  // SV_Ph
                this.tic_avelocity = this.avelocity;
                this.tic_angles = this.angles;
                this.tic_flags = this.flags;
+
+               this.tic_saved_flags = this.flags;
+               this.tic_saved_velocity = this.velocity;
+               this.tic_saved_origin = this.origin;
+               this.tic_saved_avelocity = this.avelocity;
+               this.tic_saved_angles = this.angles;
                return;
        }
 
@@ -694,7 +699,7 @@ void Movetype_Physics_MatchTicrate(entity this, float tr, bool sloppy)  // SV_Ph
        {
                this.flags = this.tic_flags;
                this.velocity = this.tic_velocity;
-               this.origin = this.tic_origin;
+               setorigin(this, this.tic_origin);
                this.avelocity = this.tic_avelocity;
                this.angles = this.tic_angles;
                _Movetype_Physics_Frame(this, tr);
@@ -730,7 +735,10 @@ void Movetype_Physics_MatchTicrate(entity this, float tr, bool sloppy)  // SV_Ph
                }
                else
                {
+                       vector oldorg = this.origin;
+                       this.origin = this.tic_origin;
                        _Movetype_PushEntityTrace(this, dt * this.velocity);
+                       this.origin = oldorg;
                        if(!trace_startsolid)
                                setorigin(this, trace_endpos);
                }