From 615cb51b33b2dd3020322e10aaf35c288e0966cc Mon Sep 17 00:00:00 2001 From: Greg Taylor Date: Tue, 20 Oct 2009 15:24:33 +0000 Subject: [PATCH] Check the user's location for commands after checking neighboring objects. --- src/cmdhandler.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/cmdhandler.py b/src/cmdhandler.py index 172592becf..6f20f6a107 100755 --- a/src/cmdhandler.py +++ b/src/cmdhandler.py @@ -393,16 +393,23 @@ def match_neighbor_ctables(command,test=False): if command_table_lookup(command, neighbor.scriptlink.command_table, 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 # for the script parent to pick up. if test: return True command.scripted_obj = neighbor return True - else: - #no matches - return False + + # 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 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: # 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: # User is logged in. # Match against the 'idle' command.