implement tunnel entry-exit-switching
This commit is contained in:
@@ -571,7 +571,18 @@ void GameWorldView::placeAtTile(QPoint tile)
|
|||||||
{
|
{
|
||||||
if (!m_sim->buildings().isTileOccupied(tile))
|
if (!m_sim->buildings().isTileOccupied(tile))
|
||||||
{
|
{
|
||||||
m_sim->tryPlaceBuilding(type, tile, m_ghostRotation);
|
const EntityId id = m_sim->tryPlaceBuilding(type, tile, m_ghostRotation);
|
||||||
|
if (id != kInvalidEntityId)
|
||||||
|
{
|
||||||
|
if (type == BuildingType::TunnelEntry)
|
||||||
|
{
|
||||||
|
m_builderType = BuildingType::TunnelExit;
|
||||||
|
}
|
||||||
|
else if (type == BuildingType::TunnelExit)
|
||||||
|
{
|
||||||
|
m_builderType = BuildingType::TunnelEntry;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user