Fixed a number of bugs

This commit is contained in:
Howard Abrams 2025-06-30 22:13:02 -07:00
parent 1a85809655
commit b09e0d6d8f
2 changed files with 10 additions and 4 deletions

View file

@ -116,9 +116,11 @@ class Character(Object, GenderCharacter, ContribRPCharacter):
if not line or line.strip() == "":
return line
elif match(r"^\|[bm][a-z].*", line):
logger.info(f"Adding The! {line}")
return "The " + line
elif match(r"^\|[A-z][a-z].*", line):
return line[0:1] + line[2].upper() + line[3:]
logger.info(f"Capitalizes: {line}")
return line[0:2] + line[2].upper() + line[3:]
else:
return line[0].upper() + line[1:]
@ -189,7 +191,10 @@ class Character(Object, GenderCharacter, ContribRPCharacter):
This replaces the weird, auto-generated name with the
character's actual name.
"""
letter = self.search('letter', location=self)
letter = self.search('letter', location=self, quiet=True)
if letter and isinstance(letter, list) and len(letter) > 0:
letter = letter[0]
if letter:
text = sub(r"My dear [^,]*", f"My dear {self.name}", letter.db.inside)
letter.db.inside = text

View file

@ -103,8 +103,9 @@ class Producer(Object):
Create a configurable consumable, given to picker.
"""
consumable = spawn({
"typeclass": self.db.make_class or kwargs['type']
if 'type' in kwargs else "typeclasses.consumables.Consumable",
"typeclass": self.db.make_class or (kwargs['type']
if 'type' in kwargs else
"typeclasses.consumables.Consumable"),
"key": self.db.make_name,
"aliases": self.db.make_aliases,
"desc": routput(self.db.make_desc),