From b318fe4a758beb3064ab3d365bfd3ab2baedea83 Mon Sep 17 00:00:00 2001 From: howsohazard <143410553+howsohazard@users.noreply.github.com> Date: Tue, 26 Nov 2024 12:21:57 -0500 Subject: [PATCH] 22333: Fixes bug introduced to entity persistence in last PR (#313) --- src/Amalgam/AssetManager.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/Amalgam/AssetManager.cpp b/src/Amalgam/AssetManager.cpp index e543c5cf..923f678f 100644 --- a/src/Amalgam/AssetManager.cpp +++ b/src/Amalgam/AssetManager.cpp @@ -333,11 +333,7 @@ Entity *AssetManager::LoadEntityFromResource(AssetParameters &asset_params, bool } if(persistent) - { - delete new_entity; - return nullptr; - } - //SetEntityPersistenceForFlattenedEntity(new_entity, &asset_params); + SetEntityPersistenceForFlattenedEntity(new_entity, &asset_params); return new_entity; } @@ -362,11 +358,7 @@ Entity *AssetManager::LoadEntityFromResource(AssetParameters &asset_params, bool new_entity->evaluableNodeManager.FreeNode(call_stack); if(persistent) - { - delete new_entity; - return nullptr; - } - // SetEntityPersistenceForFlattenedEntity(new_entity, &asset_params); + SetEntityPersistenceForFlattenedEntity(new_entity, &asset_params); return new_entity; }