Fixed vision blocking; MapObject::Occupy() now blueprint implementable
This commit is contained in:
+7
-9
@@ -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;
|
||||
//}
|
||||
|
||||
Reference in New Issue
Block a user