From 33cf306e5800cd0150aaab7ba183be5bc398c5aa Mon Sep 17 00:00:00 2001 From: bridge Date: Sat, 6 Dec 2025 17:22:17 +0800 Subject: [PATCH] update frontend --- src/run/load_map.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/run/load_map.py b/src/run/load_map.py index e6dccf9..98251d1 100644 --- a/src/run/load_map.py +++ b/src/run/load_map.py @@ -140,7 +140,12 @@ def _load_and_assign_regions(game_map: Map, region_coords: dict[int, list[tuple[ def _parse_list(s: str) -> list[int]: if not s: return [] - try: - return [int(x.strip()) for x in s.split(",") if x.strip()] - except: - return [] + res = [] + for x in s.split(","): + x = x.strip() + if x: + try: + res.append(int(float(x))) + except (ValueError, TypeError): + pass + return res