From 8751e778767899dcbabb1bb1c0465299d2c48b49 Mon Sep 17 00:00:00 2001 From: LeoDog896 Date: Wed, 30 Sep 2020 11:15:11 -0400 Subject: [PATCH 1/3] remove nearGround in favor of !nearLiquid --- core/src/mindustry/ai/Pathfinder.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/core/src/mindustry/ai/Pathfinder.java b/core/src/mindustry/ai/Pathfinder.java index a1aa2cb3af..9cd8fe3729 100644 --- a/core/src/mindustry/ai/Pathfinder.java +++ b/core/src/mindustry/ai/Pathfinder.java @@ -103,15 +103,13 @@ public class Pathfinder implements Runnable{ /** Packs a tile into its internal representation. */ private int packTile(Tile tile){ - //TODO nearGround is just the inverse of nearLiquid? - boolean nearLiquid = false, nearSolid = false, nearGround = false; + boolean nearLiquid = false, nearSolid = false; for(int i = 0; i < 4; i++){ Tile other = tile.getNearby(i); if(other != null){ if(other.floor().isLiquid) nearLiquid = true; if(other.solid()) nearSolid = true; - if(!other.floor().isLiquid) nearGround = true; } } @@ -122,7 +120,7 @@ public class Pathfinder implements Runnable{ tile.floor().isLiquid, tile.staticDarkness() >= 2, nearLiquid, - nearGround, + !nearLiquid, // means its near the ground nearSolid, tile.floor().isDeep(), tile.floor().damageTaken > 0.00001f From 49db7617300448bb189444efe719a704b84bee1e Mon Sep 17 00:00:00 2001 From: LeoDog896 Date: Wed, 30 Sep 2020 12:56:43 -0400 Subject: [PATCH 2/3] Revert "remove nearGround in favor of !nearLiquid" This reverts commit 8751e778767899dcbabb1bb1c0465299d2c48b49. --- core/src/mindustry/ai/Pathfinder.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/src/mindustry/ai/Pathfinder.java b/core/src/mindustry/ai/Pathfinder.java index 9cd8fe3729..a1aa2cb3af 100644 --- a/core/src/mindustry/ai/Pathfinder.java +++ b/core/src/mindustry/ai/Pathfinder.java @@ -103,13 +103,15 @@ public class Pathfinder implements Runnable{ /** Packs a tile into its internal representation. */ private int packTile(Tile tile){ - boolean nearLiquid = false, nearSolid = false; + //TODO nearGround is just the inverse of nearLiquid? + boolean nearLiquid = false, nearSolid = false, nearGround = false; for(int i = 0; i < 4; i++){ Tile other = tile.getNearby(i); if(other != null){ if(other.floor().isLiquid) nearLiquid = true; if(other.solid()) nearSolid = true; + if(!other.floor().isLiquid) nearGround = true; } } @@ -120,7 +122,7 @@ public class Pathfinder implements Runnable{ tile.floor().isLiquid, tile.staticDarkness() >= 2, nearLiquid, - !nearLiquid, // means its near the ground + nearGround, nearSolid, tile.floor().isDeep(), tile.floor().damageTaken > 0.00001f From f2fd23dced06887b3644759afb070b382257b7a0 Mon Sep 17 00:00:00 2001 From: LeoDog896 Date: Wed, 30 Sep 2020 12:56:59 -0400 Subject: [PATCH 3/3] can be nearGround AND nearLiquid --- core/src/mindustry/ai/Pathfinder.java | 1 - 1 file changed, 1 deletion(-) diff --git a/core/src/mindustry/ai/Pathfinder.java b/core/src/mindustry/ai/Pathfinder.java index a1aa2cb3af..21ef56134b 100644 --- a/core/src/mindustry/ai/Pathfinder.java +++ b/core/src/mindustry/ai/Pathfinder.java @@ -103,7 +103,6 @@ public class Pathfinder implements Runnable{ /** Packs a tile into its internal representation. */ private int packTile(Tile tile){ - //TODO nearGround is just the inverse of nearLiquid? boolean nearLiquid = false, nearSolid = false, nearGround = false; for(int i = 0; i < 4; i++){