Fix bool value naming for gen8 block editor

Was previously showing RaidArmor for pre-Armor saves, as the reference of a zero-length array was the same as the bools. Just sanity check since all block chunks have length.
This commit is contained in:
Kurt
2020-09-06 11:21:23 -07:00
parent cf9e5ec37f
commit 1114b97c4b

View File

@@ -83,11 +83,14 @@ private string GetBlockHint(SCBlock z, int i)
public string? GetBlockName(SCBlock block, out SaveBlock? saveBlock)
{
// See if we have a Block object for this block
var obj = BlockList.FirstOrDefault(z => ReferenceEquals(z.Key.Data, block.Data));
if (obj.Key != null)
if (block.Data.Length != 0)
{
saveBlock = obj.Key;
return obj.Value;
var obj = BlockList.FirstOrDefault(z => ReferenceEquals(z.Key.Data, block.Data));
if (obj.Key != null)
{
saveBlock = obj.Key;
return obj.Value;
}
}
// See if it's a single-value declaration