Changes to settings/contentpackage exception handling

This commit is contained in:
Regalis11
2015-08-12 19:35:43 +03:00
parent 5771bc7e02
commit b2d6548fce
3 changed files with 21 additions and 31 deletions
+3 -2
View File
@@ -54,13 +54,14 @@ namespace Subsurface
{
XDocument doc = ToolBox.TryLoadXml(filePath);
Path = filePath;
if (doc==null)
{
DebugConsole.ThrowError("Couldn't load content package ''"+filePath+"''!");
return;
}
Path = filePath;
name = ToolBox.GetAttributeString(doc.Root, "name", "");
@@ -78,7 +79,7 @@ namespace Subsurface
public static ContentPackage CreatePackage(string name)
{
ContentPackage newPackage = new ContentPackage();
ContentPackage newPackage = new ContentPackage("Content/Data/"+name);
newPackage.name = name;
list.Add(newPackage);