pass cheat class by args

This commit is contained in:
Mylloon 2023-04-06 12:57:05 +02:00
parent e3b13e9e80
commit bb7bd4e419
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -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: