Browse Source

modding[#1593]: Added the beforeDestroyEffect object event and beforeDestroy effect event

tags/v0.8.1^2
Shaun 3 years ago
parent
commit
c2ea6f8831
1 changed files with 12 additions and 1 deletions
  1. +12
    -1
      src/server/components/effects.js

+ 12
- 1
src/server/components/effects.js View File

@@ -105,8 +105,14 @@ module.exports = {
}
}

if (effect.destroy)
if (effect.destroy) {
this.obj.fireEvent('beforeDestroyEffect', effect);

if (effect.events && effect.events.beforeDestroy)
effect.events.beforeDestroy(effect);

effect.destroy();
}

this.syncRemove(effect.id, effect.type);
effects.splice(i, 1);
@@ -299,6 +305,11 @@ module.exports = {
eLen--;
i--;

this.obj.fireEvent('beforeDestroyEffect', e);

if (e.events && e.events.beforeDestroy)
e.events.beforeDestroy(e);

if (e.destroy)
e.destroy();



Loading…
Cancel
Save