X-Git-Url: https://mudpy.org/gitweb?a=blobdiff_plain;f=lib%2Fmudpy%2Fmisc.py;h=ea18ffb411876939374b7e32e37c542b33aeea4c;hb=74542e2249c308c6c40aef50eaf227b46fd1bc9d;hp=ead6f54f52b5ede7796a4cb66272219ec436fe8b;hpb=d9bc0e9251378f4b6eab0bd5537e0e9b0261a7bf;p=mudpy.git diff --git a/lib/mudpy/misc.py b/lib/mudpy/misc.py index ead6f54..ea18ffb 100644 --- a/lib/mudpy/misc.py +++ b/lib/mudpy/misc.py @@ -1,7 +1,6 @@ -# -*- coding: utf-8 -*- """Miscellaneous functions for the mudpy engine.""" -# Copyright (c) 2004-2014 Jeremy Stanley . Permission +# Copyright (c) 2004-2015 Jeremy Stanley . Permission # to use, copy, modify, and distribute this software is granted under # terms provided in the LICENSE file distributed with this software. @@ -2044,7 +2043,9 @@ def command_say(actor, parameters): universe.categories["internal"]["language"].get( "default_punctuation")) action = "" - for mark in actions.keys(): + + # reverse sort punctuation options so the longest match wins + for mark in sorted(actions.keys(), reverse=True): if not literal and message.endswith(mark): action = actions[mark] break