diff --git a/src/Gvas/Serialisers/StringProperty.cpp b/src/Gvas/Serialisers/StringProperty.cpp index c9e36f0..9fca2d1 100644 --- a/src/Gvas/Serialisers/StringProperty.cpp +++ b/src/Gvas/Serialisers/StringProperty.cpp @@ -45,7 +45,17 @@ StringProperty::deserialise(Containers::StringView name, Containers::StringView } } - if(!reader.readUEString(prop->value)) { + if(value_length == 4) { + // MASS files (the JSON-based sharing system VD made) have a bug that allows importing weapons of a type in + // another weapon array. It can lead to more serious issues, like weapon names being empty. The code below is an + // attempt to work around that particular issue. + LOG_WARNING_FORMAT("Property {} has an invalid value size {}. Working around it. Please do an action that leads to a write operation.", name, value_length); + value_length++; + prop->value = ""; + std::uint32_t dummy_u32; + reader.readUint32(dummy_u32); + } + else if(!reader.readUEString(prop->value)) { LOG_ERROR_FORMAT("Couldn't read string property {}'s value.", name); return nullptr; }