From a816497de4d4c74811410cecf74293aa7b793cfc Mon Sep 17 00:00:00 2001 From: Benualdo Date: Sun, 20 Oct 2024 16:23:33 +0200 Subject: [PATCH] Fix Resource added to ResourceList without creating UID --- src/core/UndoRedo/UndoRedoEntry.hpp | 2 +- src/engine/Resource/ResourceList.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/UndoRedo/UndoRedoEntry.hpp b/src/core/UndoRedo/UndoRedoEntry.hpp index e0ea234ed..8390e984d 100644 --- a/src/core/UndoRedo/UndoRedoEntry.hpp +++ b/src/core/UndoRedo/UndoRedoEntry.hpp @@ -8,7 +8,7 @@ namespace vg::core if (nullptr != _object) { m_objectUID = _object->GetUID(false); - VG_ASSERT(m_objectUID); + VG_ASSERT(m_objectUID, "(%s)\"%s\" has no UID", _object->GetClassName(), _object->GetShortName().c_str()); m_objectName = _object->GetName(); } diff --git a/src/engine/Resource/ResourceList.h b/src/engine/Resource/ResourceList.h index 9563457b9..c40987735 100644 --- a/src/engine/Resource/ResourceList.h +++ b/src/engine/Resource/ResourceList.h @@ -24,6 +24,7 @@ namespace vg::engine bool Add() override { T & res = m_resources.emplace_back(); + res.RegisterUID(); for (auto & res : m_resources) res.SetParent(this);