v0.19.0.0 (unstable)

This commit is contained in:
Regalis11
2022-07-20 18:47:07 +03:00
parent 2e2663a175
commit 6b55adcdd9
170 changed files with 2769 additions and 1634 deletions
@@ -96,20 +96,17 @@ namespace Barotrauma
private object GetTypeOrDefault(Identifier identifier, Type type, object defaultValue)
{
object? value = GetValue(identifier);
if (value == null)
if (value != null)
{
SetValue(identifier, defaultValue);
if (value.GetType() == type)
{
return value;
}
else
{
DebugConsole.ThrowError($"Attempted to get value \"{identifier}\" as a {type} but the value is {value.GetType()}.");
}
}
else if (value.GetType() == type)
{
return value;
}
else
{
DebugConsole.ThrowError($"Attempted to get value \"{identifier}\" as a {type} but the value is {value.GetType()}.");
}
return defaultValue;
}