Skip to content

Commit b03a520

Browse files
committed
fix: only print comment if there's groups
1 parent eef0f70 commit b03a520

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

rt_entt_codegen/core/create_registry.cc

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,19 @@ auto ecsact::rt_entt_codegen::core::print_create_registry( //
1717

1818
ctx.write("auto&& [registry_id, reg] = ecsact::entt::create_registry();\n\n");
1919

20-
ctx.write(
21-
"// These groups were automatically selected based on the input ecsact "
22-
"files\n"
23-
);
24-
for(auto sys_id : details.group_systems) {
25-
auto cpp_decl_name = cpp_identifier(ecsact::meta::decl_full_name(sys_id));
26-
ctx.write("ecsact::entt::prepare_system_like<", cpp_decl_name, ">(reg);\n");
20+
if(!details.group_systems.empty()) {
21+
ctx.write(
22+
"// These groups were automatically selected based on the input ecsact "
23+
"files\n"
24+
);
25+
for(auto sys_id : details.group_systems) {
26+
auto cpp_decl_name = cpp_identifier(ecsact::meta::decl_full_name(sys_id));
27+
ctx.write(
28+
"ecsact::entt::prepare_system_like<",
29+
cpp_decl_name,
30+
">(reg);\n"
31+
);
32+
}
2733
}
2834

2935
ctx.write("\nreturn registry_id;");

0 commit comments

Comments
 (0)