Update AbstractMovementPacketHandler (#532)

updatePosition should throw exception too in default case 👍
This commit is contained in:
salem909
2019-10-15 11:13:22 -07:00
committed by Ronan Lana
parent efbf415787
commit 54cdba01ae

View File

@@ -41,6 +41,7 @@ public abstract class AbstractMovementPacketHandler extends AbstractMaplePacketH
protected List<LifeMovementFragment> parseMovement(LittleEndianAccessor lea) throws EmptyMovementException {
List<LifeMovementFragment> res = new ArrayList<>();
byte numCommands = lea.readByte();
if (numCommands < 1) throw new EmptyMovementException(lea);
for (byte i = 0; i < numCommands; i++) {
byte command = lea.readByte();
switch (command) {
@@ -236,7 +237,7 @@ public abstract class AbstractMovementPacketHandler extends AbstractMaplePacketH
}
default:
System.out.println("Unhandled Case:" + command);
return;
throw new EmptyMovementException(lea);
}
}
}