From 6917ff7f3c150d6cc560d071fc65c420ae8243b5 Mon Sep 17 00:00:00 2001 From: shmocz <112764837+shmocz@users.noreply.github.com> Date: Sat, 3 Aug 2024 13:59:20 +0300 Subject: [PATCH] Improvements to DisableChat feature --- Makefile | 1 + src/chat_disable.asm | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 src/chat_disable.asm diff --git a/Makefile b/Makefile index bf0e8d7..da58d38 100644 --- a/Makefile +++ b/Makefile @@ -22,6 +22,7 @@ EXE_OBJS = \ src/loading.o \ src/graphics-patch.o \ src/copy-protection.o \ + src/chat_disable.o \ src/multi_spectators_hack.o \ src/absolute_prism_bug_fix.o \ src/self_spy_exploit_fix.o \ diff --git a/src/chat_disable.asm b/src/chat_disable.asm new file mode 100644 index 0000000..76ea802 --- /dev/null +++ b/src/chat_disable.asm @@ -0,0 +1,24 @@ +%include "macros/patch.inc" +%include "macros/datatypes.inc" + +cextern DisableChat + +; Don't send message to others. +hack 0x0055EF38, 0x0055EF3E + cmp byte[DisableChat], 0 + jz .Reg + jmp 0x0055F056 + +.Reg: + cmp edi, ebx + mov dword[esp + 0x14], ebx + jmp hackend + +; After receiving message, don't play sound if AddMessage returns NULL. +hack 0x0048D97E + cmp eax, 0 + je 0x0048D99A + +.Reg: + mov eax, [0x008871E0] + jmp hackend \ No newline at end of file