]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix falling through world when crushed by platforms
authorMario <mario.mario@y7mail.com>
Mon, 1 Jun 2020 20:00:15 +0000 (06:00 +1000)
committerMario <mario.mario@y7mail.com>
Mon, 1 Jun 2020 20:00:15 +0000 (06:00 +1000)
qcsrc/common/physics/movetypes/movetypes.qc
qcsrc/common/physics/movetypes/push.qc

index 7e7945e1c920d0f0bc19b487c96f94805bec5891..5b7bb11b870e33b2acb102ca6f5763d58fe7b920 100644 (file)
@@ -25,7 +25,7 @@ bool _Movetype_NudgeOutOfSolid_PivotIsKnownGood(entity this, vector pivot) // SV
        for(int bump = 0; bump < 6; bump++)
        {
                int coord = 2 - (bump >> 1);
-               bool dir = (bump & 1);
+               int dir = (bump & 1);
 
                for(int subbump = 0; ; ++subbump)
                {
@@ -54,7 +54,6 @@ bool _Movetype_NudgeOutOfSolid_PivotIsKnownGood(entity this, vector pivot) // SV
                        tracebox(stuckorigin, goodmins, goodmaxs, testorigin, MOVE_NOMONSTERS, this);
                        if(trace_startsolid && trace_ent.solid == SOLID_BSP) // NOTE: this checks for bmodelstartsolid in the engine
                        {
-                               
                                // BAD BAD, can't fix that
                                return false;
                        }
@@ -70,7 +69,7 @@ bool _Movetype_NudgeOutOfSolid_PivotIsKnownGood(entity this, vector pivot) // SV
 
                        // we hit something... let's move out of it
                        vector move = trace_endpos - testorigin;
-                       float nudge = (trace_plane_normal * move) + 0.03125f; // FIXME cvar this constant
+                       float nudge = (trace_plane_normal * move) + 0.03125; // FIXME cvar this constant
                        stuckorigin = stuckorigin + nudge * trace_plane_normal;
                }
 
index 9179ec4a2fc31085aec1c5096b056fe58d590937..66ff42a69f30b4ca5ab8584ca1cae7edef23b2cf 100644 (file)
@@ -97,7 +97,7 @@ void _Movetype_PushMove(entity this, float dt) // SV_PushMove
                        if(!trace_startsolid)
                                continue;
                }
-               vector pivot = check.mins + 0.5 * check.maxs;
+               vector pivot = check.mins + 0.5 * (check.maxs - check.mins);
                vector move;
 
                if(rotated)
@@ -154,13 +154,8 @@ void _Movetype_PushMove(entity this, float dt) // SV_PushMove
                        if(_Movetype_NudgeOutOfSolid_PivotIsKnownGood(check, pivot))
                        {
                                // hack to invoke all necessary movement triggers
-                               vector move2 = '0 0 0';
-                               if(!_Movetype_PushEntity(check, move2, true, true))
-                               {
-                                       // entity "check" got teleported
-                                       continue;
-                               }
-                               // we could fix it
+                               _Movetype_PushEntity(check, '0 0 0', true, true);
+                               // we could fix it or entity "check" was telported
                                continue;
                        }