Merge remote-tracking branch 'origin/master' into 1.1

# Conflicts:
#	Source/Engine/Navigation/NavMesh.cpp
#	Source/Engine/Navigation/NavMeshBuilder.cpp
This commit is contained in:
Wojtek Figat
2021-01-22 11:31:22 +01:00
178 changed files with 1163 additions and 864 deletions

View File

@@ -195,7 +195,7 @@ void JsonWriter::SceneObject(::SceneObject* obj)
auto prefab = Content::Load<Prefab>(obj->GetPrefabID());
if (prefab)
{
// Request the prefab to be deserialized to the default instance (used for comparision to generate a diff)
// Request the prefab to be deserialized to the default instance (used for comparison to generate a diff)
prefab->GetDefaultInstance();
// Get prefab object instance from the prefab

View File

@@ -4,8 +4,9 @@
#include "WriteStream.h"
#include "Engine/Core/Types/CommonValue.h"
#include "Engine/Core/Types/Variant.h"
#include "Engine/Content/Asset.h"
#include "Engine/Core/Collections/Dictionary.h"
#include "Engine/Content/Asset.h"
#include "Engine/Debug/DebugLog.h"
#include "Engine/Scripting/ScriptingObject.h"
#include "Engine/Scripting/ScriptingObjectReference.h"
@@ -330,8 +331,19 @@ void ReadStream::ReadVariant(Variant* data)
{
int32 length;
ReadInt32(&length);
ASSERT(data->AsBlob.Length == length);
ReadBytes(data->AsBlob.Data, length);
if (data->AsBlob.Length == length)
{
ReadBytes(data->AsBlob.Data, length);
}
else
{
LOG(Error, "Invalid Variant {2} data length {0}. Expected {1} bytes from stream.", data->AsBlob.Length, length, data->Type.ToString());
// Skip those bytes
void* ptr = Allocator::Allocate(length);
ReadBytes(ptr, length);
Allocator::Free(ptr);
}
break;
}
case VariantType::Blob:

View File

@@ -37,9 +37,9 @@ public:
public:
/// <summary>
/// Returns true if error occured during reading/writing to the stream
/// Returns true if error occurred during reading/writing to the stream
/// </summary>
/// <returns>True if error occured during reading/writing to the stream</returns>
/// <returns>True if error occurred during reading/writing to the stream</returns>
virtual bool HasError() const
{
return _hasError;