Added reference to harbored map object to tiles; minor refactoring
This commit is contained in:
+4
-1
@@ -38,9 +38,12 @@ 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) {
|
||||
MapRef->Grid[MapRef->GridIndex(Origin->Q + V.Q, Origin->R + V.R)]->bFree = false;
|
||||
AHexTile* OccupiedHex = MapRef->Grid[MapRef->GridIndex(Origin->Q + V.Q, Origin->R + V.R)];
|
||||
OccupiedHex->bFree = false;
|
||||
OccupiedHex->MapObject = this;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user