From bb7bd4e41913fd4c1175b7e63a1ee19e66e77abd Mon Sep 17 00:00:00 2001 From: Mylloon Date: Thu, 6 Apr 2023 12:57:05 +0200 Subject: [PATCH] pass cheat class by args --- main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index b37c99e..b78c40b 100644 --- a/main.py +++ b/main.py @@ -5,11 +5,11 @@ from threading import Thread from cheat import Cheat, sleep # type: ignore -def do_on_exit(running: list) -> None: +def do_on_exit(cheats: Cheat, running: list) -> None: """Called when the program end""" for fn in running: try: - unloader = getattr(c, f"{fn}_unload") + unloader = getattr(cheats, f"{fn}_unload") except: pass else: @@ -75,7 +75,7 @@ if __name__ == "__main__": else: print(f"{fn} is incompatible with: {', '.join(incompatible)}") - register(do_on_exit, running) + register(do_on_exit, c, running) # Don't close the main thread as cheats are daemons while True: