Browse Source

Made syncExtend sync to all and added syncExtendSelf method

merge-requests/579/head
kckckc 2 years ago
parent
commit
13d4d433a7
2 changed files with 8 additions and 4 deletions
  1. +2
    -2
      src/server/components/effects.js
  2. +6
    -2
      src/server/config/effects/effectTemplate.js

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

@@ -204,7 +204,7 @@ module.exports = {
return builtEffect;
},

syncExtend: function (id, data) {
syncExtend: function (id, data, self) {
let effect = this.effects.find(e => e.id === id);
if (!effect)
return;
@@ -213,7 +213,7 @@ module.exports = {
if (effect.silent)
return;

this.obj.syncer.setArray(true, 'effects', 'extendEffects', {
this.obj.syncer.setArray(self, 'effects', 'extendEffects', {
id,
data
});


+ 6
- 2
src/server/config/effects/effectTemplate.js View File

@@ -1,7 +1,11 @@
module.exports = {
syncExtend: function (data) {
let effects = this.obj.effects;
effects.syncExtend(this.id, data);
effects.syncExtend(this.id, data, false);
},
syncExtendSelf: function (data) {
let effects = this.obj.effects;
effects.syncExtend(this.id, data, true);
},

isFirstOfType: function () {
@@ -34,5 +38,5 @@ module.exports = {
id: this.id,
type: this.type
};
}
}
};

Loading…
Cancel
Save