mirror of
https://github.com/evennia/evennia.git
synced 2026-04-04 23:17:17 +02:00
Fixed cmdset.remove() by correcting the __ne__ operator on commands to properly use the matchset to identify disjoint sets.
This commit is contained in:
parent
77416953ca
commit
e10769ac22
2 changed files with 10 additions and 2 deletions
|
|
@ -509,7 +509,14 @@ class CmdSet(with_metaclass(_CmdSetMeta, object)):
|
|||
|
||||
"""
|
||||
cmd = self._instantiate(cmd)
|
||||
self.commands = [oldcmd for oldcmd in self.commands if oldcmd != cmd]
|
||||
if cmd.key.startswith("__"):
|
||||
try:
|
||||
ic = self.system_commands.index(cmd)
|
||||
del self.system_commands[ic]
|
||||
except ValueError:
|
||||
pass
|
||||
else:
|
||||
self.commands = [oldcmd for oldcmd in self.commands if oldcmd != cmd]
|
||||
|
||||
def get(self, cmd):
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -200,7 +200,8 @@ class Command(with_metaclass(CommandMeta, object)):
|
|||
__eq__.
|
||||
"""
|
||||
try:
|
||||
return not cmd.key in self._matcheset
|
||||
return self._matchset.isdisjoint(cmd._matchset)
|
||||
#return not cmd.key in self._matcheset
|
||||
except AttributeError:
|
||||
return not cmd in self._matchset
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue