Fixed processing of graphs

This commit is contained in:
2024-12-11 00:06:37 +03:00
parent af490a5eb4
commit 4c2049f05c
4 changed files with 355 additions and 276 deletions

View File

@@ -984,6 +984,13 @@ void BuildingLayoutGraphUI::draw_2d_grid_view(Control *draw)
flecs::entity
re) {
assert(mcount == 0);
int room_type =
re.get<WorldEditor::components::
buildings_layout_room>()
->room_type;
if (room_type == 304)
colors[String(re.path())] =
Color(1, 0, 0, 1);
if (!colors.has(String(re.path()))) {
colors[String(re.path())] =
Color(Math::randf(),

View File

@@ -748,7 +748,6 @@ void graph_module::zones_graph_module(flecs::world &ecs,
buildings_layout_area &area) {
if (area.area < MIN_ROOM_SIZE) {
badness++;
assert(false);
}
});
if (badness == 0) {

View File

@@ -157,8 +157,7 @@ void region_tree::grow(flecs::entity grid_floor_e, bool limited)
if (item->children[i]->region.can_grow) {
if (item->children[i]->is_a_room() &&
item->children[i]->is_special() &&
item->children[i]->room_type == 304 &&
false)
item->children[i]->room_type == 304)
special_grow_list.push_back(
item->children[i]);
else
@@ -579,7 +578,7 @@ void region_tree::move(flecs::entity grid_floor_e)
while (!queue.empty()) {
int i;
struct region_tree *item = queue.front()->get();
if (item->is_a_room(grid_floor_e) && !item->region.can_grow &&
if (item->is_a_room() && !item->region.can_grow &&
item->region.can_move) {
movables.push_back(item);
count++;