Minor fixes.
This commit is contained in:
@@ -38,7 +38,7 @@ def get_nations():
|
||||
|
||||
era_match = re.match(r"-+ Era (\d+) -+", line)
|
||||
if era_match:
|
||||
current_era = f"Era {era_match.group(1)}"
|
||||
current_era = f"{era_match.group(1)}"
|
||||
nations[current_era] = {}
|
||||
continue
|
||||
|
||||
@@ -151,7 +151,7 @@ def server_command_builder(
|
||||
if team_game:
|
||||
for team in teams:
|
||||
# TODO Can team have more than one disciple and pretender?
|
||||
if team[0] not in available_nations[era]:
|
||||
if team[0] not in available_nations[str(era)]:
|
||||
return "ERROR_INVALID_NATION"
|
||||
|
||||
command.append(
|
||||
@@ -221,9 +221,9 @@ def server_command_builder(
|
||||
command.append(" --vwrap")
|
||||
if not hwrap:
|
||||
command.append(" --nohwrap")
|
||||
if not ai_slots == []:
|
||||
if ai_slots:
|
||||
for ai in ai_slots:
|
||||
if ai[0] not in available_nations[era]:
|
||||
if ai[0] not in available_nations[str(era)]:
|
||||
return "ERROR_INVALID_NATION"
|
||||
match ai[1]:
|
||||
case 1:
|
||||
@@ -237,9 +237,9 @@ def server_command_builder(
|
||||
case 5:
|
||||
command.append(" --masterai " + str(ai[0]))
|
||||
case 6:
|
||||
command.append(" --impai" + str(ai[0]))
|
||||
command.append(" --impai " + str(ai[0]))
|
||||
case _:
|
||||
return "EROR_INVALID_AI"
|
||||
return "ERROR_INVALID_AI"
|
||||
|
||||
return "".join(command)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user