Merge branch 'BugFixes' of https://github.com/NoriteSC/FlaxEngineFork into NoriteSC-BugFixes

# Conflicts:
#	Source/Engine/Networking/NetworkReplicator.cpp
This commit is contained in:
Wojtek Figat
2023-09-28 12:28:19 +02:00
6 changed files with 37 additions and 38 deletions

View File

@@ -1221,14 +1221,14 @@ bool Prefab::SyncChangesInternal(PrefabInstancesData& prefabInstancesData)
{
ScopeLock lock(Locker);
_isCreatingDefaultInstance = true;
_defaultInstance = PrefabManager::SpawnPrefab(this, nullptr, &ObjectsCache, true);
_defaultInstance = PrefabManager::SpawnPrefab(this,Transform::Identity, nullptr, &ObjectsCache, true);
_isCreatingDefaultInstance = false;
}
// Instantiate prefab instance from prefab (default spawning logic)
// Note: it will get any added or removed objects from the nested prefabs
// TODO: try to optimize by using recreated default instance to ApplyAllInternal (will need special path there if apply is done with default instance to unlink it instead of destroying)
const auto targetActor = PrefabManager::SpawnPrefab(this, nullptr, nullptr, true);
const auto targetActor = PrefabManager::SpawnPrefab(this, Transform::Identity, nullptr, nullptr, true);
if (targetActor == nullptr)
{
LOG(Warning, "Failed to instantiate default prefab instance from changes synchronization.");