]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - sv_phys.c
fix for 'falling' in a corner bug, thanks to Elric for finding the fix for this.
[xonotic/darkplaces.git] / sv_phys.c
index 724d45bdb66a307ef3d321ac8fca92ed0b5c4e91..94f2bdf0fa4f44f27a5333f2c88203d3ddbadfdb 100644 (file)
--- a/sv_phys.c
+++ b/sv_phys.c
@@ -943,13 +943,11 @@ void SV_WalkMove (edict_t *ent)
 
        // check for stuckness, possibly due to the limited precision of floats
        // in the clipping hulls
-       /*
        if (clip
         && fabs(oldorg[1] - ent->v.origin[1]) < 0.03125
         && fabs(oldorg[0] - ent->v.origin[0]) < 0.03125)
                // stepping up didn't make any progress
                clip = SV_TryUnstick (ent, oldvel);
-       */
 
        // extra friction based on view angle
        if (clip & 2 && sv_wallfriction.integer)
@@ -961,7 +959,7 @@ void SV_WalkMove (edict_t *ent)
 
        if (downtrace.plane.normal[2] > 0.7)
        {
-               if (ent->v.solid == SOLID_BSP)
+               //if (ent->v.solid == SOLID_BSP)
                {
                        ent->v.flags =  (int)ent->v.flags | FL_ONGROUND;
                        ent->v.groundentity = EDICT_TO_PROG(downtrace.ent);
@@ -1149,7 +1147,7 @@ void SV_CheckWaterTransition (edict_t *ent)
 
        if (cont <= CONTENTS_WATER)
        {
-               if (ent->v.watertype == CONTENTS_EMPTY)
+               if (ent->v.watertype == CONTENTS_EMPTY && cont != CONTENTS_LAVA)
                        // just crossed into water
                        SV_StartSound (ent, 0, "misc/h2ohit1.wav", 255, 1);
 
@@ -1158,7 +1156,7 @@ void SV_CheckWaterTransition (edict_t *ent)
        }
        else
        {
-               if (ent->v.watertype != CONTENTS_EMPTY)
+               if (ent->v.watertype != CONTENTS_EMPTY && ent->v.watertype != CONTENTS_LAVA)
                        // just crossed into water
                        SV_StartSound (ent, 0, "misc/h2ohit1.wav", 255, 1);
 
@@ -1194,7 +1192,10 @@ void SV_Physics_Toss (edict_t *ent)
                // and groundentity is now freed, set groundentity to 0 (floating)
                groundentity = PROG_TO_EDICT(ent->v.groundentity);
                if (groundentity->v.solid == SOLID_BSP)
+               {
                        ent->suspendedinairflag = true;
+                       return;
+               }
                else if (ent->suspendedinairflag && groundentity->free)
                {
                        // leave it suspended in the air