Fixes re: zognia's testing #2
1 changed files with 4 additions and 1 deletions
|
@ -16,4 +16,7 @@ class ChancePlugin(PluginBase):
|
|||
raise ValueError('Chance must be a string (optionally ending in %) or number')
|
||||
|
||||
if random.random() < chance / 100:
|
||||
await self.execute_kdl(_children, _ctx=_ctx)
|
||||
await self.execute_kdl([child for child in _children if child.name != 'or'], _ctx=_ctx)
|
||||
else:
|
||||
if elsenode := next((child for child in _children if child.name == 'or'), None):
|
||||
await self.execute_kdl(elsenode.nodes, _ctx=_ctx)
|
||||
|
|
Loading…
Add table
Reference in a new issue