fix: continue instead of return
This commit is contained in:
parent
036bf6ad30
commit
86ae9ab3b1
|
@ -169,7 +169,7 @@ export class Vulnerable extends Trait {
|
|||
for (let i = 0; i < damageSpecs.length; ++i) {
|
||||
const damageSpec = damageSpecs[i];
|
||||
if (this.locks.has(damageSpec)) {
|
||||
return;
|
||||
continue;
|
||||
}
|
||||
this.locks.set(damageSpec, damageSpec.lock);
|
||||
const variance = Math.random() * damageSpec.variance * 2 - damageSpec.variance;
|
||||
|
@ -212,9 +212,18 @@ export class Vulnerable extends Trait {
|
|||
}
|
||||
}
|
||||
if (AVOCADO_SERVER) {
|
||||
const keys = Array.from(this.locks.keys());
|
||||
for (let i = 0; i < keys.length; ++i) {
|
||||
const key = keys[i];
|
||||
const keyIterator = this.locks.keys();
|
||||
// const keys = Array.from(this.locks.keys());
|
||||
for (
|
||||
let thisKey = keyIterator.next();
|
||||
thisKey.done !== true;
|
||||
thisKey = keyIterator.next()
|
||||
) {
|
||||
// newArray.push(nextValue.value);
|
||||
// }
|
||||
// for (let i = 0; i < keys.length; ++i) {
|
||||
// const key = keys[i];
|
||||
const {value: key} = thisKey;
|
||||
const remaining = this.locks.get(key) - elapsed;
|
||||
if (remaining <= 0) {
|
||||
this.locks.delete(key);
|
||||
|
|
Loading…
Reference in New Issue
Block a user