fix issue where construction sites could be placed outside of game world and add tests

This commit is contained in:
2026-06-22 21:13:01 +02:00
parent 59688e6532
commit e5017ab3c5
6 changed files with 251 additions and 19 deletions

View File

@@ -947,6 +947,11 @@ bool Simulation::isModuleSchematicUnlocked(const std::string& moduleId) const
BuildingId Simulation::tryPlaceBuilding(BuildingType type, QPoint anchor, Rotation rotation)
{
if (!m_buildingSystem->isPlacementValid(type, anchor, rotation))
{
return kInvalidBuildingId;
}
int cost = 0;
for (const BuildingDef& def : m_config.buildings.buildings)
{