Fix bugs in taking things away from their tethers
This commit is contained in:
parent
afb092bfb0
commit
5a1ef48ce5
2 changed files with 8 additions and 11 deletions
|
|
@ -244,16 +244,19 @@ class Character(Object, GenderCharacter, ContribRPCharacter):
|
|||
if to:
|
||||
m = match(r".*:id\((.*)\)", to)
|
||||
if m:
|
||||
id_num = m.group(1)
|
||||
dest = self.search(f"{id_num}")
|
||||
location = m.group(1)
|
||||
dest = self.search(location)
|
||||
msg = thing.db.tethered_msg
|
||||
if dest and msg:
|
||||
thing.location = dest
|
||||
self.msg(msg)
|
||||
else:
|
||||
print(f"Found tethered, {thing} to #{id_num}, but dest is {dest} and msg is '{msg}'. Set both.")
|
||||
logger.warn(f"Found tethered, {thing} to #{location}, but dest is {dest} and msg is '{msg}'. Set both.")
|
||||
else:
|
||||
print(f"Found tethered, {thing} to #{to}, but that needs to be 'tethered:id(num) where num is the ID# of an object/place.")
|
||||
logger.warn(f"Found tethered, {thing} to #{to}, but that needs to be 'tethered:id(num) where num is the ID# of an object/place.")
|
||||
|
||||
for puppet in self.puppets_here():
|
||||
puppet.other_leave(self)
|
||||
|
||||
return super().at_pre_move(destination)
|
||||
|
||||
|
|
@ -365,12 +368,6 @@ class Character(Object, GenderCharacter, ContribRPCharacter):
|
|||
for puppet in self.puppets_here():
|
||||
puppet.other_arrive(self)
|
||||
|
||||
def at_pre_move(self, destination, move_type="move", **kwargs):
|
||||
super().at_pre_move(destination, move_type)
|
||||
for puppet in self.puppets_here():
|
||||
puppet.other_leave(self)
|
||||
return True
|
||||
|
||||
def deeper_search(self, item_str):
|
||||
targets = self.search(item_str, quiet=True)
|
||||
if len(targets) > 0:
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ class Sittable(Object):
|
|||
# Clean up an issue that sometimes someone logs off or leaves
|
||||
# a room without standing first.
|
||||
if self.db.sitter:
|
||||
if not self.location.has(self.db.sitter):
|
||||
if self.db.sitter not in self.location.contents:
|
||||
self.db.sitter = None
|
||||
|
||||
if self.db.sitter and not self.multiple:
|
||||
|
|
|
|||
Loading…
Reference in a new issue