- extended error messages in pointers serialization

This commit is contained in:
alexey.lysiuk 2020-08-27 10:13:18 +03:00
parent dad0a6f977
commit fc1f14b2eb

View file

@ -237,13 +237,13 @@ FSerializer &SerializePointer(FSerializer &arc, const char *key, T *&value, T **
{
vv = value - base;
if (vv < 0 || vv >= count)
I_Error("Trying to serialize out-of-bounds array value");
I_Error("Trying to serialize out-of-bounds array value with key '%s', index = %lli, size = %lli", key, vv, count);
}
Serialize(arc, key, vv, nullptr);
if (vv == -1)
value = nullptr;
else if (vv < 0 || vv >= count)
I_Error("Trying to serialize out-of-bounds array value");
I_Error("Trying to serialize out-of-bounds array value with key '%s', index = %lli, size = %lli", key, vv, count);
else
value = base + vv;
}
@ -254,7 +254,7 @@ template<class T>
FSerializer &SerializePointer(FSerializer &arc, const char *key, T *&value, T **defval, TArray<T> &array)
{
if (array.Size() == 0)
I_Error("Trying to serialize a value from empty array");
I_Error("Trying to serialize a value with key '%s' from empty array", key);
return SerializePointer(arc, key, value, defval, array.Data(), array.Size());
}