@@ -6,6 +6,7 @@ namespace GMSL.Hooker;
66
77public static class UndertaleInstructionExtensions {
88 public static bool Match ( this UndertaleInstruction left , UndertaleInstruction right ) {
9+ left .
910 return left . Kind == right. Kind && UndertaleInstruction. GetInstructionType( left . Kind ) switch {
1011 UndertaleInstruction . InstructionType . SingleTypeInstruction => left . MatchType ( right ) ,
1112 UndertaleInstruction. InstructionType . DoubleTypeInstruction => left. MatchType ( right ) ,
@@ -31,18 +32,16 @@ private static bool MatchPop(this UndertaleInstruction left, UndertaleInstructio
3132 left . Type1 == right . Type1 &&
3233 ( left . Type1 == UndertaleInstruction . DataType . Int16 && left . SwapExtra == right . SwapExtra ||
3334 left . Type1 != UndertaleInstruction . DataType . Int16 && left . TypeInst == right . TypeInst &&
34- left . Destination . Type == right . Destination . Type && left . Destination . Target == right . Destination . Target ) ;
35+ left . ValueVariable . InstanceType == right . ValueVariable . InstanceType && left . ValueInt == right . ValueInt ) ;
3536
3637 private static bool MatchPush ( this UndertaleInstruction left , UndertaleInstruction right ) =>
3738 left . Type1 == right . Type1 && left . Type1 switch {
3839 UndertaleInstruction . DataType . Int32 when
39- left . Value is UndertaleInstruction . Reference < UndertaleFunction > leftRef &&
40- right . Value is UndertaleInstruction . Reference < UndertaleFunction > rightRef => leftRef . Type ==
41- rightRef . Type && leftRef . Target == rightRef . Target ,
40+ left . ValueFunction is UndertaleFunction leftRef &&
41+ right . ValueFunction is UndertaleFunction rightRef => leftRef == rightRef ,
4242 UndertaleInstruction . DataType . Variable when
43- left . Value is UndertaleInstruction . Reference < UndertaleVariable > leftRef &&
44- right . Value is UndertaleInstruction . Reference < UndertaleVariable > rightRef => leftRef . Type ==
45- rightRef . Type && leftRef . Target == rightRef . Target ,
43+ left . ValueVariable is UndertaleVariable leftRef &&
44+ right . ValueVariable is UndertaleVariable rightRef => leftRef == rightRef ,
4645 UndertaleInstruction . DataType . Variable when
4746 left . Value is UndertaleResourceById < UndertaleString , UndertaleChunkSTRG > leftRef &&
4847 right . Value is UndertaleResourceById < UndertaleString , UndertaleChunkSTRG > rightRef =>
0 commit comments