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.
This commit is contained in:
@@ -159,7 +159,7 @@ public class Pathfinder implements Runnable{
|
|||||||
if(!other.solid()){
|
if(!other.solid()){
|
||||||
boolean otherNearSolid = false;
|
boolean otherNearSolid = false;
|
||||||
for(int j = 0; j < 4; j++){
|
for(int j = 0; j < 4; j++){
|
||||||
Tile othernear = other.nearby(i);
|
Tile othernear = other.nearby(j);
|
||||||
if(othernear != null && othernear.solid()){
|
if(othernear != null && othernear.solid()){
|
||||||
otherNearSolid = true;
|
otherNearSolid = true;
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user