diff --git a/EXILED/Exiled.Loader/Features/Configs/CustomConverters/VectorsConverter.cs b/EXILED/Exiled.Loader/Features/Configs/CustomConverters/VectorsConverter.cs
index 944e2f2784..f780234d93 100644
--- a/EXILED/Exiled.Loader/Features/Configs/CustomConverters/VectorsConverter.cs
+++ b/EXILED/Exiled.Loader/Features/Configs/CustomConverters/VectorsConverter.cs
@@ -12,6 +12,7 @@ namespace Exiled.Loader.Features.Configs.CustomConverters
using System.Globalization;
using System.IO;
+ using Exiled.API.Features;
using Exiled.API.Features.Pools;
using UnityEngine;
@@ -21,18 +22,37 @@ namespace Exiled.Loader.Features.Configs.CustomConverters
using YamlDotNet.Serialization;
///
- /// Converts a Vector2, Vector3 or Vector4 to Yaml configs and vice versa.
+ /// Converts a Vector2, Vector3 or Vector4 (including nullable) to Yaml configs and vice versa.
///
public sealed class VectorsConverter : IYamlTypeConverter
{
///
- public bool Accepts(Type type) => type == typeof(Vector2) || type == typeof(Vector3) || type == typeof(Vector4);
+ public bool Accepts(Type type)
+ {
+ Type baseType = Nullable.GetUnderlyingType(type) ?? type;
+ return baseType == typeof(Vector2) || baseType == typeof(Vector3) || baseType == typeof(Vector4);
+ }
///
public object ReadYaml(IParser parser, Type type)
{
+ Type baseType = Nullable.GetUnderlyingType(type) ?? type;
+
+ if (parser.TryConsume(out Scalar scalar))
+ {
+ if (string.IsNullOrEmpty(scalar.Value) || scalar.Value.Equals("null", StringComparison.OrdinalIgnoreCase))
+ {
+ if (Nullable.GetUnderlyingType(type) != null)
+ return null;
+
+ Log.Error($"Cannot assign null to non-nullable type {baseType.FullName}.");
+ }
+
+ Log.Error($"Expected mapping, but got scalar: {scalar.Value}");
+ }
+
if (!parser.TryConsume(out _))
- throw new InvalidDataException($"Cannot deserialize object of type {type.FullName}.");
+ Log.Error($"Cannot deserialize object of type {type.FullName}.");
List