helper: make to_entity also work for stable types (close #768)

This commit is contained in:
Michele Caini
2021-11-23 12:53:50 +01:00
parent e4d36e4982
commit 5b8dcff2a4
4 changed files with 53 additions and 5 deletions

View File

@@ -9,7 +9,7 @@ CR_EXPORT int cr_main(cr_plugin *ctx, cr_op operation) {
auto &registry = *static_cast<entt::registry *>(ctx->userdata);
// forces the creation of the pool for the velocity component
registry.storage<velocity>();
static_cast<void>(registry.storage<velocity>());
const auto view = registry.view<position>();
registry.insert(view.begin(), view.end(), velocity{1., 1.});