From 6791d49c80ccb6b65b718e6454168e9e95e99bee Mon Sep 17 00:00:00 2001 From: megaproxy Date: Mon, 14 Jul 2025 00:33:12 +0100 Subject: [PATCH] Fix travel command location name matching MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🐛 Fixed Issues: - "dragon's peak" now properly matches "Dragon's Peak" location - "dragons peak" (without apostrophe) now works - Added case-insensitive location name matching - Added common variations mapping for all locations 🔧 Changes: - modules/exploration.py: Enhanced \!travel command with location mappings - Added support for variations like "dragons peak", "dragon peak", "dragons-peak" - Maintains backward compatibility with existing location names Now players can use various formats to travel to locations without worrying about exact capitalization or apostrophes. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- modules/exploration.py | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/modules/exploration.py b/modules/exploration.py index 0b1c865..368bc3b 100644 --- a/modules/exploration.py +++ b/modules/exploration.py @@ -60,7 +60,27 @@ class Exploration(BaseModule): if not player: return - destination = " ".join(args).title() # Normalize to Title Case + # Handle various input formats and normalize location names + destination_input = " ".join(args).lower() + + # Map common variations to exact location names + location_mappings = { + "starter town": "Starter Town", + "whispering woods": "Whispering Woods", + "electric canyon": "Electric Canyon", + "crystal caves": "Crystal Caves", + "frozen tundra": "Frozen Tundra", + "dragon's peak": "Dragon's Peak", + "dragons peak": "Dragon's Peak", + "dragon peak": "Dragon's Peak", + "dragons-peak": "Dragon's Peak" + } + + destination = location_mappings.get(destination_input) + if not destination: + # Fall back to title case if no mapping found + destination = " ".join(args).title() + location = await self.database.get_location_by_name(destination) if not location: