Unstable 0.15.15.0 (and the one before it I forgor)
This commit is contained in:
@@ -13,6 +13,7 @@ namespace Barotrauma
|
||||
public float Commonness;
|
||||
public string Identifier;
|
||||
public string BiomeIdentifier;
|
||||
public float SpawnDistance;
|
||||
|
||||
public bool UnlockPathEvent;
|
||||
public string UnlockPathTooltip;
|
||||
@@ -46,25 +47,30 @@ namespace Barotrauma
|
||||
UnlockPathTooltip = element.GetAttributeString("unlockpathtooltip", "lockedpathtooltip");
|
||||
UnlockPathReputation = element.GetAttributeInt("unlockpathreputation", 0);
|
||||
UnlockPathFaction = element.GetAttributeString("unlockpathfaction", "");
|
||||
|
||||
SpawnDistance = element.GetAttributeFloat("spawndistance", 0);
|
||||
}
|
||||
|
||||
public bool TryCreateInstance<T>(out T instance) where T : Event
|
||||
{
|
||||
instance = CreateInstance() as T;
|
||||
return instance is T;
|
||||
}
|
||||
|
||||
public Event CreateInstance()
|
||||
{
|
||||
ConstructorInfo constructor = EventType.GetConstructor(new[] { typeof(EventPrefab) });
|
||||
object instance = null;
|
||||
Event instance = null;
|
||||
try
|
||||
{
|
||||
instance = constructor.Invoke(new object[] { this });
|
||||
instance = constructor.Invoke(new object[] { this }) as Event;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
DebugConsole.ThrowError(ex.InnerException != null ? ex.InnerException.ToString() : ex.ToString());
|
||||
}
|
||||
|
||||
Event ev = (Event)instance;
|
||||
if (!ev.LevelMeetsRequirements()) { return null; }
|
||||
|
||||
return (Event)instance;
|
||||
if (instance != null && !instance.LevelMeetsRequirements()) { return null; }
|
||||
return instance;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
|
||||
Reference in New Issue
Block a user