pathfinding now working for distance 2 or less

This commit is contained in:
2022-01-17 17:53:54 +01:00
parent 32f4c6a278
commit 6c1c0579cb
3 changed files with 106 additions and 35 deletions
+3 -3
View File
@@ -26,7 +26,7 @@ void AAdventurePlayerController::SetupInputComponent()
Super::SetupInputComponent();
// This is initialized on startup, you can go straight to binding
InputComponent->BindAction("LeftClick", IE_Pressed, this, &AAdventurePlayerController::AdvClick);
// InputComponent->BindAction("LeftClick", IE_Pressed, this, &AAdventurePlayerController::AdvClick);
}
void AAdventurePlayerController::AdvClick()
@@ -37,7 +37,7 @@ void AAdventurePlayerController::AdvClick()
if (IsValid(Hit.GetActor()))
{
AHexTile* HitHex = (AHexTile*)Hit.GetActor();
// MapRef->FindPathAStar(CurrentHex, HitHex); // this would currently cause a crash...
UE_LOG(LogTemp, Warning, TEXT("%d"), HitHex->Index);
MapRef->FindPathAStar(CurrentHex, HitHex);
// UE_LOG(LogTemp, Warning, TEXT("%d"), HitHex->Index);
}
}