Fixes re: zognia's testing #2

Merged
skeh merged 11 commits from feat/zogpog into main 2025-01-24 08:28:14 +00:00
Showing only changes of commit e89a0192f5 - Show all commits

View file

@ -16,4 +16,7 @@ class ChancePlugin(PluginBase):
raise ValueError('Chance must be a string (optionally ending in %) or number') raise ValueError('Chance must be a string (optionally ending in %) or number')
if random.random() < chance / 100: 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)