Просмотр исходного кода

Add 'onBeforePassiveChange' event

tags/v0.4.4^2
Peyrille Benjamin 4 лет назад
Родитель
Сommit
477fb3faa2
1 измененных файлов: 20 добавлений и 0 удалений
  1. +20
    -0
      src/server/components/passives.js

+ 20
- 0
src/server/components/passives.js Просмотреть файл

@@ -70,6 +70,16 @@ module.exports = {
}, this);
if (!linked)
return;
let passiveResult = {
success: true
};
this.obj.fireEvent('onBeforePassiveChange', passiveResult, this.obj, node);
if (!passiveResult.success)
return;
this.obj.instance.eventEmitter.emitNoSticky('onBeforePassiveChange', passiveResult, this.obj, node);
if (!passiveResult.success)
return;

this.points--;
this.obj.syncer.set(true, 'passives', 'points', this.points);
@@ -87,6 +97,16 @@ module.exports = {
},

untickNode: function (msg) {
let passiveResult = {
success: true
};
this.obj.fireEvent('onBeforePassiveChange', passiveResult, this.obj);
if (!passiveResult.success)
return;
this.obj.instance.eventEmitter.emitNoSticky('onBeforePassiveChange', passiveResult, this.obj);
if (!passiveResult.success)
return;

let stats = this.obj.stats;

this.selected.forEach(function (s) {


Загрузка…
Отмена
Сохранить