From 6cfbec83f1d3fb5720dac79583dee9a85f21c75d Mon Sep 17 00:00:00 2001 From: CloudKeeper1 Date: Tue, 7 Mar 2017 21:58:07 +1100 Subject: [PATCH] Inclusion of type kwarg for common communications Including a type kwarg for the say, whisper and pose commands allows the receivers of those messages to treat them differently depending on type. IMO This is a wide enough concern that it goes beyond a game specific requirement. --- evennia/commands/default/general.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/evennia/commands/default/general.py b/evennia/commands/default/general.py index 5070915555..8bee6e8d4b 100644 --- a/evennia/commands/default/general.py +++ b/evennia/commands/default/general.py @@ -417,7 +417,7 @@ class CmdSay(COMMAND_DEFAULT_CLASS): # Build the string to emit to neighbors. emit_string = '%s says, "%s|n"' % (caller.name, speech) - caller.location.msg_contents(emit_string, exclude=caller, from_obj=caller) + caller.location.msg_contents(emit_string, exclude=caller, from_obj=caller, type="say") class CmdWhisper(COMMAND_DEFAULT_CLASS): @@ -459,7 +459,7 @@ class CmdWhisper(COMMAND_DEFAULT_CLASS): # Build the string to emit to receiver. emit_string = '%s whispers, "%s|n"' % (caller.name, speech) - receiver.msg(emit_string, from_obj=caller) + receiver.msg(emit_string, from_obj=caller, type="whisper") class CmdPose(COMMAND_DEFAULT_CLASS): @@ -502,7 +502,7 @@ class CmdPose(COMMAND_DEFAULT_CLASS): self.caller.msg(msg) else: msg = "%s%s" % (self.caller.name, self.args) - self.caller.location.msg_contents(msg, from_obj=self.caller) + self.caller.location.msg_contents(msg, from_obj=self.caller, type="pose") class CmdAccess(COMMAND_DEFAULT_CLASS):