Skip to content

Commit

Permalink
Merge pull request #555 from ow-mods/dev
Browse files Browse the repository at this point in the history
2.9.7
  • Loading branch information
misternebula authored Aug 21, 2023
2 parents b79c05c + 86032d4 commit 13280bd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 28 deletions.
2 changes: 1 addition & 1 deletion src/OWML.Launcher/OWML.Manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"author": "Alek",
"name": "OWML",
"uniqueName": "Alek.OWML",
"version": "2.9.6",
"version": "2.9.7",
"minGameVersion": "1.1.13.393",
"maxGameVersion": "1.1.13.456"
}
29 changes: 2 additions & 27 deletions src/OWML.ModHelper.Interaction/InterfaceProxyBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,33 +78,8 @@ bool AreTypesMatching(Type a, Type b)

if (a.IsEnum && b.IsEnum)
{
if (Enum.GetNames(a).Length != Enum.GetNames(b).Length
|| a.Name != b.Name
|| a.GetEnumUnderlyingType() != b.GetEnumUnderlyingType())
{
return false;
}

for (var i = 0; i < Enum.GetNames(a).Length; i++)
{
var nameA = Enum.GetNames(a)[i];
var nameB = Enum.GetNames(b)[i];

if (nameA != nameB)
{
return false;
}

var valueA = Convert.ChangeType(Enum.Parse(a, nameA), a.GetEnumUnderlyingType());
var valueB = Convert.ChangeType(Enum.Parse(b, nameB), b.GetEnumUnderlyingType());

if (!valueA.Equals(valueB))
{
return false;
}
}

return true;
return a.Name == b.Name
&& a.GetEnumUnderlyingType() == b.GetEnumUnderlyingType();
}

if (a.IsGenericParameter)
Expand Down

0 comments on commit 13280bd

Please sign in to comment.