Made Empty cmdsets have priority -100, also changed their key from "Empty" to _EMPTY_CMDSET to make it clearer this is a special name. See also discussion in Issue 447.

This commit is contained in:
Griatch 2014-01-04 13:24:07 +01:00
parent acbfa57240
commit 48bfc7e54a
3 changed files with 13 additions and 7 deletions

View file

@ -200,7 +200,7 @@ def get_and_merge_cmdsets(caller, session, player, obj,
# weed out all non-found sets
cmdsets = yield [cmdset for cmdset in cmdsets
if cmdset and cmdset.key != "Empty"]
if cmdset and cmdset.key != "_EMPTY_CMDSET"]
# report cmdset errors to user (these should already have been logged)
yield [report_to.msg(cmdset.errmessage) for cmdset in cmdsets
if cmdset.key == "_CMDSET_ERROR"]
@ -218,6 +218,7 @@ def get_and_merge_cmdsets(caller, session, player, obj,
tempmergers = {}
for cmdset in cmdsets:
prio = cmdset.priority
#print cmdset.key, prio
if prio in tempmergers:
# merge same-prio cmdset together separately
tempmergers[prio] = yield cmdset + tempmergers[prio]