summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorJonathan Bradley <jcb@pikum.xyz>2025-05-22 11:37:26 -0400
committerJonathan Bradley <jcb@pikum.xyz>2025-05-22 11:37:26 -0400
commit98857393fca248d7de2d93509bc29f9254e7fb77 (patch)
treefbed1d88347f6c3291a53f6c84ad23e4f70344fe /editor
parentc4260eeea46d19b0b7a6eb4ca491425057bd361f (diff)
editor: grbinds get base entity over searching
Diffstat (limited to 'editor')
-rw-r--r--editor/editor.cpp5
1 files changed, 4 insertions, 1 deletions
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<CompGrBinds *> entGrBinds;
static pk_arr_t<CompInstance *> 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<EntityType *>(ECS_GetEntity(ECS_GetGrBinds(selectedEntity->grBindsHandle)->entHandle));
+ }
if (entType != nullptr) {
ImGui::Text("%s: %s", "EntType: ", entType->entityTypeCode.val);
} else {