From 69252340d9bc4f4d5221bbcc7ada7c29481a6c50 Mon Sep 17 00:00:00 2001 From: Griatch Date: Sun, 7 Aug 2016 19:57:13 +0200 Subject: [PATCH] Change move_to behavior when moving from None location. Before, this would force a source location (usually home) but this hides the actual source location, and a None-location has been handled by the announce hooks for some time. Resolves #1011. --- evennia/objects/objects.py | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/evennia/objects/objects.py b/evennia/objects/objects.py index 3849cb43d0..b906f8485a 100644 --- a/evennia/objects/objects.py +++ b/evennia/objects/objects.py @@ -301,10 +301,10 @@ class DefaultObject(with_metaclass(TypeclassBase, ObjectDB)): typeclass (str or Typeclass, or list of either): Limit search only to `Objects` with this typeclass. May be a list of typeclasses for a broader search. - location (Object or list): Specify a location or multiple locations - to search. Note that this is used to query the *contents* of a + location (Object or list): Specify a location or multiple locations + to search. Note that this is used to query the *contents* of a location and will not match for the location itself - - if you want that, don't set this or use `candidates` to specify + if you want that, don't set this or use `candidates` to specify exactly which objects should be searched. attribute_name (str): Define which property to search. If set, no key+alias search will be performed. This can be used @@ -626,17 +626,9 @@ class DefaultObject(with_metaclass(TypeclassBase, ObjectDB)): # Save the old location source_location = self.location - if not source_location: - # there was some error in placing this room. - # we have to set one or we won't be able to continue - if self.home: - source_location = self.home - else: - default_home = ObjectDB.objects.get_id(settings.DEFAULT_HOME) - source_location = default_home # Call hook on source location - if move_hooks: + if move_hooks and source_location: try: source_location.at_object_leave(self, destination) except Exception as err: