Bugfix for previous movement changes. (#494)
This commit is contained in:
@@ -141,8 +141,9 @@ public final class MoveLifeHandler extends AbstractMovementPacketHandler {
|
|||||||
short start_x = slea.readShort(); // hmm.. startpos?
|
short start_x = slea.readShort(); // hmm.. startpos?
|
||||||
short start_y = slea.readShort(); // hmm...
|
short start_y = slea.readShort(); // hmm...
|
||||||
Point startPos = new Point(start_x, start_y - 2);
|
Point startPos = new Point(start_x, start_y - 2);
|
||||||
|
Point serverStartPos = new Point(monster.getPosition());
|
||||||
long movementDataStart = slea.getPosition();
|
long movementDataStart = slea.getPosition();
|
||||||
updatePosition(slea, monster, 0);
|
updatePosition(slea, monster, -2);
|
||||||
long movementDataLength = slea.getPosition() - movementDataStart; //how many bytes were read by updatePosition
|
long movementDataLength = slea.getPosition() - movementDataStart; //how many bytes were read by updatePosition
|
||||||
|
|
||||||
Boolean aggro = monster.aggroMoveLifeUpdate(player);
|
Boolean aggro = monster.aggroMoveLifeUpdate(player);
|
||||||
@@ -159,7 +160,7 @@ public final class MoveLifeHandler extends AbstractMovementPacketHandler {
|
|||||||
System.out.println((isSkill ? "SKILL " : (isAttack ? "ATTCK " : " ")) + "castPos: " + castPos + " rawAct: " + rawActivity + " opt: " + pOption + " skillID: " + useSkillId + " skillLV: " + useSkillLevel + " " + "allowSkill: " + nextMovementCouldBeSkill + " mobMp: " + mobMp);
|
System.out.println((isSkill ? "SKILL " : (isAttack ? "ATTCK " : " ")) + "castPos: " + castPos + " rawAct: " + rawActivity + " opt: " + pOption + " skillID: " + useSkillId + " skillLV: " + useSkillLevel + " " + "allowSkill: " + nextMovementCouldBeSkill + " mobMp: " + mobMp);
|
||||||
}
|
}
|
||||||
slea.seek(movementDataStart);
|
slea.seek(movementDataStart);
|
||||||
map.broadcastMessage(player, MaplePacketCreator.moveMonster(objectid, nextMovementCouldBeSkill, rawActivity, useSkillId, useSkillLevel, pOption, startPos, slea, movementDataLength), monster.getPosition());
|
map.broadcastMessage(player, MaplePacketCreator.moveMonster(objectid, nextMovementCouldBeSkill, rawActivity, useSkillId, useSkillLevel, pOption, startPos, slea, movementDataLength), serverStartPos);
|
||||||
//updatePosition(res, monster, -2); //does this need to be done after the packet is broadcast?
|
//updatePosition(res, monster, -2); //does this need to be done after the packet is broadcast?
|
||||||
map.moveMonster(monster, monster.getPosition());
|
map.moveMonster(monster, monster.getPosition());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ public abstract class AbstractAnimatedMapleMapObject extends AbstractMapleMapObj
|
|||||||
static {
|
static {
|
||||||
MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter((int) getIdleMovementDataLength());
|
MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter((int) getIdleMovementDataLength());
|
||||||
mplew.write(1); //movement command count
|
mplew.write(1); //movement command count
|
||||||
|
mplew.write(0);
|
||||||
mplew.writeShort(-1); //x
|
mplew.writeShort(-1); //x
|
||||||
mplew.writeShort(-1); //y
|
mplew.writeShort(-1); //y
|
||||||
mplew.writeShort(0); //xwobble
|
mplew.writeShort(0); //xwobble
|
||||||
@@ -67,15 +68,15 @@ public abstract class AbstractAnimatedMapleMapObject extends AbstractMapleMapObj
|
|||||||
//seems wasteful to create a whole packet writer when only a few values are changed
|
//seems wasteful to create a whole packet writer when only a few values are changed
|
||||||
int x = getPosition().x;
|
int x = getPosition().x;
|
||||||
int y = getPosition().y;
|
int y = getPosition().y;
|
||||||
movementData[1] = (byte) (x & 0xFF); //x
|
movementData[2] = (byte) (x & 0xFF); //x
|
||||||
movementData[2] = (byte) (x >> 8 & 0xFF);
|
movementData[3] = (byte) (x >> 8 & 0xFF);
|
||||||
movementData[3] = (byte) (y & 0xFF); //y
|
movementData[4] = (byte) (y & 0xFF); //y
|
||||||
movementData[4] = (byte) (y >> 8 & 0xFF);
|
movementData[5] = (byte) (y >> 8 & 0xFF);
|
||||||
movementData[11] = (byte) (getStance() & 0xFF);
|
movementData[12] = (byte) (getStance() & 0xFF);
|
||||||
return new GenericSeekableLittleEndianAccessor(new ByteArrayByteStream(movementData));
|
return new GenericSeekableLittleEndianAccessor(new ByteArrayByteStream(movementData));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static long getIdleMovementDataLength() {
|
public static long getIdleMovementDataLength() {
|
||||||
return 14;
|
return 15;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user