Browse Source

modding #1985: Added oldPos to the afterPositionChange event

tags/v0.12.0
Shaun 1 year ago
parent
commit
e75c1486c1
2 changed files with 16 additions and 7 deletions
  1. +12
    -7
      src/server/config/spells/spellCharge.js
  2. +4
    -0
      src/server/config/spells/spellFireblast.js

+ 12
- 7
src/server/config/spells/spellCharge.js View File

@@ -95,6 +95,18 @@ module.exports = {

let obj = this.obj;

const moveEvent = {
oldPos: {
x: obj.x,
y: obj.y
},
newPos: targetPos,
source: this,
target: this,
spellName: 'charge',
spell: this
};

obj.instance.physics.removeObject(obj, obj.x, obj.y);

obj.x = targetPos.x;
@@ -122,13 +134,6 @@ module.exports = {
spellName: 'charge'
});

const moveEvent = {
newPos: targetPos,
source: this,
target: this,
spellName: 'charge',
spell: this
};
this.obj.fireEvent('afterPositionChange', moveEvent);

if (this.castOnEnd)


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

@@ -179,6 +179,10 @@ module.exports = {
syncer.o.y = yFinal;

const moveEvent = {
oldPos: {
x: xOld,
y: yOld
},
newPos: {
x: xFinal,
y: yFinal


Loading…
Cancel
Save