Fix bug that prevented exits with a compass direction alias from displaying
This commit is contained in:
parent
a2bb02c82c
commit
e44f069eb9
2 changed files with 6 additions and 11 deletions
|
|
@ -125,16 +125,11 @@ class Map(object):
|
||||||
Returns:
|
Returns:
|
||||||
string: The exit name as a compass direction or an empty string.
|
string: The exit name as a compass direction or an empty string.
|
||||||
"""
|
"""
|
||||||
exit_name = ex.name
|
return (
|
||||||
if exit_name not in _COMPASS_DIRECTIONS:
|
ex.name
|
||||||
compass_aliases = [
|
if ex.name in _COMPASS_DIRECTIONS
|
||||||
direction in ex.aliases.all() for direction in _COMPASS_DIRECTIONS.keys()
|
else next((alias for alias in ex.aliases.all() if alias in _COMPASS_DIRECTIONS), "")
|
||||||
]
|
)
|
||||||
if compass_aliases[0]:
|
|
||||||
exit_name = compass_aliases[0]
|
|
||||||
if exit_name not in _COMPASS_DIRECTIONS:
|
|
||||||
return ""
|
|
||||||
return exit_name
|
|
||||||
|
|
||||||
def update_pos(self, room, exit_name):
|
def update_pos(self, room, exit_name):
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ class TestIngameMap(BaseEvenniaCommandTest):
|
||||||
)
|
)
|
||||||
create_object(
|
create_object(
|
||||||
exits.Exit,
|
exits.Exit,
|
||||||
key="west",
|
key="shopfront",
|
||||||
aliases=["w"],
|
aliases=["w"],
|
||||||
location=self.east_room,
|
location=self.east_room,
|
||||||
destination=self.west_room,
|
destination=self.west_room,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue