From 39493528b29253b387411ed6bd9f614ef654e10b Mon Sep 17 00:00:00 2001 From: Howard Abrams Date: Sun, 17 Aug 2025 09:48:33 -0700 Subject: [PATCH] Fix bug when lighting torches --- commands/misc.py | 7 ++++--- typeclasses/lightables.py | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/commands/misc.py b/commands/misc.py index adc862a..fb3c935 100755 --- a/commands/misc.py +++ b/commands/misc.py @@ -97,9 +97,10 @@ class CmdLight(Command): burnables = lighter.search(item, location=lighter, quiet=True) if burnables and len(burnables) > 0: - try: - burnables[0].do_light(self.caller) - except Exception: + to_burn = burnables[0] + if to_burn.has_method("do_light"): + to_burn.do_light(self.caller) + else: lighter.msg(f"The {burnables[0].key} isn't flammable.") else: lighter.msg(f"Can't find {item}.") diff --git a/typeclasses/lightables.py b/typeclasses/lightables.py index 4312120..0b800f2 100755 --- a/typeclasses/lightables.py +++ b/typeclasses/lightables.py @@ -103,7 +103,7 @@ class LightSource(Object): # start the burn timer. When it runs out, self._burnout # will be called. We store the deferred so it can be # killed in unittesting. - self.deferred = delay(self.burntime, self._burnout) + self.deferred = delay(self.db.burntime, self._burnout) return True