Fixed a bug with identifying a unique command index (should be 1-N, not 0-(N-1)).
This commit is contained in:
parent
8655f880f2
commit
0ae1f9f171
1 changed files with 2 additions and 2 deletions
|
|
@ -122,10 +122,10 @@ def cmdparser(raw_string, cmdset, caller, match_index=None):
|
||||||
quality = [mat[4] for mat in matches]
|
quality = [mat[4] for mat in matches]
|
||||||
matches = matches[-quality.count(quality[-1]):]
|
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
|
# We couldn't separate match by quality, but we have an
|
||||||
# index argument to tell us which match to use.
|
# 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.
|
# no matter what we have at this point, we have to return it.
|
||||||
return matches
|
return matches
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue