From e2f92f0bfeb6858dcc71e2d54df61e110468e2b3 Mon Sep 17 00:00:00 2001 From: Griatch Date: Fri, 3 Sep 2010 19:33:17 +0000 Subject: [PATCH] Resolved issue99, which concerned commands on adjacent players being erroneously included among a player's available commands (giving multiple-command errors). --- src/commands/cmdhandler.py | 6 +++++- src/commands/cmdsethandler.py | 11 ----------- src/objects/objects.py | 2 +- 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/src/commands/cmdhandler.py b/src/commands/cmdhandler.py index 6a8e7260aa..afb6953e3d 100644 --- a/src/commands/cmdhandler.py +++ b/src/commands/cmdhandler.py @@ -113,7 +113,11 @@ def get_and_merge_cmdsets(caller): local_objlist = location.contents local_objects_cmdsets = [obj.cmdset.current for obj in local_objlist - if obj.cmdset.allow_outside_access(caller)] + if obj.cmdset.outside_access] + # print "used objs: %s" % ([obj.name + # for obj in local_objlist + # if obj.cmdset.outside_access]) + # Merge all command sets into one # (the order matters, the higher-prio cmdsets are merged last) cmdset = caller_cmdset diff --git a/src/commands/cmdsethandler.py b/src/commands/cmdsethandler.py index f9cc85fbc8..1dc8ed0b2a 100644 --- a/src/commands/cmdsethandler.py +++ b/src/commands/cmdsethandler.py @@ -202,17 +202,6 @@ class CmdSetHandler(object): mergetype, self.current) return string.strip() - def allow_outside_access(self, source_object): - """ - This is what the main commandhandler is using to check if - it should include this handler when searching for matching - commands. It should return True for most of the time except - for player-object handlers, which are only available to the - player herself. Handle individual permission checks with - the command.permissions mechanic instead. - """ - return self.outside_access or self.obj == source_object - def update(self): """ Re-adds all sets in the handler to have an updated diff --git a/src/objects/objects.py b/src/objects/objects.py index b63754ad51..2170de9fe0 100644 --- a/src/objects/objects.py +++ b/src/objects/objects.py @@ -53,7 +53,7 @@ class Object(TypeClass): if create_cmdset: dbobj.cmdset = CmdSetHandler(dbobj) if dbobj.player: - dbobj.cmdset.outside_access = False + dbobj.cmdset.outside_access = False if create_scripts: dbobj.scripts = ScriptHandler(dbobj)