Moved the object's 'description' into an attribute, as suggested in the code. This means that get_description() and set_description() should no longer be used; instead use set_attribute('desc',value) and get_attribute('desc') as you would any attribute. 'desc' is used by the default look command, but apart from that, desc has no special status anymore.

/Griatch
This commit is contained in:
Griatch 2009-05-03 16:55:42 +00:00
parent e7d7284d5c
commit 05554e290a
7 changed files with 45 additions and 49 deletions

View file

@ -296,7 +296,7 @@ def cmd_create(command):
"location": source_object,
"owner": source_object}
new_object = Object.objects.create_object(odat)
new_object.set_attribute('desc', 'Nothing special.')
if len(eq_args)>1:
parent_str = eq_args[1]
if parent_str and new_object.set_script_parent(parent_str):
@ -797,12 +797,12 @@ def cmd_description(command):
return
new_desc = eq_args[1]
if new_desc == '':
source_object.emit_to("%s - DESCRIPTION cleared." % target_obj)
target_obj.set_description(None)
if not new_desc:
source_object.emit_to("%s - description cleared." % target_obj)
target_obj.set_attribute('desc', 'Nothing special.')
else:
source_object.emit_to("%s - DESCRIPTION set." % target_obj)
target_obj.set_description(new_desc)
source_object.emit_to("%s - description set." % target_obj)
target_obj.set_attribute('desc', new_desc)
GLOBAL_CMD_TABLE.add_command("@describe", cmd_description)
def cmd_recover(command):