Browse Source

bug #2022: Fixed charge and fireblast stuns becoming permanent during logout

tags/v0.14.1.2^2
Shaun 1 month ago
parent
commit
877cf5401e
3 changed files with 25 additions and 2 deletions
  1. +5
    -0
      src/server/components/spellbook.js
  2. +10
    -1
      src/server/config/spells/spellCharge.js
  3. +10
    -1
      src/server/config/spells/spellFireblast.js

+ 5
- 0
src/server/components/spellbook.js View File

@@ -507,6 +507,11 @@ module.exports = {
},

destroy: function () {
this.callbacks.forEach(c => {
if (c.destroyCallback)
c.destroyCallback();
});

this.spells.forEach(s => {
if (s.destroy)
s.destroy();


+ 10
- 1
src/server/config/spells/spellCharge.js View File

@@ -85,10 +85,15 @@ module.exports = {
}, -1);
}

this.queueCallback(this.reachDestination.bind(this, target, targetPos, targetEffect, selfEffect), ttl - 50);
this.queueCallback(
this.reachDestination.bind(this, target, targetPos, targetEffect, selfEffect),
ttl - 50,
this.destroyEffectOnTarget.bind(this, target, targetEffect)
);

return true;
},

reachDestination: function (target, targetPos, targetEffect, selfEffect) {
if (this.obj.destroyed)
return;
@@ -141,6 +146,10 @@ module.exports = {
this.obj.spellbook.spells[this.castOnEnd].cast();
},

destroyEffectOnTarget: function (target, targetEffect) {
target.effects.removeEffect(targetEffect.id);
},

isTileValid: function (physics, fromX, fromY, toX, toY) {
if (physics.isTileBlocking(toX, toY))
return false;


+ 10
- 1
src/server/config/spells/spellFireblast.js View File

@@ -145,7 +145,12 @@ module.exports = {
}]
});

this.queueCallback(this.endEffect.bind(this, m, targetPos, targetEffect), ttl, null, m);
this.queueCallback(
this.endEffect.bind(this, m, targetPos, targetEffect),
ttl,
this.destroyEffectOnTarget.bind(this, m, targetEffect),
m
);
}
}
}
@@ -200,5 +205,9 @@ module.exports = {
spell: this
};
target.fireEvent('afterPositionChange', moveEvent);
},

destroyEffectOnTarget: function (target, targetEffect) {
target.effects.removeEffect(targetEffect.id);
}
};

Loading…
Cancel
Save