Skip to content

Commit d124057

Browse files
committed
Serialize kv2 byte arrays as "binary" at all times (asset_preview_thumbnail in map files)
1 parent 00de752 commit d124057

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

Codecs/KeyValues2.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,14 @@ void WriteAttribute(string name, Type type, object value, bool in_array)
177177
{
178178
// TODO: subclass check in this method like above - and in all other places with == typeof(Element)
179179
inner_type = Datamodel.GetArrayInnerType(type);
180+
181+
if (inner_type == typeof(byte))
182+
inner_type = null; // serialize as binary at all times
183+
184+
/*
180185
if (inner_type == typeof(byte) && !ValidAttributes[EncodingVersion].Contains(typeof(byte)))
181186
inner_type = null; // fall back on the "binary" type in older KV2 versions
187+
*/
182188
}
183189

184190
// Elements are supported by all.

0 commit comments

Comments
 (0)