Browse Source

Fix syncExtend calls from server effect init

merge-requests/579/head
kckckc 2 years ago
parent
commit
50db6e0204
1 changed files with 6 additions and 6 deletions
  1. +6
    -6
      src/server/components/effects.js

+ 6
- 6
src/server/components/effects.js View File

@@ -152,7 +152,7 @@ module.exports = {
//If there is no existing effect or the effect is not stackable, make a new effect
if (!oldEffect || !oldEffect.shouldStack)
return this.buildEffect(options);
//If the effect is stackable and the new effect should stack, stack with the old effect
let shouldStack = oldEffect.shouldStack(options);
if (shouldStack && oldEffect.incrementStack) {
@@ -184,18 +184,18 @@ module.exports = {
buildEffect: function (options) {
let builtEffect = this.getTypeTemplate(options.type);

for (let p in options)
for (let p in options)
builtEffect[p] = options[p];
builtEffect.obj = this.obj;
builtEffect.id = this.nextId++;
builtEffect.silent = options.silent;

this.effects.push(builtEffect);

if (builtEffect.init)
builtEffect.init(options.source);

this.effects.push(builtEffect);

if (!options.silent)
this.obj.syncer.setArray(false, 'effects', 'addEffects', builtEffect.simplify());

@@ -241,7 +241,7 @@ module.exports = {
this.destroyEffect(effect);

this.syncRemove(effect.id);
this.effects.spliceWhere(e => e.id === id);
},



Loading…
Cancel
Save