Ticket #1374: errorReport.2.patch
File errorReport.2.patch, 2.6 KB (added by , 9 years ago) |
---|
-
gui/common/functions_civinfo.js
7 7 8 8 9 9 function loadCivData() 10 { // Load all JSON files containing civ data 10 { 11 // Load all JSON files containing civ data 11 12 var civData = {}; 12 13 var civFiles = Engine.BuildDirEntList("civs/", "*.json", false); 13 14 14 15 for each (var filename in civFiles) 15 { // Parse data if valid file 16 { 17 // Parse data if valid file 16 18 var data = parseJSONData(filename); 19 if (Object.keys(data).length == 0) 20 continue; 17 21 translateObjectKeys(data, ["Name", "Description", "History", "Special"]); 18 22 civData[data.Code] = data; 19 23 } -
simulation/components/TechnologyTemplateManager.js
19 19 { 20 20 if (!this.allTechs[template]) 21 21 { 22 this.allTechs[template] = Engine.ReadJSONFile("technologies/" + template + ".json"); 23 if (!this.allTechs[template]) 24 error("Failed to load technology \"" + template + "\""); 22 try 23 { 24 this.allTechs[template] = Engine.ReadJSONFile("technologies/" + template + ".json"); 25 } 26 catch (err) 27 { 28 error(sprintf("%(error)s in '%(path)s'", { error: err.toString(), path: template })); 29 } 25 30 } 26 31 27 return this.allTechs[template] ;32 return this.allTechs[template] || false; 28 33 }; 29 34 30 35 TechnologyTemplateManager.prototype.GetAuraTemplate = function(template) -
simulation/components/TechnologyManager.js
283 283 284 284 if (!template) 285 285 { 286 error("Tried to research invalid tech onology: " + uneval(tech));286 error("Tried to research invalid technology: " + uneval(tech)); 287 287 return; 288 288 } 289 289 -
simulation/components/ProductionQueue.js
241 241 // Find the template data so we can determine the build costs 242 242 var cmpTempMan = Engine.QueryInterface(SYSTEM_ENTITY, IID_TemplateManager); 243 243 var template = cmpTempMan.GetTemplate(templateName); 244 if (!template )244 if (!template || Object.keys(template) == 0) 245 245 return; 246 246 if (template.Promotion) 247 247 {