]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
tracewalk: fix lava not being checked in the last step
authorterencehill <piuntn@gmail.com>
Thu, 27 Jul 2017 19:06:47 +0000 (21:06 +0200)
committerterencehill <piuntn@gmail.com>
Thu, 27 Jul 2017 19:09:59 +0000 (21:09 +0200)
qcsrc/server/bot/default/navigation.qc

index ebf2f6e16595e32be4670810e66739846700fccf..157caf6d3375cebd598e827d2da0613ab98c2e3f 100644 (file)
@@ -515,12 +515,6 @@ bool tracewalk(entity e, vector start, vector m1, vector m2, vector end, float e
                        else
                                move = trace_endpos;
 
-                       if (flatdist <= 0)
-                       {
-                               org = move;
-                               continue;
-                       }
-
                        // trace down from stepheight as far as possible and move there,
                        // if this starts in solid we try again without the stepup, and
                        // if that also fails we assume it is a wall
@@ -544,6 +538,13 @@ bool tracewalk(entity e, vector start, vector m1, vector m2, vector end, float e
                                }
                        }
 
+                       if (flatdist <= 0)
+                       {
+                               if(move.z >= end2.z && org.z < end2.z)
+                                       org.z = end2.z;
+                               continue;
+                       }
+
                        if(org.z > move.z - 1 || !SUBMERGED(org))
                        {
                                nav_action = NAV_WALK;