Browse Source

bug #2022: Fixed charge and fireblast stun being cancelled when it shouldn't

tags/v0.14.1.3^2
Shaun 1 month ago
parent
commit
427498fb65
3 changed files with 17 additions and 5 deletions
  1. +9
    -2
      src/server/components/spellbook.js
  2. +4
    -2
      src/server/config/spells/spellCharge.js
  3. +4
    -1
      src/server/config/spells/spellFireblast.js

+ 9
- 2
src/server/components/spellbook.js View File

@@ -409,6 +409,13 @@ module.exports = {
return didCast || isCasting;
},

//Callbacks to be called when this object is destroyed
registerDestroyCallback: function (callback) {
this.callbacks.push({
cbOnSelfDestroyed: callback
});
},

registerCallback: function (sourceId, callback, time, destroyCallback, targetId, destroyOnRezone) {
let obj = {
sourceId: sourceId,
@@ -508,8 +515,8 @@ module.exports = {

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

this.spells.forEach(s => {


+ 4
- 2
src/server/config/spells/spellCharge.js View File

@@ -87,10 +87,12 @@ module.exports = {

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

//To be called when the object is destroyed
this.obj.spellbook.registerDestroyCallback(this.destroyEffectOnTarget.bind(this, target, targetEffect));

return true;
},



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

@@ -148,9 +148,12 @@ module.exports = {
this.queueCallback(
this.endEffect.bind(this, m, targetPos, targetEffect),
ttl,
this.destroyEffectOnTarget.bind(this, m, targetEffect),
null,
m
);

//To be called when the object is destroyed
this.obj.spellbook.registerDestroyCallback(this.destroyEffectOnTarget.bind(this, m, targetEffect));
}
}
}


Loading…
Cancel
Save