rpsystem.py minor fixes to CmdEmote

+Escape curly braces in emote
+Check for ? as ending punctuation before adding full-stop
This commit is contained in:
BlauFeuer 2016-09-08 14:20:56 -04:00 committed by Griatch
parent d5c8db4c82
commit dd840ba05b

View file

@ -796,10 +796,11 @@ class CmdEmote(RPCommand): # replaces the main emote
self.caller.msg("What do you want to do?")
else:
# we also include ourselves here.
emote = self.args
emote = self.args.replace('{', '{{') # Escape open curly brace in later formatting.
emote = emote.replace('}', '}}') # Also escape close curly brace.
targets = self.caller.location.contents
if not emote.endswith((".", "!")):
emote = "%s." % emote
if not emote.endswith((".", "?", "!")): # If emote is not punctuated,
emote = "%s." % emote # add a full-stop for good measure.
send_emote(self.caller, targets, emote, anonymous_add='first')