Fix to read of the cocktail list

Would still like to figure out how aliases are supposed to work.
This commit is contained in:
Howard Abrams 2025-06-19 10:42:07 -07:00
parent 561af7dcdc
commit b3ce68faca

View file

@ -276,14 +276,17 @@ class CmdRead(Command):
key = "read"
def find_readable(self, searcher, readable_str):
def find_readable(self, reader, readable_str):
"""Search the room for a readable item."""
if readable_str == "chalkboard":
readable_str = "shrub"
elif readable_str.startswith("cocktail") or \
readable_str.startswith("drink") or readable_str == "list":
readable_str = "sign"
targets = searcher.search(readable_str, quiet=True)
targets = reader.search(readable_str, quiet=True)
if not targets:
searcher.msg(f"You don't see {readable_str}.")
reader.msg(f"You don't see {readable_str}.")
return None
label_targets = [t for t in targets if t.db.inside]
@ -292,10 +295,11 @@ class CmdRead(Command):
return label_targets[0]
if len(label_targets) == 0:
searcher.msg(f"You can't find anything readable on {readable_str}.")
reader.msg(f"You can't find anything readable on {readable_str}.")
else:
searcher.msg(f"Too many things match, '{readable_str}'. "
"Can you narrow it down with a title, or preface with a number, like '2-paper'?")
reader.msg(f"Too many things match, '{readable_str}'. "
"Can you narrow it down with a title, "
"or preface with a number, like '2-paper'?")
def func(self):
"""Return the 'inside' attribute."""