Skip to content

Commit 0cee445

Browse files
authored
Merge pull request #55 from InfinaMii/hotfix
Fix Toolbox YAML crash
2 parents 81f7fd9 + c9e9839 commit 0cee445

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

Plugins/TurboLibrary/FileData/Muunt/MapObj/SoundObj.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,19 @@ public SoundObj()
114114
/// <param name="dictionary">The <see cref="IDictionary{String, Object}"/> to read the data from.</param>
115115
public void DeserializeByaml(IDictionary<string, object> dictionary)
116116
{
117-
TopView = (string)dictionary["TopView"] == "True";
117+
if (dictionary["TopView"] is string)
118+
TopView = (string)dictionary["TopView"] == "True";
119+
else
120+
TopView = (bool)dictionary["TopView"];
118121
ModeInclusion = ModeInclusion.FromDictionary(dictionary);
119122

120-
if (dictionary.TryGetValue("Single", out object single)) Single = (string)single == "true";
123+
if (dictionary.TryGetValue("Single", out object single))
124+
{
125+
if (single is string)
126+
Single = (string)single == "true";
127+
else
128+
Single = (bool)single;
129+
}
121130
}
122131

123132
/// <summary>

0 commit comments

Comments
 (0)