pass cheat class by args
This commit is contained in:
parent
e3b13e9e80
commit
bb7bd4e419
1 changed files with 3 additions and 3 deletions
6
main.py
6
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:
|
||||
|
|
Reference in a new issue