From c97742f992c6dd91e7a785c05384c6942c9ee503 Mon Sep 17 00:00:00 2001 From: Sara Date: Fri, 16 Aug 2024 16:18:46 +0200 Subject: [PATCH] fix: inventory is now a tool class --- src/inventory.cpp | 2 ++ src/register_types.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/inventory.cpp b/src/inventory.cpp index d58fece..1de9ebb 100644 --- a/src/inventory.cpp +++ b/src/inventory.cpp @@ -11,6 +11,8 @@ void Inventory::_bind_methods() { } void Inventory::_ready() { + if(gd::Engine::get_singleton()->is_editor_hint()) + return; this->parent_unit = gd::Object::cast_to(this->get_parent()); } diff --git a/src/register_types.cpp b/src/register_types.cpp index 033c432..e00dd6e 100644 --- a/src/register_types.cpp +++ b/src/register_types.cpp @@ -65,7 +65,7 @@ void initialize_gdextension_types(gd::ModuleInitializationLevel p_level) GDREGISTER_RUNTIME_CLASS(EntityHealth); GDREGISTER_CLASS(NavMarker); GDREGISTER_RUNTIME_CLASS(NavRoom); - GDREGISTER_RUNTIME_CLASS(Inventory); + GDREGISTER_CLASS(Inventory); GDREGISTER_RUNTIME_CLASS(RTSGameMode); GDREGISTER_RUNTIME_CLASS(RTSPlayer); }