summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
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 {