mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-11 23:04:52 +09:00
Fix researchSync that it counts progress only from techs on same level
This commit is contained in:
1 parent
f28b73cf31
commit
d48a824a69
1 file changed
+12
-4
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user