From 0ae1f9f1710b6e820ab8aec30645fbe79985f1a0 Mon Sep 17 00:00:00 2001 From: Griatch Date: Tue, 19 Jan 2016 21:23:51 +0100 Subject: [PATCH] Fixed a bug with identifying a unique command index (should be 1-N, not 0-(N-1)). --- evennia/commands/cmdparser.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/evennia/commands/cmdparser.py b/evennia/commands/cmdparser.py index a91bec852b..49ecdebb4d 100644 --- a/evennia/commands/cmdparser.py +++ b/evennia/commands/cmdparser.py @@ -122,10 +122,10 @@ def cmdparser(raw_string, cmdset, caller, match_index=None): quality = [mat[4] for mat in matches] matches = matches[-quality.count(quality[-1]):] - if len(matches) > 1 and match_index != None and 0 <= match_index < len(matches): + if len(matches) > 1 and match_index != None and 0 < match_index <= len(matches): # We couldn't separate match by quality, but we have an # index argument to tell us which match to use. - matches = [matches[match_index]] + matches = [matches[match_index-1]] # no matter what we have at this point, we have to return it. return matches