|
|
@@ -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; |
|
|
|
}, |
|
|
|
|
|
|
@@ -147,7 +149,8 @@ module.exports = { |
|
|
|
}, |
|
|
|
|
|
|
|
destroyEffectOnTarget: function (target, targetEffect) { |
|
|
|
target.effects.removeEffect(targetEffect.id); |
|
|
|
if (targetEffect) |
|
|
|
target.effects.removeEffect(targetEffect.id); |
|
|
|
}, |
|
|
|
|
|
|
|
isTileValid: function (physics, fromX, fromY, toX, toY) { |
|
|
|