Simplify how None is handled and fixed libs getting loaded too late
This commit is contained in:
@@ -2,11 +2,6 @@
|
||||
|
||||
namespace Barotrauma
|
||||
{
|
||||
public struct LuaNone
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public struct LuaSByte
|
||||
{
|
||||
public readonly sbyte Value;
|
||||
|
||||
@@ -256,14 +256,12 @@ namespace Barotrauma
|
||||
|
||||
Script.GlobalOptions.CustomConverters.SetScriptToClrCustomConversion(dataType, typeof(Option<T>), v =>
|
||||
{
|
||||
if (v.UserData.Object is LuaNone)
|
||||
{
|
||||
return Option<T>.None();
|
||||
}
|
||||
else
|
||||
{
|
||||
return Option<T>.Some(v.ToObject<T>());
|
||||
}
|
||||
return Option<T>.Some(v.ToObject<T>());
|
||||
});
|
||||
|
||||
Script.GlobalOptions.CustomConverters.SetScriptToClrCustomConversion(DataType.Nil, typeof(Option<T>), v =>
|
||||
{
|
||||
return Option<T>.None();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user