mirror of
https://github.com/evennia/evennia.git
synced 2026-03-16 21:06:30 +01:00
Merge pull request #3723 from Machine-Garden-MUD/ingame_map_display
Fix bug that prevented exits with an ordinal alias from displaying
This commit is contained in:
commit
d27130e138
2 changed files with 7 additions and 12 deletions
|
|
@ -125,16 +125,11 @@ class Map(object):
|
|||
Returns:
|
||||
string: The exit name as a compass direction or an empty string.
|
||||
"""
|
||||
exit_name = ex.name
|
||||
if exit_name not in _COMPASS_DIRECTIONS:
|
||||
compass_aliases = [
|
||||
direction in ex.aliases.all() for direction in _COMPASS_DIRECTIONS.keys()
|
||||
]
|
||||
if compass_aliases[0]:
|
||||
exit_name = compass_aliases[0]
|
||||
if exit_name not in _COMPASS_DIRECTIONS:
|
||||
return ""
|
||||
return exit_name
|
||||
return (
|
||||
ex.name
|
||||
if ex.name in _COMPASS_DIRECTIONS
|
||||
else next((alias for alias in ex.aliases.all() if alias in _COMPASS_DIRECTIONS), "")
|
||||
)
|
||||
|
||||
def update_pos(self, room, exit_name):
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -32,8 +32,8 @@ class TestIngameMap(BaseEvenniaCommandTest):
|
|||
)
|
||||
create_object(
|
||||
exits.Exit,
|
||||
key="west",
|
||||
aliases=["w"],
|
||||
key="shopfront",
|
||||
aliases=["w","west"],
|
||||
location=self.east_room,
|
||||
destination=self.west_room,
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue