Fix trigger when no one is around.

This commit is contained in:
Howard Abrams 2025-05-27 18:36:03 -07:00
parent a1e852c8a8
commit e7cd87c0c9

View file

@ -238,11 +238,18 @@ class CmdGMTrigger(Command):
element goes to 'dests' and the second goes to the room element goes to 'dests' and the second goes to the room
(based on the caller's location). (based on the caller's location).
""" """
target = None
if len(self.send_to) > 0: if len(self.send_to) > 0:
target = self.send_to[0] target = self.send_to[0]
else: else:
target = choice(self.caller.characters_here()) targets = self.caller.characters_here()
name = target.db._sdesc or target.key or "" if targets:
target = choice(targets)
if target:
name = target.db._sdesc or target.key
else:
name = ''
for idx, event in enumerate(events): for idx, event in enumerate(events):
if isinstance(event, str): if isinstance(event, str):