Skip to content

Commit 5673342

Browse files
committed
Fixed <type>Command decorators not unregistering.
Changed all instances of GameEvent to game_event.
1 parent 031dc1e commit 5673342

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

addons/source-python/packages/source-python/commands/command.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ def __call__(self, callback):
4242
self._manager_class.register_commands(
4343
self.names, self.callback, *self.args, **self.kwargs)
4444

45+
# Return the object
46+
return self
47+
4548
def _unload_instance(self):
4649
'''Unregisters the commands'''
4750
self._manager_class.unregister_commands(self.names, self.callback)

addons/source-python/packages/source-python/downloads.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def _add_to_download_table(self, item):
8282
# Reset the lock status
8383
EngineServer.lock_network_string_tables(locked)
8484

85-
def server_spawn(self, GameEvent):
85+
def server_spawn(self, game_event):
8686
'''Adds all items stored as downloadables to the stringtable'''
8787

8888
# Refresh the downloadables table instance

addons/source-python/packages/source-python/events/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ def __init__(self, callback):
4848
# Register the event
4949
EventRegistry.register_for_event(self.callback.__name__, self.callback)
5050

51-
def __call__(self, GameEvent):
51+
def __call__(self, game_event):
5252
'''Calls the Event callback with the GameEvent instance'''
53-
return self.callback(GameEvent)
53+
return self.callback(game_event)
5454

5555
def _unload_instance(self):
5656
'''Unregisters the event'''

0 commit comments

Comments
 (0)