From c771cae3a1c64cd2ef8d81dc54737ae466d4a9ee Mon Sep 17 00:00:00 2001 From: Mario Date: Sun, 29 Nov 2015 17:07:56 +1000 Subject: [PATCH] Fix some issues with QC movetypes --- qcsrc/common/movetypes/movetypes.qc | 13 ++++++------- qcsrc/lib/csqcmodel/cl_player.qc | 2 ++ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/qcsrc/common/movetypes/movetypes.qc b/qcsrc/common/movetypes/movetypes.qc index dd7a4572f..07625658b 100644 --- a/qcsrc/common/movetypes/movetypes.qc +++ b/qcsrc/common/movetypes/movetypes.qc @@ -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; diff --git a/qcsrc/lib/csqcmodel/cl_player.qc b/qcsrc/lib/csqcmodel/cl_player.qc index e0eaccae1..540c8737b 100644 --- a/qcsrc/lib/csqcmodel/cl_player.qc +++ b/qcsrc/lib/csqcmodel/cl_player.qc @@ -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); } } -- 2.39.2