From 9cca30206a8de348bde4bddfa8ae10bd35ea8b66 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 8 Apr 2023 18:05:23 +0200 Subject: editor: fix inspector use after free --- src/world.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/world.hpp b/src/world.hpp index e6ec4f5b..8148bfd5 100644 --- a/src/world.hpp +++ b/src/world.hpp @@ -82,7 +82,7 @@ public: return ret; } - template std::shared_ptr find_entity(object_id id); + template std::shared_ptr find_entity(object_id id); bool is_teardown() const { return _teardown; } object_id entity_counter() const { return _entity_counter; } @@ -98,7 +98,7 @@ public: template std::shared_ptr world::find_entity(object_id id) { - static_assert(std::is_base_of_v); + static_assert(std::is_same_v || std::is_base_of_v); // make it a dependent name so that including "src/entity.hpp" isn't needed using U = std::conditional_t, T, entity>; if (std::shared_ptr ptr = find_entity_(id); !ptr) -- cgit v1.2.3