Unstable 0.14.5.0

This commit is contained in:
Markus Isberg
2021-06-14 17:53:42 +03:00
parent 1f3e588fcd
commit 23a7c37eee
25 changed files with 254 additions and 259 deletions
@@ -525,7 +525,15 @@ namespace Barotrauma
public string GetOptionName(string id)
{
return Prefab == null ? OptionNames[id] : Prefab.OptionNames[id];
if (Prefab == null)
{
if (OptionNames.ContainsKey(id)) { return OptionNames[id]; }
}
else
{
if (Prefab.OptionNames.ContainsKey(id)) { return Prefab.OptionNames[id]; }
}
return string.Empty;
}
public string GetOptionName(int index)
@@ -37,7 +37,14 @@ namespace Barotrauma
private static bool IsThalamus(MapEntityPrefab entityPrefab, string tag) => entityPrefab.HasSubCategory("thalamus") || entityPrefab.Tags.Contains(tag);
public WreckAI(Submarine wreck)
public static WreckAI Create(Submarine wreck)
{
var wreckAI = new WreckAI(wreck);
if (wreckAI.Config == null) { return null; }
return wreckAI;
}
private WreckAI(Submarine wreck)
{
Wreck = wreck;
Config = WreckAIConfig.GetRandom();