mirror of
https://github.com/evennia/evennia.git
synced 2026-03-30 04:27:16 +02:00
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.
This commit is contained in:
parent
1ed5a0b4a6
commit
3334d3f078
1 changed files with 3 additions and 3 deletions
|
|
@ -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.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue