Resolved issue99, which concerned commands on adjacent players being erroneously included among a player's available commands (giving multiple-command errors).

This commit is contained in:
Griatch 2010-09-03 19:33:17 +00:00
parent 35bb9444a1
commit e2f92f0bfe
3 changed files with 6 additions and 13 deletions

View file

@ -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

View file

@ -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

View file

@ -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)