From 6d1ff496dd2e59101a8e1171c9a5e4d6ae57e615 Mon Sep 17 00:00:00 2001 From: Carl Date: Sun, 3 May 2026 01:35:34 +0200 Subject: [PATCH] Added duplicate Ai check. --- servermanager.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/servermanager.py b/servermanager.py index b02a9dc..a8a5cf6 100644 --- a/servermanager.py +++ b/servermanager.py @@ -222,9 +222,12 @@ def server_command_builder( if not hwrap: command.append(" --nohwrap") if ai_slots: + added_ais = [] for ai in ai_slots: if ai[0] not in available_nations[str(era)]: return "ERROR_INVALID_NATION" + if ai[0] in added_ais: + return "ERROR_DUPLICATE_AI" match ai[1]: case 1: command.append(" --easyai " + str(ai[0])) @@ -240,6 +243,7 @@ def server_command_builder( command.append(" --impai " + str(ai[0])) case _: return "ERROR_INVALID_AI" + added_ais.append(ai[0]) return "".join(command)