Fixed campaign sometimes not starting when the user does not explicitly re-select a campaign and just kee p the default one..

This commit is contained in:
Khopa 2020-08-27 23:47:00 +02:00
parent 139c4c1dd8
commit 7817d59989

View File

@ -12,7 +12,7 @@ import qt_ui.uiconstants as CONST
from game import db, Game from game import db, Game
from game.settings import Settings from game.settings import Settings
from gen import namegen from gen import namegen
from qt_ui.windows.newgame.QCampaignList import QCampaignList from qt_ui.windows.newgame.QCampaignList import QCampaignList, CAMPAIGNS
from theater import start_generator, persiangulf, nevada, caucasus, ConflictTheater, normandy, thechannel from theater import start_generator, persiangulf, nevada, caucasus, ConflictTheater, normandy, thechannel
@ -42,6 +42,8 @@ class NewGameWizard(QtWidgets.QWizard):
redFaction = [c for c in db.FACTIONS][self.field("redFaction")] redFaction = [c for c in db.FACTIONS][self.field("redFaction")]
selectedCampaign = self.field("selectedCampaign") selectedCampaign = self.field("selectedCampaign")
if selectedCampaign is None:
selectedCampaign = CAMPAIGNS[0]
conflictTheater = selectedCampaign[1]() conflictTheater = selectedCampaign[1]()
timePeriod = db.TIME_PERIODS[list(db.TIME_PERIODS.keys())[self.field("timePeriod")]] timePeriod = db.TIME_PERIODS[list(db.TIME_PERIODS.keys())[self.field("timePeriod")]]