Changed default dbref search mechanic to require #N format and thus allow searching for objects named as integers (so "@create/drop 2" followed by 'look 2' will now work as expected instead of looking at the object with dbref=2). Doing "look #2" will now look at the object with dbref 2 (Limbo). Resolves Issue 284.

This commit is contained in:
Griatch 2012-10-14 15:45:21 +02:00
parent 31daf5b013
commit 5b5328e6ca
3 changed files with 13 additions and 7 deletions

View file

@ -43,7 +43,7 @@ class ScriptManager(TypedObjectManager):
return []
if key:
dbref = self.dbref(key)
if dbref:
if dbref or dbref == 0:
script = self.filter(db_obj=obj, id=dbref)
if script:
return script
@ -59,7 +59,7 @@ class ScriptManager(TypedObjectManager):
if key:
script = []
dbref = self.dbref(key)
if dbref:
if dbref or dbref == 0:
script = self.dbref_search(dbref)
if not script:
scripts = self.filter(db_key=key)
@ -153,7 +153,7 @@ class ScriptManager(TypedObjectManager):
elif not scripts:
# normal operation
if dbref and self.dbref(dbref):
if dbref and self.dbref(dbref, reqhash=False):
scripts = self.get_id(dbref)
elif obj:
scripts = self.get_all_scripts_on_obj(obj, key=key)