Fix LuaUserData.IsTargetType not behaving as originally due to it comparing types
This commit is contained in:
@@ -85,7 +85,7 @@ namespace Barotrauma
|
||||
if (targetType == null) { throw new ScriptRuntimeException("target type not found"); }
|
||||
|
||||
Type type = obj is Type ? (Type)obj : obj.GetType();
|
||||
return type == targetType;
|
||||
return targetType.IsAssignableFrom(type);
|
||||
}
|
||||
|
||||
public static string TypeOf(object obj)
|
||||
|
||||
Reference in New Issue
Block a user