Unstable 0.16.0.0
This commit is contained in:
@@ -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})";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user