mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-13 15:14:52 +09:00
Use strict equality checking
Remove usage of == and != in favour of === and !==.
This commit is contained in:
1 parent
ee81fbb7f6
commit
a84f2d5eb6
13 files changed
+29
-21
No files matched your search
@@ -118,7 +118,7 @@ class MasterPlugin extends plugin.BaseMasterPlugin {
|
||||
this.technologies.set(name, { level, progress, researched });
|
||||
if (progress) {
|
||||
this.progressToBroadcast.add(name);
|
||||
} else if (researched || baseLevel(name) != level) {
|
||||
} else if (researched || baseLevel(name) !== level) {
|
||||
this.broadcastEventToSlaves(this.info.messages.finished, { name, level });
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,9 @@ class neuralDole {
|
||||
for (var i = 1; i <= samples; i++) {
|
||||
sum+=this.stats[itemname][i].req;
|
||||
}
|
||||
if (sum==0) return 0.1;
|
||||
if (sum === 0) {
|
||||
return 0.1;
|
||||
}
|
||||
return sum/samples;
|
||||
}
|
||||
|
||||
|
||||
@@ -46,7 +46,9 @@ function Dose(numreq,instore,store_last_tick,dole,carry,prev_req,numreq_total_ad
|
||||
numreq=Number(numreq);
|
||||
instore=Number(instore);
|
||||
var instore_adj=instore;
|
||||
if (instore_adj==0) instore_adj=0.1;
|
||||
if (instore_adj === 0) {
|
||||
instore_adj = 0.1;
|
||||
}
|
||||
|
||||
var b=Math.trunc(prev_req/instore_adj*numreq);
|
||||
var inp1=[numreq,instore_adj,store_last_tick/numreq,dole,carry];//0..4
|
||||
@@ -97,7 +99,9 @@ function Dose(numreq,instore,store_last_tick,dole,carry,prev_req,numreq_total_ad
|
||||
function Tick(instore,dole,store_last_tick,numreq_total_adj)
|
||||
{
|
||||
var instore_adj=instore;
|
||||
if (instore_adj==0) instore_adj=0.1;
|
||||
if (instore_adj === 0) {
|
||||
instore_adj = 0.1;
|
||||
}
|
||||
var inputs=[instore,dole,store_last_tick/instore_adj,store_last_tick/numreq_total_adj,store_last_tick,numreq_total_adj];
|
||||
var internal=new Array(10).fill(0);
|
||||
var outputs=[0,0];
|
||||
|
||||
@@ -17,7 +17,9 @@ describe("subspace_storage endpoints", function() {
|
||||
|
||||
let contains20SteelPlate = false;
|
||||
inventory.forEach(itemStack => {
|
||||
if(itemStack.name == "steel-plate" && itemStack.count >= 20) contains20SteelPlate = true;
|
||||
if (itemStack.name === "steel-plate" && itemStack.count >= 20) {
|
||||
contains20SteelPlate = true;
|
||||
}
|
||||
});
|
||||
assert(contains20SteelPlate, "Please ensure there are at least 20 steel plate in the inventory");
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user