From 294ae2fa350c176a4d65a0aa18a50d90eb9a1c71 Mon Sep 17 00:00:00 2001 From: Howard Abrams Date: Tue, 24 Jun 2025 22:26:11 -0700 Subject: [PATCH] Fixed bug finding a character's coin pouch. --- typeclasses/characters.py | 6 ++++-- world/version3.ev | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/typeclasses/characters.py b/typeclasses/characters.py index dd73b89..cc883df 100644 --- a/typeclasses/characters.py +++ b/typeclasses/characters.py @@ -16,6 +16,7 @@ from evennia.contrib.game_systems.gendersub import GenderCharacter from evennia.contrib.rpg.rpsystem import ContribRPCharacter, send_emote from evennia.prototypes.spawner import spawn from evennia.utils import delay, logger, int2str +from evennia.utils.search import search_object from utils.word_list import routput, choices from .objects import Object @@ -152,8 +153,9 @@ class Character(Object, GenderCharacter, ContribRPCharacter): Throws InterruptCommand exception if the character has no pouch, and therefore, no money. """ - pouches = self.search("", location=self, quiet=True, - typeclass="typeclasses.things.CoinPurse") + pouches = [item + for item in self.contents + if item.is_typeclass("typeclasses.things.CoinPurse")] if pouches: return pouches[0] raise InterruptCommand("No coin purse") diff --git a/world/version3.ev b/world/version3.ev index 9848dd4..a266fd9 100644 --- a/world/version3.ev +++ b/world/version3.ev @@ -17,7 +17,7 @@ # [[file:../../../projects/mud-games.org::*George and the Troll][George and the Troll:1]] -@create rules: typeclasses.things.Readable +@create rules: typeclasses.readables.Readable # @desc rules = A small, worn card with the rules of the game, |yHobbits and Trolls|n printed on it. # George and the Troll:1 ends here