Fix bug when lighting torches
This commit is contained in:
parent
218a21a7a2
commit
39493528b2
2 changed files with 5 additions and 4 deletions
|
|
@ -97,9 +97,10 @@ class CmdLight(Command):
|
||||||
|
|
||||||
burnables = lighter.search(item, location=lighter, quiet=True)
|
burnables = lighter.search(item, location=lighter, quiet=True)
|
||||||
if burnables and len(burnables) > 0:
|
if burnables and len(burnables) > 0:
|
||||||
try:
|
to_burn = burnables[0]
|
||||||
burnables[0].do_light(self.caller)
|
if to_burn.has_method("do_light"):
|
||||||
except Exception:
|
to_burn.do_light(self.caller)
|
||||||
|
else:
|
||||||
lighter.msg(f"The {burnables[0].key} isn't flammable.")
|
lighter.msg(f"The {burnables[0].key} isn't flammable.")
|
||||||
else:
|
else:
|
||||||
lighter.msg(f"Can't find {item}.")
|
lighter.msg(f"Can't find {item}.")
|
||||||
|
|
|
||||||
|
|
@ -103,7 +103,7 @@ class LightSource(Object):
|
||||||
# start the burn timer. When it runs out, self._burnout
|
# start the burn timer. When it runs out, self._burnout
|
||||||
# will be called. We store the deferred so it can be
|
# will be called. We store the deferred so it can be
|
||||||
# killed in unittesting.
|
# killed in unittesting.
|
||||||
self.deferred = delay(self.burntime, self._burnout)
|
self.deferred = delay(self.db.burntime, self._burnout)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue