Fixed pathfinder bug

This commit is contained in:
Beny 2019-05-05 05:21:02 +01:00
parent 7e6a63bc38
commit 122c646c13

View File

@ -407,14 +407,11 @@ public class RoomLayout
return null;
RoomTile cheapest = openList.get(0);
int cheapestFcost = Integer.MAX_VALUE;
for (RoomTile anOpenList : openList)
{
int f = cheapest.getfCosts();
if (anOpenList.getfCosts() < cheapestFcost)
if (anOpenList.getfCosts() < cheapest.getfCosts())
{
cheapest = anOpenList;
cheapestFcost = f;
}
}
return cheapest;