Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Use separate stored-template file for skirmish and campaign.

Fixes ticket:3702.
  • Loading branch information...
commit d969dd7756859b0daea5ac2fe16422511f6876e0 1 parent 984bdbc
Cyp authored October 04, 2012

Showing 1 changed file with 9 additions and 4 deletions. Show diff stats Hide diff stats

  1. 13  src/template.cpp
13  src/template.cpp
@@ -113,12 +113,17 @@ bool researchedTemplate(DROID_TEMPLATE *psCurr, int player, bool allowRedundant)
113 113
 	return researchedEverything;
114 114
 }
115 115
 
  116
+static char const *templatesFilename()
  117
+{
  118
+	return bMultiPlayer? "templates.ini" : "templatesCampaign.ini";
  119
+}
  120
+
116 121
 bool initTemplates()
117 122
 {
118  
-	WzConfig ini("templates.ini");
  123
+	WzConfig ini(templatesFilename());
119 124
 	if (ini.status() != QSettings::NoError)
120 125
 	{
121  
-		debug(LOG_FATAL, "Could not open templates.ini");
  126
+		debug(LOG_FATAL, "Could not open %s", templatesFilename());
122 127
 		return false;
123 128
 	}
124 129
 	QStringList list = ini.childGroups();
@@ -188,10 +193,10 @@ bool initTemplates()
188 193
 bool storeTemplates()
189 194
 {
190 195
 	// Write stored templates (back) to file
191  
-	WzConfig ini("templates.ini");
  196
+	WzConfig ini(templatesFilename());
192 197
 	if (ini.status() != QSettings::NoError || !ini.isWritable())
193 198
 	{
194  
-		debug(LOG_FATAL, "Could not open templates.ini");
  199
+		debug(LOG_FATAL, "Could not open %s", templatesFilename());
195 200
 		return false;
196 201
 	}
197 202
 	for (DROID_TEMPLATE *psCurr = apsDroidTemplates[selectedPlayer]; psCurr != NULL; psCurr = psCurr->psNext)

0 notes on commit d969dd7

Please sign in to comment.
Something went wrong with that request. Please try again.