mirror of
https://github.com/2009scape/2009scape.github.io.git
synced 2024-08-18 15:19:56 +02:00
Log error and continue when malformed minAmount in JSON (#219)
This commit is contained in:
parent
2c699a1520
commit
1a6b8ffd6b
@ -231,6 +231,10 @@ export default {
|
|||||||
}
|
}
|
||||||
getExpectedQuantity() {
|
getExpectedQuantity() {
|
||||||
let t = 0;
|
let t = 0;
|
||||||
|
if(this.minAmount > this.maxAmount ) {
|
||||||
|
console.error("ERROR WITH DROP ID", this.id, "- MinValue > MaxValue")
|
||||||
|
return(0)
|
||||||
|
}
|
||||||
const range = Array(this.maxAmount - this.minAmount + 1).fill(1).map((x, y) => this.minAmount + y);
|
const range = Array(this.maxAmount - this.minAmount + 1).fill(1).map((x, y) => this.minAmount + y);
|
||||||
return ((range.reduce((a, b) => a + b, t) / range.length * (this.rarity / 100))).toFixed(2)
|
return ((range.reduce((a, b) => a + b, t) / range.length * (this.rarity / 100))).toFixed(2)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user