Fixed a bug in batchcommand that caused crashes. Resolves issue 153.
This commit is contained in:
parent
6c53ec2bdb
commit
c81d238b0c
2 changed files with 6 additions and 17 deletions
|
|
@ -367,7 +367,7 @@ class CmdSetHandler(object):
|
||||||
"""
|
"""
|
||||||
self.cmdset_stack = [self.cmdset_stack[0]]
|
self.cmdset_stack = [self.cmdset_stack[0]]
|
||||||
self.mergetype_stack = [self.cmdset_stack[0].mergetype]
|
self.mergetype_stack = [self.cmdset_stack[0].mergetype]
|
||||||
self.permanent_paths[0] = [self.permanent_paths[0]]
|
self.permanent_paths = [self.permanent_paths[0]]
|
||||||
self.obj.cmdset_storage = self.permanent_paths
|
self.obj.cmdset_storage = self.permanent_paths
|
||||||
self.update()
|
self.update()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -247,11 +247,6 @@ class CmdBatchCommands(MuxCommand):
|
||||||
return
|
return
|
||||||
step_pointer(caller, 1)
|
step_pointer(caller, 1)
|
||||||
# clean out the safety cmdset and clean out all other temporary attrs.
|
# clean out the safety cmdset and clean out all other temporary attrs.
|
||||||
caller.cmdset.delete(BatchSafeCmdSet)
|
|
||||||
del caller.ndb.batch_stack
|
|
||||||
del caller.ndb.batch_stackptr
|
|
||||||
del caller.ndb.batch_pythonpath
|
|
||||||
del caller.ndb.batch_batchmode
|
|
||||||
string = " Batchfile '%s' applied." % python_path
|
string = " Batchfile '%s' applied." % python_path
|
||||||
caller.msg("{G%s" % string)
|
caller.msg("{G%s" % string)
|
||||||
purge_processor(caller)
|
purge_processor(caller)
|
||||||
|
|
@ -334,12 +329,6 @@ class CmdBatchCode(MuxCommand):
|
||||||
if not batch_code_exec(caller):
|
if not batch_code_exec(caller):
|
||||||
return
|
return
|
||||||
step_pointer(caller, 1)
|
step_pointer(caller, 1)
|
||||||
# clean out the safety cmdset and clean out all other temporary attrs.
|
|
||||||
caller.cmdset.delete(BatchSafeCmdSet)
|
|
||||||
del caller.ndb.batch_stack
|
|
||||||
del caller.ndb.batch_stackptr
|
|
||||||
del caller.ndb.batch_pythonpath
|
|
||||||
del caller.ndb.batch_batchmode
|
|
||||||
string = " Batchfile '%s' applied." % python_path
|
string = " Batchfile '%s' applied." % python_path
|
||||||
caller.msg("{G%s" % string)
|
caller.msg("{G%s" % string)
|
||||||
purge_processor(caller)
|
purge_processor(caller)
|
||||||
|
|
@ -415,9 +404,9 @@ class CmdStateRR(MuxCommand):
|
||||||
def func(self):
|
def func(self):
|
||||||
caller = self.caller
|
caller = self.caller
|
||||||
if caller.ndb.batch_batchmode == "batch_code":
|
if caller.ndb.batch_batchmode == "batch_code":
|
||||||
BATCHCODE.read_file(caller.ndb.batch_pythonpath)
|
BATCHCODE.parse_file(caller.ndb.batch_pythonpath)
|
||||||
else:
|
else:
|
||||||
BATCHCMD.read_file(caller.ndb.batch_pythonpath)
|
BATCHCMD.parse_file(caller.ndb.batch_pythonpath)
|
||||||
caller.msg(format_code("File reloaded. Staying on same command."))
|
caller.msg(format_code("File reloaded. Staying on same command."))
|
||||||
show_curr(caller)
|
show_curr(caller)
|
||||||
|
|
||||||
|
|
@ -435,9 +424,9 @@ class CmdStateRRR(MuxCommand):
|
||||||
def func(self):
|
def func(self):
|
||||||
caller = self.caller
|
caller = self.caller
|
||||||
if caller.ndb.batch_batchmode == "batch_code":
|
if caller.ndb.batch_batchmode == "batch_code":
|
||||||
BATCHCODE.read_file(caller.ndb.batch_pythonpath)
|
BATCHCODE.parse_file(caller.ndb.batch_pythonpath)
|
||||||
else:
|
else:
|
||||||
BATCHCMD.read_file(caller.ndb.batch_pythonpath)
|
BATCHCMD.parse_file(caller.ndb.batch_pythonpath)
|
||||||
caller.ndb.batch_stackptr = 0
|
caller.ndb.batch_stackptr = 0
|
||||||
caller.msg(format_code("File reloaded. Restarting from top."))
|
caller.msg(format_code("File reloaded. Restarting from top."))
|
||||||
show_curr(caller)
|
show_curr(caller)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue