fixed bug where only one tile was processed.

This commit is contained in:
LuisPoveda 2022-10-25 01:05:56 +02:00 committed by bernat
parent 9718e233b4
commit 810c65399e
1 changed files with 4 additions and 6 deletions

View File

@ -211,7 +211,7 @@ void AVegetationManager::Tick(float DeltaTime)
return;
}
HeroVehicle->UpdateDetectionBox();
HeroVehicle->UpdateDetectionBox();
TArray<FString> TilesInUse = GetTilesInUse();
if (TilesInUse.Num() == 0)
{
@ -675,12 +675,10 @@ TArray<FString> AVegetationManager::GetTilesInUse()
continue;
const FBox Box = Procedural->ProceduralComponent->GetBounds();
if (!Box.IsValid)
continue;
if (Box.IsInside(HeroVehicle->GetActorLocation()))
{
continue;
const FTransform GlobalTransform = LargeMap->LocalToGlobalTransform(HeroVehicle->GetActorTransform());
if (Box.IsInside(GlobalTransform.GetLocation()))
Results.Emplace(Element.Key);
break;
}
}
return Results;
}