Fix a stacktrace when trying to whisper

This commit is contained in:
Howard Abrams 2025-09-09 21:55:55 -07:00
parent 471d2ecfc2
commit 13a3a91a65
2 changed files with 10 additions and 7 deletions

View file

@ -235,13 +235,16 @@ class CmdWhisper(MuxCommand):
self.caller.msg("Usage: whisper <character> = <message>")
return
targets = [self.caller.search(target) for target in split(r" *, *", self.lhs)]
full_speech = f"/Me whispers to you, \"{self.rhs}\""
send_emote(self.caller, targets, full_speech, msg_type="say", anonymous_add=None, quiet=True)
targets = [self.caller.search(target)
for target in split(r" *, *", self.lhs)]
if targets:
full_speech = f"/Me whispers to you, \"{self.rhs}\""
send_emote(self.caller, targets, full_speech, msg_type="say",
anonymous_add=None, quiet=True)
to_list = [target.get_display_name(self) for target in targets]
full_speech = f"You whisper to {iter_to_str(to_list, endsep='and')}, \"{self.rhs}\""
self.caller.msg(full_speech, from_obj=self.caller)
to_list = [target.get_display_name(self) for target in targets]
full_speech = f"You whisper to {iter_to_str(to_list, endsep='and')}, \"{self.rhs}\""
self.caller.msg(full_speech, from_obj=self.caller)
class CmdSay(MuxCommand):

View file

@ -2090,7 +2090,7 @@ Someone has set a nice |Ychair|n for viewing.
# [[file:../../../projects/mud.org::*Sandy Shore][Sandy Shore:8]]
@detail waves = Despite the inclement weather, the waves ripple gently against the shore.
#
@detail sea;lavender sea = Is that a |Yboat|n you see sailing the sea in the distance?
@detail sea;lavender sea = Is that a |Yboat|n you see sailing in the distance?
#
@detail boat;ship = The mastless ship looks like a giant leaf. Wonder if it comes to shore?
#