Fixed bug in destroy command; cleaned up @dig a bit.
This commit is contained in:
parent
9b6bd7125f
commit
557c4eb07b
3 changed files with 35 additions and 28 deletions
|
|
@ -1010,6 +1010,8 @@ def cmd_dig(command):
|
||||||
except ValueError:
|
except ValueError:
|
||||||
exit_names[ie] = exi.strip()
|
exit_names[ie] = exi.strip()
|
||||||
|
|
||||||
|
#source_object.emit_to("dig args: %s %s" % (room_name, exit_names))
|
||||||
|
|
||||||
#start creating things.
|
#start creating things.
|
||||||
if not room_name:
|
if not room_name:
|
||||||
source_object.emit_to("You must supply a new room name.")
|
source_object.emit_to("You must supply a new room name.")
|
||||||
|
|
@ -1031,10 +1033,10 @@ def cmd_dig(command):
|
||||||
if exit_names[0] != None:
|
if exit_names[0] != None:
|
||||||
#create exits to the new room
|
#create exits to the new room
|
||||||
destination = new_room
|
destination = new_room
|
||||||
|
location = source_object.get_location()
|
||||||
|
|
||||||
if destination and not destination.is_exit():
|
if destination and not destination.is_exit():
|
||||||
#create an exit from this room
|
#create an exit from this room to the new one
|
||||||
location = source_object.get_location()
|
|
||||||
new_object = Object.objects.create_object(exit_names[0],
|
new_object = Object.objects.create_object(exit_names[0],
|
||||||
defines_global.OTYPE_EXIT,
|
defines_global.OTYPE_EXIT,
|
||||||
location,
|
location,
|
||||||
|
|
@ -1042,23 +1044,27 @@ def cmd_dig(command):
|
||||||
destination,
|
destination,
|
||||||
script_parent=exit_parents[0])
|
script_parent=exit_parents[0])
|
||||||
ptext = ""
|
ptext = ""
|
||||||
if exit_parents[0]:
|
if exit_parents[0] != None:
|
||||||
script_parent = exit_parents[0]
|
script_parent = exit_parents[0]
|
||||||
if new_object.get_script_parent() == script_parent:
|
if new_object.get_script_parent() == script_parent:
|
||||||
ptext += " of type %s" % script_parent
|
ptext += " of type %s" % script_parent
|
||||||
else:
|
else:
|
||||||
ptext += " of default type (parent '%s' failed!)" % script_parent
|
ptext += " of default type (parent '%s' failed!)" % script_parent
|
||||||
source_object.emit_to("Created exit%s from %s to %s named '%s'." % (ptext,location,destination,new_object))
|
source_object.emit_to("Created exit%s from %s to %s named '%s'." % \
|
||||||
|
(ptext,location,destination,new_object))
|
||||||
if len(exit_names) > 1 and exit_names[1] != None:
|
if len(exit_names) > 1 and exit_names[1] != None:
|
||||||
#create exit back from new room to this one.
|
#create exit back from new room to this one.
|
||||||
|
destination = source_object.get_location()
|
||||||
|
location = new_room
|
||||||
|
if destination and not destination.is_exit():
|
||||||
new_object = Object.objects.create_object(exit_names[1],
|
new_object = Object.objects.create_object(exit_names[1],
|
||||||
defines_global.OTYPE_EXIT,
|
defines_global.OTYPE_EXIT,
|
||||||
destination,
|
|
||||||
source_object,
|
|
||||||
location,
|
location,
|
||||||
|
source_object,
|
||||||
|
destination,
|
||||||
script_parent=exit_parents[1])
|
script_parent=exit_parents[1])
|
||||||
ptext = ""
|
ptext = ""
|
||||||
if exit_parents[1]:
|
if exit_parents[1] != None:
|
||||||
script_parent = exit_parents[1]
|
script_parent = exit_parents[1]
|
||||||
if new_object.get_script_parent() == script_parent:
|
if new_object.get_script_parent() == script_parent:
|
||||||
ptext += " of type %s" % script_parent
|
ptext += " of type %s" % script_parent
|
||||||
|
|
@ -1067,7 +1073,7 @@ def cmd_dig(command):
|
||||||
source_object.emit_to("Created exit%s back from %s to %s named '%s'." % \
|
source_object.emit_to("Created exit%s back from %s to %s named '%s'." % \
|
||||||
(ptext, destination, location, new_object))
|
(ptext, destination, location, new_object))
|
||||||
|
|
||||||
if 'teleport' in switches:
|
if new_room and 'teleport' in switches:
|
||||||
source_object.move_to(new_room)
|
source_object.move_to(new_room)
|
||||||
|
|
||||||
GLOBAL_CMD_TABLE.add_command("@dig", cmd_dig,
|
GLOBAL_CMD_TABLE.add_command("@dig", cmd_dig,
|
||||||
|
|
@ -1341,12 +1347,13 @@ def cmd_lock(command):
|
||||||
value.
|
value.
|
||||||
|
|
||||||
If no keys at all are given, the object is locked for everyone.
|
If no keys at all are given, the object is locked for everyone.
|
||||||
|
|
||||||
When the lock blocks a user, you may customize which error is given by
|
When the lock blocks a user, you may customize which error is given by
|
||||||
storing error messages in an attribute. For DefaultLocks, UseLocks and
|
storing error messages in an attribute. For DefaultLocks, UseLocks and
|
||||||
EnterLocks, these attributes are called lock_msg, use_lock_msg and
|
EnterLocks, these attributes are called lock_msg, use_lock_msg and
|
||||||
enter_lock_msg respectively.
|
enter_lock_msg respectively.
|
||||||
<<TOPIC:lock types>>
|
|
||||||
|
[[lock_types]]
|
||||||
|
|
||||||
Lock types:
|
Lock types:
|
||||||
|
|
||||||
Name: Affects: Effect:
|
Name: Affects: Effect:
|
||||||
|
|
|
||||||
|
|
@ -574,7 +574,7 @@ class Object(models.Model):
|
||||||
text = "player"
|
text = "player"
|
||||||
|
|
||||||
# Obviously, we can't send it back to here.
|
# Obviously, we can't send it back to here.
|
||||||
if home.id == self.id:
|
if home and home.id == self.id:
|
||||||
obj.home = default_home
|
obj.home = default_home
|
||||||
obj.save()
|
obj.save()
|
||||||
home = default_home
|
home = default_home
|
||||||
|
|
|
||||||
|
|
@ -150,14 +150,14 @@ class EvenniaBasicObject(object):
|
||||||
|
|
||||||
description = target_obj.get_attribute_value('desc')
|
description = target_obj.get_attribute_value('desc')
|
||||||
if description is not None:
|
if description is not None:
|
||||||
retval = "%s\r\n%s%s" % (
|
retval = "%s%s\r\n%s%s%s" % ("%ch%cc",
|
||||||
target_obj.get_name(show_dbref=show_dbrefs),
|
target_obj.get_name(show_dbref=show_dbrefs),
|
||||||
target_obj.get_attribute_value('desc'), lock_msg
|
target_obj.get_attribute_value('desc'), lock_msg,
|
||||||
)
|
"%cn")
|
||||||
else:
|
else:
|
||||||
retval = "%s" % (
|
retval = "%s%s%s" % ("%ch%cc",
|
||||||
target_obj.get_name(show_dbref=show_dbrefs),
|
target_obj.get_name(show_dbref=show_dbrefs),
|
||||||
)
|
"%cn")
|
||||||
|
|
||||||
# Storage for the different object types.
|
# Storage for the different object types.
|
||||||
con_players = []
|
con_players = []
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue