Fix destroy not being informative about moved content. Resolve #2971
This commit is contained in:
parent
560c9356bb
commit
68d45f3526
1 changed files with 6 additions and 6 deletions
|
|
@ -789,12 +789,12 @@ class CmdDestroy(COMMAND_DEFAULT_CLASS):
|
||||||
"object before continuing."
|
"object before continuing."
|
||||||
)
|
)
|
||||||
|
|
||||||
had_exits = hasattr(obj, "exits") and obj.exits
|
# check if object to delete had exits or objects inside it
|
||||||
had_objs = hasattr(obj, "contents") and any(
|
obj_exits = obj.exits if hasattr(obj, "exits") else ()
|
||||||
obj
|
obj_contents = obj.contents if hasattr(obj, "contents") else ()
|
||||||
for obj in obj.contents
|
had_exits = bool(obj_exits)
|
||||||
if not (hasattr(obj, "exits") and obj not in obj.exits)
|
had_objs = any(entity for entity in obj_contents if entity not in obj_exits)
|
||||||
)
|
|
||||||
# do the deletion
|
# do the deletion
|
||||||
okay = obj.delete()
|
okay = obj.delete()
|
||||||
if not okay:
|
if not okay:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue