Remove diagonal pathfinding from A*, since tiles may not necessarily consume a full tile. Adjusted Wizard Teleport range accordingly.

This commit is contained in:
2024-01-10 04:08:52 -06:00
parent 803e2caf23
commit 7abb714144
5 changed files with 6 additions and 6 deletions
+2 -2
View File
@@ -70,14 +70,14 @@ void Pathfinding::Initialize(){
nodes[y*game->GetCurrentMapData().width + x].vecNeighbours.push_back(&nodes[(y + 0) * game->GetCurrentMapData().width + (x - 1)]);
if(x<game->GetCurrentMapData().width-1)
nodes[y*game->GetCurrentMapData().width + x].vecNeighbours.push_back(&nodes[(y + 0) * game->GetCurrentMapData().width + (x + 1)]);
if (y>0 && x>0)
/*if (y>0 && x>0)
nodes[y*game->GetCurrentMapData().width + x].vecNeighbours.push_back(&nodes[(y - 1) * game->GetCurrentMapData().width + (x - 1)]);
if (y<game->GetCurrentMapData().height-1 && x>0)
nodes[y*game->GetCurrentMapData().width + x].vecNeighbours.push_back(&nodes[(y + 1) * game->GetCurrentMapData().width + (x - 1)]);
if (y>0 && x<game->GetCurrentMapData().width-1)
nodes[y*game->GetCurrentMapData().width + x].vecNeighbours.push_back(&nodes[(y - 1) * game->GetCurrentMapData().width + (x + 1)]);
if (y<game->GetCurrentMapData().height - 1 && x<game->GetCurrentMapData().width-1)
nodes[y*game->GetCurrentMapData().width + x].vecNeighbours.push_back(&nodes[(y + 1) * game->GetCurrentMapData().width + (x + 1)]);
nodes[y*game->GetCurrentMapData().width + x].vecNeighbours.push_back(&nodes[(y + 1) * game->GetCurrentMapData().width + (x + 1)]);*/
}
// Manually position the start and end markers so they are not nullptr