From 4cb667661b5790b30f8340c04c084242dc85ea2f Mon Sep 17 00:00:00 2001 From: Mario Date: Wed, 24 Aug 2016 20:42:03 +1000 Subject: [PATCH] Clean up movetype setting, fixes .move_qcphysics --- qcsrc/common/physics/movetypes/movetypes.qc | 4 +--- qcsrc/server/client.qc | 11 +---------- qcsrc/server/g_world.qc | 11 +---------- 3 files changed, 3 insertions(+), 23 deletions(-) diff --git a/qcsrc/common/physics/movetypes/movetypes.qc b/qcsrc/common/physics/movetypes/movetypes.qc index 8ac17d883..729928bf5 100644 --- a/qcsrc/common/physics/movetypes/movetypes.qc +++ b/qcsrc/common/physics/movetypes/movetypes.qc @@ -19,9 +19,7 @@ void set_movetype(entity this, int mt) if (mt == MOVETYPE_PHYSICS || mt == MOVETYPE_PUSH || mt == MOVETYPE_FAKEPUSH) { this.move_qcphysics = false; } - if (!this.move_qcphysics) { - this.movetype = mt; - } + this.movetype = (this.move_qcphysics) ? MOVETYPE_NONE : mt; } #elif defined(CSQC) void set_movetype(entity this, int mt) diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index 7d38c3ea4..ed2faee72 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -2502,20 +2502,11 @@ void DrownPlayer(entity this) void Player_Physics(entity this) { - set_movetype(this, ((this.move_qcphysics) ? MOVETYPE_NONE : this.move_movetype)); + set_movetype(this, this.move_movetype); if(!this.move_qcphysics) return; - int mt = this.move_movetype; - - if(mt == MOVETYPE_PUSH || mt == MOVETYPE_FAKEPUSH || mt == MOVETYPE_PHYSICS) - { - this.move_qcphysics = false; - set_movetype(this, mt); - return; - } - if(!frametime && !this.pm_frametime) return; diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index 5b63aa4e0..0f18ad06e 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -2020,16 +2020,7 @@ void Physics_Frame() if(IS_CLIENT(it) || it.classname == "" || it.move_movetype == MOVETYPE_PUSH || it.move_movetype == MOVETYPE_FAKEPUSH || it.move_movetype == MOVETYPE_PHYSICS) continue; - int mt = it.move_movetype; - - if(mt == MOVETYPE_PUSH || mt == MOVETYPE_FAKEPUSH || mt == MOVETYPE_PHYSICS) - { - it.move_qcphysics = false; - set_movetype(it, mt); - continue; - } - - set_movetype(it, ((it.move_qcphysics) ? MOVETYPE_NONE : it.move_movetype)); + set_movetype(it, it.move_movetype); if(it.move_movetype == MOVETYPE_NONE) continue; -- 2.39.2