]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into Mario/no_engine_physics
authorMario <mario.mario@y7mail.com>
Sat, 31 Dec 2022 03:45:37 +0000 (13:45 +1000)
committerMario <mario.mario@y7mail.com>
Sat, 31 Dec 2022 03:45:37 +0000 (13:45 +1000)
qcsrc/common/mapobjects/subs.qc
qcsrc/common/physics/movetypes/movetypes.qc
qcsrc/common/physics/movetypes/movetypes.qh
qcsrc/lib/csqcmodel/cl_player.qc
qcsrc/lib/csqcmodel/cl_player.qh
qcsrc/server/client.qc
xonotic-client.cfg
xonotic-server.cfg

index 5d25bf4b5e9a6001b176d9b509d01aed1256ca7e..678bc11f658c430041324f2731207d7e4fe9cb75 100644 (file)
@@ -241,6 +241,7 @@ void SUB_CalcMove_Bezier (entity this, vector tcontrol, vector tdest, float tspe
                delete(this.move_controller);
        }
        controller = new_pure(SUB_CalcMove_controller);
+       set_movetype(controller, MOVETYPE_NONE); // mark the entity as physics driven so that thinking is handled by QC
        controller.owner = this;
        this.move_controller = controller;
        controller.platmovetype = this.platmovetype;
index 2634b8246bedc6e0eb165b772a11f341d6364924..a2feb35dd8f98894f4cdc9a5ab4c01b694e59f56 100644 (file)
@@ -4,11 +4,7 @@
 void set_movetype(entity this, int mt)
 {
        this.move_movetype = mt;
-       if (mt == MOVETYPE_PHYSICS) {
-               this.move_qcphysics = false;
-       } else if (autocvar_sv_qcphysics == 2) {
-               this.move_qcphysics = true;
-       }
+       this.move_qcphysics = (mt != MOVETYPE_PHYSICS);
        if(!IL_CONTAINS(g_moveables, this))
                IL_PUSH(g_moveables, this); // add it to the moveable entities list (even if it doesn't move!) logic: if an object never sets its movetype, we assume it never does anything notable
        this.movetype = (this.move_qcphysics) ? MOVETYPE_QCENTITY : mt;
index 23a3e28e479d263d3e3b410f163f0f8fbe0cebde..e8cdc059beb3bed5f54da4d7b7ebcbff0e2ce780 100644 (file)
@@ -3,8 +3,6 @@
 #ifdef SVQC
 // undefined on client, engine cvar
 bool autocvar_physics_ode;
-
-int autocvar_sv_qcphysics = 1; // TODO this is for testing - remove when qcphysics work
 #endif
 
 // water levels
index 5521feae190c5a894a6bc5007ef36b362bb55cf6..a92fcc5c5b600294e8825dc037063f3eb949dace 100644 (file)
@@ -526,6 +526,18 @@ vector CSQCPlayer_ApplyChase(entity this, vector v)
 
 void CSQCPlayer_CalcRefdef(entity this)
 {
+       if(use_engine_refdef)
+       {
+               int refdefflags = 0;
+               if (this.csqcmodel_teleported) refdefflags |= REFDEFFLAG_TELEPORTED;
+               if (input_buttons & BIT(1)) refdefflags |= REFDEFFLAG_JUMPING;
+               // note: these two only work in WIP2, but are harmless in WIP1
+               if (PHYS_HEALTH(NULL) <= 0 && PHYS_HEALTH(NULL) != -666 && PHYS_HEALTH(NULL) != -2342) refdefflags |= REFDEFFLAG_DEAD;
+               if (intermission) refdefflags |= REFDEFFLAG_INTERMISSION;
+               V_CalcRefdef(this, refdefflags); // TODO? uses .health stat in the engine when this isn't called here, may be broken!
+               return;
+       }
+
        vector vieworg = this.origin;
        if(intermission)
        {
@@ -554,8 +566,6 @@ void CSQCPlayer_CalcRefdef(entity this)
        setproperty(VF_ANGLES, view_angles);
 }
 
-bool autocvar_cl_useenginerefdef = false;
-
 /** Called once per CSQC_UpdateView() */
 void CSQCPlayer_SetCamera()
 {
@@ -637,20 +647,7 @@ void CSQCPlayer_SetCamera()
                        InterpolateOrigin_Do(view);
                        view.view_ofs = '0 0 1' * vh;
                }
-               if(autocvar_cl_useenginerefdef)
-               {
-                       int refdefflags = 0;
-                       if (view.csqcmodel_teleported) refdefflags |= REFDEFFLAG_TELEPORTED;
-                       if (input_buttons & BIT(1)) refdefflags |= REFDEFFLAG_JUMPING;
-                       // note: these two only work in WIP2, but are harmless in WIP1
-                       if (PHYS_HEALTH(NULL) <= 0 && PHYS_HEALTH(NULL) != -666 && PHYS_HEALTH(NULL) != -2342) refdefflags |= REFDEFFLAG_DEAD;
-                       if (intermission) refdefflags |= REFDEFFLAG_INTERMISSION;
-                       V_CalcRefdef(view, refdefflags); // TODO? uses .health stat in the engine when this isn't called here, may be broken!
-               }
-               else
-               {
-                       CSQCPlayer_CalcRefdef(view);
-               }
+               CSQCPlayer_CalcRefdef(view);
        }
        else
        {
index 925c9bd07f6988024728a82a2a289fbee707fdfd..ff12a662c2251276bf691fa2fc672a7731eb3efc 100644 (file)
@@ -29,6 +29,8 @@ const int CSQCPLAYERSTATUS_UNPREDICTED = 0;
 const int CSQCPLAYERSTATUS_FROMSERVER = 1;
 const int CSQCPLAYERSTATUS_PREDICTED = 2;
 
+bool use_engine_refdef; // debug option for testing legacy engine code
+
 // only ever READ these!
 .int pmove_flags;
 const int PMF_JUMP_HELD = 1;
index 58fda9a016cdc2b42cd0c5ef8622f9c28d699cae..f27a4e2a7b0185e657e79cae19326a87c35d34c5 100644 (file)
@@ -1168,7 +1168,7 @@ void ClientConnect(entity this)
        if (IS_REAL_CLIENT(this))
                sv_notice_join(this);
 
-       this.move_qcphysics = autocvar_sv_qcphysics;
+       this.move_qcphysics = true;
 
        // update physics stats (players can spawn before physics runs)
        Physics_UpdateStats(this);
index 4cd709bb6d9689c864affa5f354ad86d99a68c04..f73713338f53dcecdb0d19db437c0d9d1107e9d2 100644 (file)
@@ -912,8 +912,6 @@ seta cl_vaporizerbeam_colorboost 0.7 "saturation of the vaporizer beam's color b
 
 seta cl_showspectators 0 "Show who's spectating you if server has sv_showspectators enabled"
 
-set cl_useenginerefdef 0
-
 set cl_rollkillspeed 10
 
 // Facility for config.cfg use ONLY.
index 1821fa1d7a56662efb77bb69da71ccbabc198bfb..76fca626990b1aea468f6b3d9e17198871d2f868 100644 (file)
@@ -406,7 +406,7 @@ sv_gameplayfix_q2airaccelerate 1
 sv_gameplayfix_stepmultipletimes 1
 sv_gameplayfix_stepdown 2
 // only available in qc physics
-set sv_gameplayfix_stepdown_maxspeed 0 "maximum speed walking entities can be moving for stepping down to apply - requires sv_qcphysics 1"
+set sv_gameplayfix_stepdown_maxspeed 0 "maximum speed walking entities can be moving for stepping down to apply"
 
 // delay for "kill" to prevent abuse
 set g_balance_kill_delay 2 "timer before death when using the kill command"