fix issue where construction sites could be placed outside of game world and add tests
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user