Skip to content

Commit

Permalink
fix(Duolingo - Unlock Super): Get correct instruction offset (#3023)
Browse files Browse the repository at this point in the history
  • Loading branch information
Elassyo committed Sep 24, 2023
1 parent 0e0b735 commit 5146de8
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ object UnlockDuolingoSuperPatch : BytecodePatch(
}

private fun MutableMethod.indexOfReference(reference: Reference) = getInstructions()
.filterIsInstance<BuilderInstruction22c>()
.filter { it.opcode == Opcode.IPUT_BOOLEAN }.indexOfFirst { it.reference == reference }.let {
.indexOfFirst { it is BuilderInstruction22c && it.opcode == Opcode.IPUT_BOOLEAN && it.reference == reference }
.let {
if (it == -1) throw PatchException("Could not find index of instruction with supplied reference.")
else it
}
Expand Down

0 comments on commit 5146de8

Please sign in to comment.