mirror of
https://github.com/evennia/evennia.git
synced 2026-03-29 20:17:16 +02:00
Check the user's location for commands after checking neighboring objects.
This commit is contained in:
parent
a711e07b80
commit
615cb51b33
1 changed files with 13 additions and 5 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue