Fix bug when lighting torches

This commit is contained in:
Howard Abrams 2025-08-17 09:48:33 -07:00
parent 218a21a7a2
commit 39493528b2
2 changed files with 5 additions and 4 deletions

View file

@ -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}.")

View file

@ -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