Check the user's location for commands after checking neighboring objects.

This commit is contained in:
Greg Taylor 2009-10-20 15:24:33 +00:00
parent a711e07b80
commit 615cb51b33

View file

@ -393,15 +393,22 @@ def match_neighbor_ctables(command,test=False):
if command_table_lookup(command, if command_table_lookup(command,
neighbor.scriptlink.command_table, neighbor.scriptlink.command_table,
test=test, neighbor=neighbor): test=test, neighbor=neighbor):
# test for a use-lock # Test for a use-lock.
# If there was a command match, set the scripted_obj attribute # If there was a command match, set the scripted_obj attribute
# for the script parent to pick up. # for the script parent to pick up.
if test: if test:
return True return True
command.scripted_obj = neighbor command.scripted_obj = neighbor
return True return True
else:
#no matches # Check the object's location for command matches.
if command_table_lookup(command,
source_object.location.scriptlink.command_table,
test=test, neighbor=source_object.location):
command.scripted_obj = source_object.location
return True
# No matches
return False return False
def handle(command, ignore_state=False): def handle(command, ignore_state=False):
@ -425,7 +432,8 @@ def handle(command, ignore_state=False):
if command.session and not command.session.logged_in: if command.session and not command.session.logged_in:
# Not logged in, look through the unlogged-in command table. # Not logged in, look through the unlogged-in command table.
command_table_lookup(command, cmdtable.GLOBAL_UNCON_CMD_TABLE,eval_perms=False) command_table_lookup(command, cmdtable.GLOBAL_UNCON_CMD_TABLE,
eval_perms=False)
else: else:
# User is logged in. # User is logged in.
# Match against the 'idle' command. # Match against the 'idle' command.