v0.18.15.0
This commit is contained in:
@@ -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>());
|
||||
|
||||
Reference in New Issue
Block a user