Gvas: fix some JSON!MASS fuckery.
To the community: I know VD didn't properly QA it, but please, be careful with the system!
This commit is contained in:
parent
975c4c8664
commit
0da7de19fc
1 changed files with 11 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue