Unstable 0.16.0.0

This commit is contained in:
Markus Isberg
2022-01-14 01:28:24 +09:00
parent d9baeaa2e1
commit 7d6421a548
237 changed files with 6430 additions and 2205 deletions
@@ -105,6 +105,10 @@ namespace Barotrauma
RequiredSkills = new List<Skill>();
RequiredTime = element.GetAttributeFloat("requiredtime", 1.0f);
OutCondition = element.GetAttributeFloat("outcondition", 1.0f);
if (OutCondition > 1.0f)
{
DebugConsole.AddWarning($"Error in \"{itemPrefab.Name}\"'s fabrication recipe: out condition is above 100% ({OutCondition * 100}).");
}
RequiredItems = new List<RequiredItem>();
RequiresRecipe = element.GetAttributeBool("requiresrecipe", false);
Amount = element.GetAttributeInt("amount", 1);
@@ -1256,13 +1260,18 @@ namespace Barotrauma
public static ItemPrefab Find(string name, string identifier)
{
if (string.IsNullOrEmpty(name) && string.IsNullOrEmpty(identifier))
{
throw new ArgumentException("Both name and identifier cannot be null.");
}
ItemPrefab prefab;
if (string.IsNullOrEmpty(identifier))
{
//legacy support
identifier = GenerateLegacyIdentifier(name);
}
prefab = Find(p => p is ItemPrefab && p.Identifier==identifier) as ItemPrefab;
prefab = Find(p => p is ItemPrefab && p.Identifier == identifier) as ItemPrefab;
//not found, see if we can find a prefab with a matching alias
if (prefab == null && !string.IsNullOrEmpty(name))
@@ -1478,5 +1487,10 @@ namespace Barotrauma
return newElement;
}
public override string ToString()
{
return $"{Name} (identifier: {Identifier})";
}
}
}