move the asteroid width bound into FactoryState
This commit is contained in:
@@ -40,8 +40,8 @@ BuildingSystem::BuildingSystem(const GameConfig& config,
|
||||
, m_spawnShip(std::move(spawnShip))
|
||||
, m_isItemUnlocked(std::move(isItemUnlocked))
|
||||
, m_rng(rng)
|
||||
, m_asteroidWidth_tiles(config.world.regions.asteroidWidth_tiles)
|
||||
{
|
||||
m_state.asteroidWidth_tiles = config.world.regions.asteroidWidth_tiles;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -340,7 +340,7 @@ bool BuildingSystem::bodyCellsWithinWorldBounds(const std::vector<QPoint>& bodyC
|
||||
QPoint anchor) const
|
||||
{
|
||||
const int heightTiles = m_config.world.heightTiles;
|
||||
const int leftEdgeX = -m_asteroidWidth_tiles;
|
||||
const int leftEdgeX = -m_state.asteroidWidth_tiles;
|
||||
for (const QPoint& cell : bodyCells)
|
||||
{
|
||||
const QPoint worldCell = anchor + cell;
|
||||
|
||||
Reference in New Issue
Block a user