Fix researchSync that it counts progress only from techs on same level

This commit is contained in:
TechnoStrife committed 2019-07-17 00:31:15 +03:00
1 parent f28b73cf31
commit d48a824a69
1 file changed
+12 -4
+12 -4
View File
@@ -154,11 +154,19 @@ class ResearchSync {
for (let [name, research] of Object.entries(cluster_researches))
research.progress = this.research[name].contribution
for (let slave_data of slaves_data)
for (let [name, research] of Object.entries(slave_data.meta.research))
if (cluster_researches[name]
&& !isNaN(cluster_researches[name].progress) && !isNaN(research.contribution))
for (let slave_data of slaves_data) {
for (let [name, research] of Object.entries(slave_data.meta.research)) {
if (!cluster_researches[name])
continue
if (isNaN(cluster_researches[name].progress)
|| isNaN(research.contribution)
|| isNaN(research.level)
|| isNaN(cluster_researches[name].level))
continue
if (cluster_researches[name].level === research.level)
cluster_researches[name].progress += research.contribution
}
}
for (let [name, research] of Object.entries(cluster_researches)) {
if (research.progress > 1) {