refactor: 0 === infinite

This commit is contained in:
cha0s 2021-01-24 21:52:23 -06:00
parent 25479e40ac
commit 69971d420e

View File

@ -125,7 +125,7 @@ export default (latus) => class Spawner extends decorate(Trait) {
static defaultState() {
return {
isSpawning: true,
maxSpawns: Infinity,
maxSpawns: 0,
};
}
@ -179,7 +179,7 @@ export default (latus) => class Spawner extends decorate(Trait) {
}
maySpawn() {
if (this.maxSpawns <= this.#children.length) {
if (this.maxSpawns > 0 && this.maxSpawns <= this.#children.length) {
return false;
}
if (!this.destinationEntityList()) {