Fix destroy not being informative about moved content. Resolve #2971

This commit is contained in:
Griatch 2022-11-07 18:31:14 +01:00
parent 560c9356bb
commit 68d45f3526

View file

@ -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: