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.
This commit is contained in:
parent
faeb92f17d
commit
69252340d9
1 changed files with 4 additions and 12 deletions
|
|
@ -626,17 +626,9 @@ class DefaultObject(with_metaclass(TypeclassBase, ObjectDB)):
|
||||||
|
|
||||||
# Save the old location
|
# Save the old location
|
||||||
source_location = self.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
|
# Call hook on source location
|
||||||
if move_hooks:
|
if move_hooks and source_location:
|
||||||
try:
|
try:
|
||||||
source_location.at_object_leave(self, destination)
|
source_location.at_object_leave(self, destination)
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue