From 01c31aae02df623f8f9257a79de06bdbb11eb183 Mon Sep 17 00:00:00 2001 From: Mario Date: Tue, 18 Sep 2018 23:17:09 +1000 Subject: [PATCH] Enable QC physics on players --- qcsrc/common/physics/movetypes/movetypes.qh | 2 ++ qcsrc/server/client.qc | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/qcsrc/common/physics/movetypes/movetypes.qh b/qcsrc/common/physics/movetypes/movetypes.qh index 20f9adba1..36cbd9f46 100644 --- a/qcsrc/common/physics/movetypes/movetypes.qh +++ b/qcsrc/common/physics/movetypes/movetypes.qh @@ -126,6 +126,8 @@ const int MOVETYPE_ANGLENOCLIP = 1; const int MOVETYPE_ANGLECLIP = 2; #endif +const int MOVETYPE_QCPLAYER = 150; // QC-driven player physics, no think functions! + const int FL_ONSLICK = BIT(20); const int MOVETYPE_FAKEPUSH = 13; diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index da0d84979..26696f4c8 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -1143,6 +1143,8 @@ void ClientConnect(entity this) if (IS_REAL_CLIENT(this)) sv_notice_join(this); + this.move_qcphysics = true; + // update physics stats (players can spawn before physics runs) Physics_UpdateStats(this); @@ -2562,7 +2564,7 @@ void DrownPlayer(entity this) void Player_Physics(entity this) { - set_movetype(this, this.move_movetype); + this.movetype = (this.move_qcphysics) ? MOVETYPE_QCPLAYER : this.move_movetype; if(!this.move_qcphysics) return; -- 2.39.2