Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use separate stored-template file for skirmish and campaign.

Fixes ticket:3702.
  • Loading branch information...
commit d969dd7756859b0daea5ac2fe16422511f6876e0 1 parent 984bdbc
@Cyp Cyp authored
Showing with 9 additions and 4 deletions.
  1. +9 −4 src/template.cpp
View
13 src/template.cpp
@@ -113,12 +113,17 @@ bool researchedTemplate(DROID_TEMPLATE *psCurr, int player, bool allowRedundant)
return researchedEverything;
}
+static char const *templatesFilename()
+{
+ return bMultiPlayer? "templates.ini" : "templatesCampaign.ini";
+}
+
bool initTemplates()
{
- WzConfig ini("templates.ini");
+ WzConfig ini(templatesFilename());
if (ini.status() != QSettings::NoError)
{
- debug(LOG_FATAL, "Could not open templates.ini");
+ debug(LOG_FATAL, "Could not open %s", templatesFilename());
return false;
}
QStringList list = ini.childGroups();
@@ -188,10 +193,10 @@ bool initTemplates()
bool storeTemplates()
{
// Write stored templates (back) to file
- WzConfig ini("templates.ini");
+ WzConfig ini(templatesFilename());
if (ini.status() != QSettings::NoError || !ini.isWritable())
{
- debug(LOG_FATAL, "Could not open templates.ini");
+ debug(LOG_FATAL, "Could not open %s", templatesFilename());
return false;
}
for (DROID_TEMPLATE *psCurr = apsDroidTemplates[selectedPlayer]; psCurr != NULL; psCurr = psCurr->psNext)
Please sign in to comment.
Something went wrong with that request. Please try again.