implement tunnel entry-exit-switching

This commit is contained in:
2026-04-29 22:06:53 +02:00
parent 51333f752b
commit 3f0e05fe7a

View File

@@ -571,7 +571,18 @@ void GameWorldView::placeAtTile(QPoint 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