From 5863ef29a8adcbc09983f316f7a2c0687dc355cf Mon Sep 17 00:00:00 2001 From: Griatch Date: Sun, 22 Mar 2015 17:22:59 +0100 Subject: [PATCH] Made cmdhandler respect an explicit True/False setting. --- evennia/commands/cmdhandler.py | 6 ++++-- evennia/commands/cmdset.py | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/evennia/commands/cmdhandler.py b/evennia/commands/cmdhandler.py index 2e64682392..d6f328008b 100644 --- a/evennia/commands/cmdhandler.py +++ b/evennia/commands/cmdhandler.py @@ -188,9 +188,11 @@ def get_and_merge_cmdsets(caller, session, player, obj, lobj.locks.check(caller, 'call', no_superuser_bypass=True))] for cset in local_obj_cmdsets: #This is necessary for object sets, or we won't be able to - # separate the command sets from each other in a busy room. + # separate the command sets from each other in a busy room. We + # only keep the setting if duplicates were set to False/True + # explicitly. cset.old_duplicates = cset.duplicates - cset.duplicates = True + cset.duplicates = True if cset.duplicates is None else cset.duplicates returnValue(local_obj_cmdsets) except Exception: logger.log_trace() diff --git a/evennia/commands/cmdset.py b/evennia/commands/cmdset.py index 3257c649db..2c70587d34 100644 --- a/evennia/commands/cmdset.py +++ b/evennia/commands/cmdset.py @@ -128,7 +128,9 @@ class CmdSet(object): key = "Unnamed CmdSet" mergetype = "Union" priority = 0 - duplicates = False + # if None, the cmdhandler will switch to True for objects and stay False otherwise. + # Explicitly set True/False will be kept. + duplicates = None key_mergetypes = {} no_exits = False no_objs = False