From e8cea5368f832b3edb8ac835da07705c72e0ddd7 Mon Sep 17 00:00:00 2001 From: "Luis C.M" <42545778+c0508383@users.noreply.github.com> Date: Sun, 6 Nov 2022 22:37:31 -0600 Subject: [PATCH] FlyPathFinder: -Fixed a bit of pathfinding logic to open diagonal path points --- .../noppes/npcs/ai/pathfinder/FlyPathFinder.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/noppes/npcs/ai/pathfinder/FlyPathFinder.java b/src/main/java/noppes/npcs/ai/pathfinder/FlyPathFinder.java index 4eaed930e..7ae5095f7 100644 --- a/src/main/java/noppes/npcs/ai/pathfinder/FlyPathFinder.java +++ b/src/main/java/noppes/npcs/ai/pathfinder/FlyPathFinder.java @@ -253,12 +253,12 @@ public class FlyPathFinder extends PathFinder pathOptions[i++] = pathpoint5; } - boolean flag = pathpoint3 == null || pathpoint3.costMalus != 0.0F; - boolean flag1 = pathpoint == null || pathpoint.costMalus != 0.0F; - boolean flag2 = pathpoint2 == null || pathpoint2.costMalus != 0.0F; - boolean flag3 = pathpoint1 == null || pathpoint1.costMalus != 0.0F; - boolean flag4 = pathpoint4 == null || pathpoint4.costMalus != 0.0F; - boolean flag5 = pathpoint5 == null || pathpoint5.costMalus != 0.0F; + boolean flag = pathpoint3 != null && pathpoint3.costMalus >= 0.0F; + boolean flag1 = pathpoint != null && pathpoint.costMalus >= 0.0F; + boolean flag2 = pathpoint2 != null && pathpoint2.costMalus >= 0.0F; + boolean flag3 = pathpoint1 != null && pathpoint1.costMalus >= 0.0F; + boolean flag4 = pathpoint4 != null && pathpoint4.costMalus >= 0.0F; + boolean flag5 = pathpoint5 != null && pathpoint5.costMalus >= 0.0F; if (flag && flag3) {