From: Mario Date: Tue, 18 Sep 2018 13:17:09 +0000 (+1000) Subject: Enable QC physics on players X-Git-Tag: xonotic-v0.8.5~1838^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=01c31aae02df623f8f9257a79de06bdbb11eb183;p=xonotic%2Fxonotic-data.pk3dir.git Enable QC physics on players --- 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;