]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix some issues with QC movetypes
authorMario <mario@smbclan.net>
Sun, 29 Nov 2015 07:07:56 +0000 (17:07 +1000)
committerMario <mario@smbclan.net>
Sun, 29 Nov 2015 07:07:56 +0000 (17:07 +1000)
qcsrc/common/movetypes/movetypes.qc
qcsrc/lib/csqcmodel/cl_player.qc

index dd7a4572fffcb745650101629c9bd9c4c3ffd500..07625658bff1e21869d6ac31c37242370d476e9b 100644 (file)
@@ -64,9 +64,8 @@ int _Movetype_FlyMove(entity this, float dt, bool applygravity, vector stepnorma
                        break;
 
                push = this.move_velocity * time_left;
-               vector prev_origin = this.move_origin;
                _Movetype_PushEntity(this, push, true);
-               if(trace_startsolid && this.move_origin != prev_origin)
+               if(trace_startsolid)
                {
                        // we got teleported by a touch function
                        // let's abort the move
@@ -88,9 +87,9 @@ int _Movetype_FlyMove(entity this, float dt, bool applygravity, vector stepnorma
                float my_trace_fraction = trace_fraction;
                vector my_trace_plane_normal = trace_plane_normal;
 
-               if(trace_plane_normal_z)
+               if(trace_plane_normal.z)
                {
-                       if(trace_plane_normal_z > 0.7)
+                       if(trace_plane_normal.z > 0.7)
                        {
                                // floor
                                blocked |= 1;
@@ -112,13 +111,13 @@ int _Movetype_FlyMove(entity this, float dt, bool applygravity, vector stepnorma
                        vector steppush = '0 0 1' * stepheight;
 
                        _Movetype_PushEntity(this, steppush, true);
-                       if(trace_startsolid && this.move_origin != org)
+                       if(trace_startsolid)
                        {
                                blocked |= 8;
                                break;
                        }
                        _Movetype_PushEntity(this, push, true);
-                       if(trace_startsolid && this.move_origin != org)
+                       if(trace_startsolid)
                        {
                                blocked |= 8;
                                break;
@@ -126,7 +125,7 @@ int _Movetype_FlyMove(entity this, float dt, bool applygravity, vector stepnorma
                        float trace2_fraction = trace_fraction;
                        steppush = '0 0 1' * (org_z - this.move_origin_z);
                        _Movetype_PushEntity(this, steppush, true);
-                       if(trace_startsolid && this.move_origin != org)
+                       if(trace_startsolid)
                        {
                                blocked |= 8;
                                break;
index e0eaccae11f957539f2d42f565b911482da16d89..540c8737be2e5f962352eee76f85a6f4070827fe 100644 (file)
@@ -140,6 +140,7 @@ void Movetype_Physics_Spam(entity this)  // optimized
        this.avelocity = this.move_avelocity;
        this.velocity = this.move_velocity;
        this.angles = this.move_angles;
+       this.flags = BITSET(this.flags, FL_ONGROUND, boolean(this.move_flags & FL_ONGROUND));
        setorigin(this, this.move_origin);
 }
 
@@ -156,6 +157,7 @@ void CSQCPlayer_Physics(entity this)
                        this.move_movetype = MOVETYPE_WALK; // temp
                        this.move_velocity = this.velocity;
                        this.move_avelocity = this.avelocity;
+                       this.move_flags = BITSET(this.move_flags, FL_ONGROUND, boolean(this.flags & FL_ONGROUND));
                        Movetype_Physics_Spam(this);
                }
        }