From 98857393fca248d7de2d93509bc29f9254e7fb77 Mon Sep 17 00:00:00 2001 From: Jonathan Bradley Date: Thu, 22 May 2025 11:37:26 -0400 Subject: editor: grbinds get base entity over searching --- editor/editor.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'editor') diff --git a/editor/editor.cpp b/editor/editor.cpp index af6aa57..9e2f938 100644 --- a/editor/editor.cpp +++ b/editor/editor.cpp @@ -1732,6 +1732,7 @@ void RecordImGuiSceneEditor() { ImGui::Spacing(); if (selectedEntity != nullptr) { + // TODO leaky static pk_arr_t entGrBinds; static pk_arr_t entInstances; static EntityType *entType; @@ -1761,7 +1762,9 @@ void RecordImGuiSceneEditor() { pk_arr_append_t(&entityInstancesToCreate, entityType); } } - entType = EntityType_FindByEntityHandle(selectedEntity->entHandle); + if (selectedEntity->grBindsHandle != GrBindsHandle_MAX) { + entType = static_cast(ECS_GetEntity(ECS_GetGrBinds(selectedEntity->grBindsHandle)->entHandle)); + } if (entType != nullptr) { ImGui::Text("%s: %s", "EntType: ", entType->entityTypeCode.val); } else { -- cgit v1.2.3