From bfa9e7da006272065143ff501ae0a2bdb8501a48 Mon Sep 17 00:00:00 2001 From: Zach Parks Date: Tue, 5 Mar 2024 15:59:34 -0600 Subject: [PATCH] Generate: Trim slot names again after 16 character limitation slice. (#2906) --- Generate.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Generate.py b/Generate.py index 725a7e9f..ecdc8183 100644 --- a/Generate.py +++ b/Generate.py @@ -302,7 +302,9 @@ def handle_name(name: str, player: int, name_counter: Counter): NUMBER=(number if number > 1 else ''), player=player, PLAYER=(player if player > 1 else ''))) - new_name = new_name.strip()[:16] + # Run .strip twice for edge case where after the initial .slice new_name has a leading whitespace. + # Could cause issues for some clients that cannot handle the additional whitespace. + new_name = new_name.strip()[:16].strip() if new_name == "Archipelago": raise Exception(f"You cannot name yourself \"{new_name}\"") return new_name