X-Git-Url: https://mudpy.org/gitweb?p=mudpy.git;a=blobdiff_plain;f=mudpy%2Fcommand.py;h=20b448cf6ea19b78477a1477b9b9c37aec4a42cd;hp=39e0a8388c5c10265664fff2bfeb7bb42ee6b1d7;hb=dc3b9c3f13b06b80db5c9f9a4c15804dfd60af4a;hpb=0f70e3a057151497d7d99711660e8649485ef6c2 diff --git a/mudpy/command.py b/mudpy/command.py index 39e0a83..20b448c 100644 --- a/mudpy/command.py +++ b/mudpy/command.py @@ -263,10 +263,12 @@ def look(actor, parameters): def move(actor, parameters): """Move the avatar in a given direction.""" - if parameters in actor.universe.contents[actor.get("location")].portals(): - actor.move_direction(parameters) - else: - actor.send("You cannot go that way.") + for portal in sorted( + actor.universe.contents[actor.get("location")].portals()): + if portal.startswith(parameters): + actor.move_direction(portal) + return(portal) + actor.send("You cannot go that way.") def preferences(actor, parameters):