From e7cd87c0c90fc916878cd0367dd612f2074a07c2 Mon Sep 17 00:00:00 2001 From: Howard Abrams Date: Tue, 27 May 2025 18:36:03 -0700 Subject: [PATCH] Fix trigger when no one is around. --- commands/wizards.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/commands/wizards.py b/commands/wizards.py index 181a3bf..261fdeb 100755 --- a/commands/wizards.py +++ b/commands/wizards.py @@ -238,11 +238,18 @@ class CmdGMTrigger(Command): element goes to 'dests' and the second goes to the room (based on the caller's location). """ + target = None if len(self.send_to) > 0: target = self.send_to[0] else: - target = choice(self.caller.characters_here()) - name = target.db._sdesc or target.key or "" + targets = self.caller.characters_here() + if targets: + target = choice(targets) + + if target: + name = target.db._sdesc or target.key + else: + name = '' for idx, event in enumerate(events): if isinstance(event, str):