mirror of
https://github.com/mat-1/azalea.git
synced 2025-08-02 14:26:04 +00:00
fix pathfinder A* using slightly suboptimal paths sometimes
This commit is contained in:
parent
ad33d06e5f
commit
28de14f984
1 changed files with 1 additions and 1 deletions
|
@ -78,7 +78,7 @@ where
|
|||
.get(&neighbor.movement.target)
|
||||
.map(|n| n.g_score)
|
||||
.unwrap_or(f32::INFINITY);
|
||||
if tentative_g_score - neighbor_g_score < MIN_IMPROVEMENT {
|
||||
if neighbor_g_score - tentative_g_score > MIN_IMPROVEMENT {
|
||||
let heuristic = heuristic(neighbor.movement.target);
|
||||
let f_score = tentative_g_score + heuristic;
|
||||
nodes.insert(
|
||||
|
|
Loading…
Add table
Reference in a new issue