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