summaryrefslogtreecommitdiff
path: root/basecommands.py
diff options
context:
space:
mode:
authorDico200 <dico.karssiens@gmail.com>2015-04-08 22:32:54 +0200
committerDico200 <dico.karssiens@gmail.com>2015-04-08 22:32:54 +0200
commitda756d69ccef7346d896a0b8cb2aa5c42b038c7b (patch)
tree49c6c9a518bc25411cb28245b2cae246febcefea /basecommands.py
parent201c76611911de2c5ae0afb2171dfd540de2d012 (diff)
Revert "Change to /modules... trying to make @command work."
This reverts commit 201c76611911de2c5ae0afb2171dfd540de2d012.
Diffstat (limited to 'basecommands.py')
-rw-r--r--basecommands.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/basecommands.py b/basecommands.py
index b88731f..3f113bc 100644
--- a/basecommands.py
+++ b/basecommands.py
@@ -7,6 +7,7 @@ current_main = None
to_see_permission = "utils.showpermission" # See cmd permission in help
def maincommand(function):
+ global current_main
current_main = function
return function
@@ -36,6 +37,7 @@ class subcommand():
self.call = None
def __call__(self, f):
+ global current_subs
def call_sub(sender, command, label, args):
isPlayer = is_player(sender)
if not isSenderValid(senderLimit, isPlayer):
@@ -83,6 +85,7 @@ def command(cmd,
cmd = cmd.lower()
+ global curent_subs
subcommands = []
for subcmd in current_subs:
subcmd.setParent(cmd)
@@ -90,6 +93,7 @@ def command(cmd,
info(subcommands)
current_subs = []
+ global current_main
main_function = current_main
current_main = None
if main_function == None and len(subcommands) != 0: