diff --git a/Source/Engine/Content/BinaryAsset.cpp b/Source/Engine/Content/BinaryAsset.cpp index 9519f73df..cf4aa36b6 100644 --- a/Source/Engine/Content/BinaryAsset.cpp +++ b/Source/Engine/Content/BinaryAsset.cpp @@ -150,9 +150,7 @@ void BinaryAsset::ClearDependencies() { auto asset = Cast(Content::GetAsset(e.First)); if (asset) - { asset->_dependantAssets.Remove(this); - } } Dependencies.Clear(); } @@ -387,6 +385,16 @@ bool BinaryAsset::SaveToAsset(const StringView& path, AssetInitData& data, bool if (binaryAsset) binaryAsset->_isSaving = false; + if (binaryAsset) + { + // Inform dependant asset (use cloned version because it might be modified by assets when they got reloaded) + auto dependantAssets = binaryAsset->_dependantAssets; + for (auto& e : dependantAssets) + { + e->OnDependencyModified(binaryAsset); + } + } + return result; } diff --git a/Source/Engine/Content/Storage/FlaxStorage.cpp b/Source/Engine/Content/Storage/FlaxStorage.cpp index 9d4691be1..df99418bb 100644 --- a/Source/Engine/Content/Storage/FlaxStorage.cpp +++ b/Source/Engine/Content/Storage/FlaxStorage.cpp @@ -963,6 +963,7 @@ bool FlaxStorage::Create(WriteStream* stream, const AssetInitData* data, int32 d // Asset Dependencies stream->WriteInt32(header.Dependencies.Count()); stream->WriteBytes(header.Dependencies.Get(), header.Dependencies.Count() * sizeof(Pair)); + static_assert(sizeof(Pair) == sizeof(Guid) + sizeof(DateTime), "Invalid data size."); } #if ASSETS_LOADING_EXTRA_VERIFICATION