From de350ea2c76cfdbc8034d68595b3157ed873b878 Mon Sep 17 00:00:00 2001 From: Haerbin23456 <60066765+Haerbin23456@users.noreply.github.com> Date: Mon, 21 Apr 2025 21:32:26 +0800 Subject: [PATCH] fix(tile): correct loop variable from i to j in nearby check (#10701) In TilePreChangeEvent handling, the inner loop used `i` instead of `j` when checking nearby tiles, which could lead to incorrect nearSolid flag updates. This fixes the variable naming conflict. --- core/src/mindustry/ai/Pathfinder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/mindustry/ai/Pathfinder.java b/core/src/mindustry/ai/Pathfinder.java index e9557655c6..0846418815 100644 --- a/core/src/mindustry/ai/Pathfinder.java +++ b/core/src/mindustry/ai/Pathfinder.java @@ -159,7 +159,7 @@ public class Pathfinder implements Runnable{ if(!other.solid()){ boolean otherNearSolid = false; for(int j = 0; j < 4; j++){ - Tile othernear = other.nearby(i); + Tile othernear = other.nearby(j); if(othernear != null && othernear.solid()){ otherNearSolid = true; break;