fix issue where construction sites could not be selected
This commit is contained in:
@@ -1067,7 +1067,11 @@ void GameWorldView::mousePressEvent(QMouseEvent* event)
|
||||
}
|
||||
else
|
||||
{
|
||||
const EntityId id = buildingAtTile(tile);
|
||||
EntityId id = buildingAtTile(tile);
|
||||
if (id == kInvalidEntityId)
|
||||
{
|
||||
id = siteAtTile(tile);
|
||||
}
|
||||
if (id != kInvalidEntityId)
|
||||
{
|
||||
if (event->modifiers() & Qt::ControlModifier)
|
||||
@@ -1162,6 +1166,18 @@ void GameWorldView::mouseReleaseEvent(QMouseEvent* event)
|
||||
}
|
||||
}
|
||||
}
|
||||
for (const ConstructionSite& s : m_sim->buildings().allSites())
|
||||
{
|
||||
for (const QPoint& cell : s.bodyCells)
|
||||
{
|
||||
if (cell.x() >= x0 && cell.x() <= x1
|
||||
&& cell.y() >= y0 && cell.y() <= y1)
|
||||
{
|
||||
boxSel.push_back(s.id);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!(event->modifiers() & Qt::ControlModifier))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user