GameInfo doesn't crash anymore, but still needs to be improved.
This commit is contained in:
parent
be6e4a496b
commit
2abadc4071
@ -24,7 +24,7 @@ public class Mod
|
|||||||
// Root mod directory found, go from here.
|
// Root mod directory found, go from here.
|
||||||
|
|
||||||
FileStream fs = new(gameInfoPath, FileMode.Open);
|
FileStream fs = new(gameInfoPath, FileMode.Open);
|
||||||
GameInfo? modInfo = SerializeVkv.Deserialize<GameInfo>(fs); // TODO: constructor should be public i think
|
GameInfo? modInfo = SerializeVkv.Deserialize<GameInfo>(fs);
|
||||||
if (modInfo is null) continue;
|
if (modInfo is null) continue;
|
||||||
|
|
||||||
Mod mod = new()
|
Mod mod = new()
|
||||||
|
|||||||
@ -35,7 +35,7 @@ public class GameInfo
|
|||||||
public bool SupportsXBox360;
|
public bool SupportsXBox360;
|
||||||
public FileSystemData FileSystem;
|
public FileSystemData FileSystem;
|
||||||
|
|
||||||
internal GameInfo()
|
public GameInfo()
|
||||||
{
|
{
|
||||||
Game = string.Empty;
|
Game = string.Empty;
|
||||||
Title = string.Empty;
|
Title = string.Empty;
|
||||||
@ -60,7 +60,7 @@ public class GameInfo
|
|||||||
// Can't make the keys here enums because they can be strung together,
|
// Can't make the keys here enums because they can be strung together,
|
||||||
public Dictionary<string, string> SearchPaths;
|
public Dictionary<string, string> SearchPaths;
|
||||||
|
|
||||||
internal FileSystemData()
|
public FileSystemData()
|
||||||
{
|
{
|
||||||
SearchPaths = new();
|
SearchPaths = new();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -57,7 +57,6 @@ public static class VkvConvert
|
|||||||
{
|
{
|
||||||
if (current == "}") break;
|
if (current == "}") break;
|
||||||
VkvNode? output = DeserializeNode(reader, options, out string subName, current);
|
VkvNode? output = DeserializeNode(reader, options, out string subName, current);
|
||||||
if (output is null) throw new VkvSerializationException("Error deserializing sub-node.");
|
|
||||||
tree[subName] = output;
|
tree[subName] = output;
|
||||||
}
|
}
|
||||||
if (current is null) throw new VkvSerializationException("Reached end-of-file while deserializing group.");
|
if (current is null) throw new VkvSerializationException("Reached end-of-file while deserializing group.");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user