From 3334d3f078d50773e4c9ce9eaab3f5dad14632a0 Mon Sep 17 00:00:00 2001 From: BlauFeuer Date: Fri, 3 Feb 2017 19:22:09 -0500 Subject: [PATCH] character's at_pre_puppet tweak Triggering at_object_receive only when room actually receives character and accurately reporting that character came from None seems most reasonable, then at_object_receive can decide if appearance of character from None location is actionable. --- evennia/objects/objects.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/evennia/objects/objects.py b/evennia/objects/objects.py index 1d9a6373e9..919610230d 100644 --- a/evennia/objects/objects.py +++ b/evennia/objects/objects.py @@ -1492,11 +1492,11 @@ class DefaultCharacter(DefaultObject): session (Session): Session controlling the connection. """ if self.location is None: # Make sure character's location is never None before being puppeted. - # Return to last location (or home, which should always exist). + # Return to last location (or home, which should always exist), self.location = self.db.prelogout_location if self.db.prelogout_location else self.home + self.location.at_object_receive(self, None) # and trigger the location's reception hook. if self.location: # If the character is verified to be somewhere, - self.db.prelogout_location = self.location # save location again to be sure - self.location.at_object_receive(self, self.location) # and trigger the location's reception hook. + self.db.prelogout_location = self.location # save location again to be sure. else: player.msg("|r%s has no location and no home is set.|n" % self, session=session) # Note to set home.