diff --git a/webui.py b/webui.py index 887174d..24c5f4a 100644 --- a/webui.py +++ b/webui.py @@ -153,7 +153,7 @@ def create_ai_table(era, table_container, ai_slots): ) -def set_ai_level(value, nation_id, ai_slots): +def set_ai_level(value, nid, ai_slots): level_map = { "Closed": 0, "Easy": 1, @@ -164,11 +164,9 @@ def set_ai_level(value, nation_id, ai_slots): "Impossible": 6, } ai_slots[:] = [ - (nation_id, ai_level) - for nation_id, ai_level in ai_slots - if nation_id != nation_id + (nation_id, ai_level) for nation_id, ai_level in ai_slots if nation_id != nid ] if value == "Human": return - ai_slots.append((nation_id, level_map[value])) + ai_slots.append((nid, level_map[value]))