fixed crashing bug when calling RandomHex() too early
This commit is contained in:
@ -79,10 +79,12 @@ void AAdventureMap::MakeGrid()
|
||||
{
|
||||
tile->Index = GridIndex(tile->Q, tile->R);
|
||||
}
|
||||
|
||||
bHexGridReady = true;
|
||||
}
|
||||
|
||||
AHexTile* AAdventureMap::RandomHex()
|
||||
{
|
||||
int32 SpawnHex = GridIndex(FMath::RandRange(0, GridSize), FMath::RandRange(0, GridSize));
|
||||
return Grid[SpawnHex];
|
||||
int32 RandHex = GridIndex(FMath::RandRange(0, GridSize), FMath::RandRange(0, GridSize));
|
||||
return Grid[RandHex];
|
||||
}
|
Reference in New Issue
Block a user