baba booey

This commit is contained in:
Will Corby 2022-01-02 18:10:28 -08:00
parent 653f84e0c9
commit e0cf9a9d2d

View File

@ -4,6 +4,7 @@ using Mono.Cecil.Cil;
using Mono.Cecil.Rocks; using Mono.Cecil.Rocks;
using QSB.Messaging; using QSB.Messaging;
using QSB.Utility; using QSB.Utility;
using System;
using System.Linq; using System.Linq;
using System.Reflection; using System.Reflection;
@ -74,7 +75,7 @@ namespace QSBTests
{ {
UseType.Store => OpCodes.Stfld, UseType.Store => OpCodes.Stfld,
UseType.Load => OpCodes.Ldfld, UseType.Load => OpCodes.Ldfld,
_ => throw new System.NotImplementedException(), _ => throw new ArgumentOutOfRangeException(nameof(useType), useType, null)
}; };
while (true) while (true)
@ -95,11 +96,11 @@ namespace QSBTests
break; break;
} }
var callBase = il.Any(x => var callsBase = il.Any(x =>
x.IsOp(OpCodes.Call, out MethodReference m) && x.IsOp(OpCodes.Call, out MethodReference m) &&
m.Eq(baseMethod) m.Eq(baseMethod)
); );
if (!callBase) if (!callsBase)
{ {
break; break;
} }