diff --git a/Source/Editor/Content/Items/AssetItem.cs b/Source/Editor/Content/Items/AssetItem.cs
index b1a4996eb..466ef5c3f 100644
--- a/Source/Editor/Content/Items/AssetItem.cs
+++ b/Source/Editor/Content/Items/AssetItem.cs
@@ -80,7 +80,7 @@ namespace FlaxEditor.Content
// Translate asset type name
var typeName = TypeName;
string[] typeNamespaces = typeName.Split('.');
- if (typeNamespaces.Length != 0 && typeNamespaces.Length != 0)
+ if (typeNamespaces.Length != 0 && typeNamespaces[typeNamespaces.Length - 1].Length != 0)
{
typeName = Utilities.Utils.GetPropertyNameUI(typeNamespaces[typeNamespaces.Length - 1]);
}
diff --git a/Source/Editor/GUI/Dialogs/Dialog.cs b/Source/Editor/GUI/Dialogs/Dialog.cs
index 9d1461074..863ca1484 100644
--- a/Source/Editor/GUI/Dialogs/Dialog.cs
+++ b/Source/Editor/GUI/Dialogs/Dialog.cs
@@ -22,7 +22,7 @@ namespace FlaxEditor.GUI.Dialogs
///
/// The parent window.
///
- protected Window _window;
+ protected volatile Window _window;
///
/// The dialog result.
diff --git a/Source/Editor/Surface/VisjectSurface.Input.cs b/Source/Editor/Surface/VisjectSurface.Input.cs
index a867eec3d..9b6f86bcb 100644
--- a/Source/Editor/Surface/VisjectSurface.Input.cs
+++ b/Source/Editor/Surface/VisjectSurface.Input.cs
@@ -492,7 +492,7 @@ namespace FlaxEditor.Surface
Focus();
return true;
}
- if (_rightMouseDown || (_middleMouseDown && _middleMouseDown))
+ if (_rightMouseDown || _middleMouseDown)
{
// Start navigating
StartMouseCapture();
diff --git a/Source/Editor/Utilities/MemberComparison.cs b/Source/Editor/Utilities/MemberComparison.cs
index 0de7a682c..18d12c263 100644
--- a/Source/Editor/Utilities/MemberComparison.cs
+++ b/Source/Editor/Utilities/MemberComparison.cs
@@ -79,7 +79,7 @@ namespace FlaxEditor.Utilities
value = Convert.ToInt32(value);
else if (type.Type == typeof(long))
value = Convert.ToInt64(value);
- else if (type.Type == typeof(int))
+ else if (type.Type == typeof(ushort))
value = Convert.ToUInt16(value);
else if (type.Type == typeof(uint))
value = Convert.ToUInt32(value);
diff --git a/Source/Engine/Content/Storage/FlaxStorage.cpp b/Source/Engine/Content/Storage/FlaxStorage.cpp
index c3e377110..f8c466deb 100644
--- a/Source/Engine/Content/Storage/FlaxStorage.cpp
+++ b/Source/Engine/Content/Storage/FlaxStorage.cpp
@@ -662,13 +662,13 @@ bool FlaxStorage::LoadAssetChunk(FlaxChunk* chunk)
if (!failed)
{
stream->SetPosition(chunk->LocationInFile.Address);
+ if (!stream->HasError())
+ break;
}
- if (!stream->HasError())
- break;
}
}
- if (stream->HasError())
+ if (!stream || stream->HasError())
{
failed = true;
UnlockChunks();
diff --git a/Source/Engine/Core/Math/Matrix2x2.cs b/Source/Engine/Core/Math/Matrix2x2.cs
index fc4f52c74..862bd8f5a 100644
--- a/Source/Engine/Core/Math/Matrix2x2.cs
+++ b/Source/Engine/Core/Math/Matrix2x2.cs
@@ -94,8 +94,8 @@ namespace FlaxEngine
throw new ArgumentOutOfRangeException(nameof(values), "There must be sixteen and only four input values for Matrix2x2.");
M11 = values[0];
M12 = values[1];
- M21 = values[3];
- M22 = values[4];
+ M21 = values[2];
+ M22 = values[3];
}
///
diff --git a/Source/Engine/Core/Types/DataContainer.h b/Source/Engine/Core/Types/DataContainer.h
index 6ad6f75c9..7893eb1ca 100644
--- a/Source/Engine/Core/Types/DataContainer.h
+++ b/Source/Engine/Core/Types/DataContainer.h
@@ -324,15 +324,14 @@ public:
{
if (length <= 0)
return;
- if (Base::Length() == 0)
+ auto prev = Base::_data;
+ const auto prevLength = Base::_length;
+ if (prevLength == 0 || prev == nullptr)
{
Copy(data, length);
return;
}
- auto prev = Base::_data;
- const auto prevLength = Base::_length;
-
Base::_length = prevLength + length;
Base::_data = (T*)Allocator::Allocate(Base::_length * sizeof(T));
diff --git a/Source/Engine/Core/Types/Variant.cpp b/Source/Engine/Core/Types/Variant.cpp
index 7061567f7..3dd403d5f 100644
--- a/Source/Engine/Core/Types/Variant.cpp
+++ b/Source/Engine/Core/Types/Variant.cpp
@@ -2702,8 +2702,8 @@ void Variant::SetAsset(Asset* asset)
SetType(VariantType(VariantType::Asset));
if (AsAsset)
{
- asset->OnUnloaded.Unbind(this);
- asset->RemoveReference();
+ AsAsset->OnUnloaded.Unbind(this);
+ AsAsset->RemoveReference();
}
AsAsset = asset;
if (asset)
diff --git a/Source/Engine/UI/GUI/WindowRootControl.cs b/Source/Engine/UI/GUI/WindowRootControl.cs
index 72ae2ade3..e6a86e64e 100644
--- a/Source/Engine/UI/GUI/WindowRootControl.cs
+++ b/Source/Engine/UI/GUI/WindowRootControl.cs
@@ -77,7 +77,7 @@ namespace FlaxEngine.GUI
///
public void Hide()
{
- _window.Show();
+ _window.Hide();
}
///