Fixed vision blocking; MapObject::Occupy() now blueprint implementable

This commit is contained in:
2022-06-20 15:45:30 +02:00
parent 068beeacfd
commit 276f8e2b50
7 changed files with 25 additions and 24 deletions
+7 -9
View File
@@ -21,7 +21,6 @@ AMapObject::AMapObject()
void AMapObject::BeginPlay()
{
Super::BeginPlay();
Occupy();
}
// Called every frame
@@ -39,11 +38,10 @@ void AMapObject::Activate()
}
// Any subclass of MapObject has a defined array of Vectors relative to its origin which has to occupy() upon being placed on the map.
void AMapObject::Occupy()
{
for (auto& V : Occupying) {
AHexTile* OccupiedHex = MapRef->Grid[MapRef->GridIndex(Origin->Q + V.Q, Origin->R + V.R)];
OccupiedHex->bFree = false;
OccupiedHex->MapObject = this;
}
}
//void AMapObject::Occupy(int32 Q, int32 R)
//{
// AHexTile* OccupiedHex = MapRef->Grid[MapRef->GridIndex(Q, R)];
//
// OccupiedHex->bFree = false;
// OccupiedHex->MapObject = this;
//}