v0.18.15.0

This commit is contained in:
Regalis11
2022-07-14 16:54:36 +03:00
parent 497045de7e
commit 4a03ee5ab2
36 changed files with 240 additions and 151 deletions
@@ -113,15 +113,23 @@ namespace Barotrauma
string teamStr = element.GetAttributeString("outpostteam", "FriendlyNPC");
Enum.TryParse(teamStr, out OutpostTeam);
ContentPath nameFile = element.GetAttributeContentPath("namefile") ?? ContentPath.FromRaw(null, "Content/Map/locationNames.txt");
try
string[] rawNamePaths = element.GetAttributeStringArray("namefile", new string[] { "Content/Map/locationNames.txt" });
names = new List<string>();
foreach (string rawPath in rawNamePaths)
{
names = File.ReadAllLines(nameFile.Value).ToList();
try
{
var path = ContentPath.FromRaw(element.ContentPackage, rawPath.Trim());
names.AddRange(File.ReadAllLines(path.Value).ToList());
}
catch (Exception e)
{
DebugConsole.ThrowError($"Failed to read name file \"rawPath\" for location type \"{Identifier}\"!", e);
}
}
catch (Exception e)
if (!names.Any())
{
DebugConsole.ThrowError("Failed to read name file for location type \"" + Identifier + "\"!", e);
names = new List<string>() { "Name file not found" };
names.Add("ERROR: No names found");
}
string[] commonnessPerZoneStrs = element.GetAttributeStringArray("commonnessperzone", Array.Empty<string>());