mirror of
https://github.com/evennia/evennia.git
synced 2026-03-17 05:16:31 +01:00
Made a change to the cmdset comparison algorithm to make sure all commands are compared both by alias and key by use of a set-intersection operation. Before one side of the comparison used key and the other used key+aliases, which led to inconsistent results in some situations, especially when combining system commands with aliases.
This commit is contained in:
parent
3cc816c58c
commit
45e0785c8e
2 changed files with 3 additions and 2 deletions
|
|
@ -411,7 +411,7 @@ class CmdSet(object):
|
|||
elif mergetype == "Replace":
|
||||
cmdset_c = self._replace(cmdset_b, self)
|
||||
elif mergetype == "Remove":
|
||||
cmdset_c = self._remove(self, cmdset_b)
|
||||
cmdset_c = self._remove(cmdset_b, self)
|
||||
else: # Union
|
||||
cmdset_c = self._union(cmdset_b, self)
|
||||
cmdset_c.no_channels = cmdset_b.no_channels
|
||||
|
|
|
|||
|
|
@ -184,7 +184,8 @@ class Command(object):
|
|||
"""
|
||||
try:
|
||||
# first assume input is a command (the most common case)
|
||||
return cmd.key in self._matchset
|
||||
return self._matchset.intersection(cmd._matchset)
|
||||
#return cmd.key in self._matchset
|
||||
except AttributeError:
|
||||
# probably got a string
|
||||
return cmd in self._matchset
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue