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:
parent
35bb9444a1
commit
e2f92f0bfe
3 changed files with 6 additions and 13 deletions
|
|
@ -113,7 +113,11 @@ def get_and_merge_cmdsets(caller):
|
||||||
local_objlist = location.contents
|
local_objlist = location.contents
|
||||||
local_objects_cmdsets = [obj.cmdset.current
|
local_objects_cmdsets = [obj.cmdset.current
|
||||||
for obj in local_objlist
|
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
|
# Merge all command sets into one
|
||||||
# (the order matters, the higher-prio cmdsets are merged last)
|
# (the order matters, the higher-prio cmdsets are merged last)
|
||||||
cmdset = caller_cmdset
|
cmdset = caller_cmdset
|
||||||
|
|
|
||||||
|
|
@ -202,17 +202,6 @@ class CmdSetHandler(object):
|
||||||
mergetype, self.current)
|
mergetype, self.current)
|
||||||
return string.strip()
|
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):
|
def update(self):
|
||||||
"""
|
"""
|
||||||
Re-adds all sets in the handler to have an updated
|
Re-adds all sets in the handler to have an updated
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue