Skip to content

Commit

Permalink
Fix friend sort on initial friend list
Browse files Browse the repository at this point in the history
  • Loading branch information
Suli authored and lmsv-mx123 committed Apr 24, 2023
1 parent f18ee84 commit 44f8eca
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Client/JClassPatcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -2041,6 +2041,16 @@ private void patchConnection(ClassNode node) {
new MethodInsnNode(
Opcodes.INVOKESTATIC, "Game/Client", "sortFriends", "()V", false));
}

if (insnNode.getOpcode() == Opcodes.GETFIELD
&& ((FieldInsnNode) insnNode).name.equals("jd")
&& nextNode.getOpcode() == Opcodes.IF_ICMPLT
&& nextNode.getNext().getOpcode() == Opcodes.GOTO) {
methodNode.instructions.insert(
nextNode,
new MethodInsnNode(
Opcodes.INVOKESTATIC, "Game/Client", "sortFriends", "()V", false));
}

if (insnNode.getOpcode() == Opcodes.LDC
&& ((LdcInsnNode) insnNode).cst.equals(" has been added to your friends list")) {
Expand Down

0 comments on commit 44f8eca

Please sign in to comment.