]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/physics/movetypes/toss.qc
Some minor tweaks to the QC physics logic
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / physics / movetypes / toss.qc
index 772eb1b070c59a2be0df4aa72df5bc904e115838..c23ab4384b7651ffb0e284da0ce8b353d1272f85 100644 (file)
@@ -51,15 +51,23 @@ void _Movetype_Physics_Toss(entity this, float dt)  // SV_Physics_Toss
        for (int bump = 0; bump < MAX_CLIP_PLANES && movetime > 0; bump++)
        {
                vector move = this.velocity * movetime;
-               if(!_Movetype_PushEntity(this, move, true, true))
+               if(!_Movetype_PushEntity(this, move, true))
                        return;
                if (wasfreed(this))
                        return;
 
-               if (trace_startsolid)
+               // NOTE: this is bmodelstartsolid in the engine
+               if (trace_startsolid && trace_ent.solid == SOLID_BSP)
                {
+                       // QC lacks pointers so we must save the old trace values
+                       float oldtrace_fraction = trace_fraction;
+                       vector oldtrace_plane_normal = trace_plane_normal;
+                       entity oldtrace_ent = trace_ent;
                        _Movetype_UnstickEntity(this);
-                       if(!_Movetype_PushEntity(this, move, true, true))
+                       trace_fraction = oldtrace_fraction;
+                       trace_plane_normal = oldtrace_plane_normal;
+                       trace_ent = oldtrace_ent;
+                       if(!_Movetype_PushEntity(this, move, true))
                                return;
                        if (wasfreed(this))
                                return;