Fixed an error in @delete that caused ranges of dbrefs not work non-locally. Based on patch supplied in Issue 344 (thanks!).

This commit is contained in:
Griatch 2013-01-20 17:23:31 +01:00
parent e8d93dedbe
commit 91281e6bb8

View file

@ -538,10 +538,10 @@ class CmdDestroy(MuxCommand):
caller.msg("Usage: @destroy[/switches] [obj, obj2, obj3, [dbref-dbref],...]")
return ""
def delobj(objname):
def delobj(objname, byref=False):
# helper function for deleting a single object
string = ""
obj = caller.search(objname)
obj = caller.search(objname, global_dbref=byref)
if not obj:
self.caller.msg(" (Objects to destroy must either be local or specified with a unique dbref.)")
return ""
@ -575,7 +575,7 @@ class CmdDestroy(MuxCommand):
dmin, dmax = [utils.dbref(part, reqhash=False) for part in objname.split('-', 1)]
if dmin and dmax:
for dbref in range(int(dmin),int(dmax+1)):
string += delobj("#" + str(dbref))
string += delobj("#" + str(dbref), True)
else:
string += delobj(objname)
else: