mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-19 15:33:12 +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))
|
for (let [name, research] of Object.entries(cluster_researches))
|
||||||
research.progress = this.research[name].contribution
|
research.progress = this.research[name].contribution
|
||||||
|
|
||||||
for (let slave_data of slaves_data)
|
for (let slave_data of slaves_data) {
|
||||||
for (let [name, research] of Object.entries(slave_data.meta.research))
|
for (let [name, research] of Object.entries(slave_data.meta.research)) {
|
||||||
if (cluster_researches[name]
|
if (!cluster_researches[name])
|
||||||
&& !isNaN(cluster_researches[name].progress) && !isNaN(research.contribution))
|
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
|
cluster_researches[name].progress += research.contribution
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (let [name, research] of Object.entries(cluster_researches)) {
|
for (let [name, research] of Object.entries(cluster_researches)) {
|
||||||
if (research.progress > 1) {
|
if (research.progress > 1) {
|
||||||
|
|||||||
Reference in new issue
Block a user