Commit 4539dd0
authored
Minor fix for fuzzy exit name match (#402)
##Summary
This PR enhances the exit navigation system by implementing priority checking for standard compass direction abbreviations before falling back to fuzzy matching. The changes ensure that players can reliably use common direction shortcuts (n, s, e, w, ne, nw, se, sw) without ambiguity from custom exit names.
##Changes
- Integrated the keywords system to resolve direction aliases (e.g., "n" → "north") before fuzzy matching
- Added priority checking for exact direction matches across regular exits, temporary exits, and mutator exits
- Preserved fuzzy matching behavior for non-standard exit names (portals, gates, custom exits)
- Removed hardcoded direction validation in favor of the centralized keywords system
##Technical Details
The FindExitByName method now follows this logic:
1. First attempts to resolve input as a direction alias via keywords.TryDirectionAlias()
2. If a direction alias is found, checks for exact matches only (no fuzzy matching)
3. Falls back to existing fuzzy matching for all other exit types
This approach provides deterministic behavior for standard directions while maintaining flexibility for custom exit names.1 parent 44284cf commit 4539dd0
1 file changed
+26
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| 33 | + | |
32 | 34 | | |
33 | 35 | | |
34 | 36 | | |
| |||
1716 | 1718 | | |
1717 | 1719 | | |
1718 | 1720 | | |
| 1721 | + | |
| 1722 | + | |
| 1723 | + | |
| 1724 | + | |
| 1725 | + | |
| 1726 | + | |
| 1727 | + | |
| 1728 | + | |
| 1729 | + | |
| 1730 | + | |
| 1731 | + | |
| 1732 | + | |
| 1733 | + | |
| 1734 | + | |
| 1735 | + | |
| 1736 | + | |
| 1737 | + | |
| 1738 | + | |
| 1739 | + | |
| 1740 | + | |
| 1741 | + | |
| 1742 | + | |
| 1743 | + | |
1719 | 1744 | | |
1720 | 1745 | | |
1721 | 1746 | | |
| |||
1734 | 1759 | | |
1735 | 1760 | | |
1736 | 1761 | | |
| 1762 | + | |
1737 | 1763 | | |
1738 | 1764 | | |
1739 | 1765 | | |
1740 | | - | |
1741 | | - | |
1742 | | - | |
1743 | | - | |
1744 | | - | |
1745 | | - | |
1746 | | - | |
1747 | | - | |
1748 | | - | |
1749 | | - | |
1750 | | - | |
1751 | | - | |
1752 | 1766 | | |
1753 | 1767 | | |
1754 | 1768 | | |
| |||
0 commit comments