implement ByteBufInPacket.readUnsignedByte
This commit is contained in:
@@ -22,6 +22,8 @@ public class ByteBufInPacket implements InPacket {
|
|||||||
public byte readByte() {
|
public byte readByte() {
|
||||||
return byteBuf.readByte();
|
return byteBuf.readByte();
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
|
public short readUnsignedByte() { return byteBuf.readUnsignedByte(); }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public short readShort() {
|
public short readShort() {
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import java.awt.*;
|
|||||||
|
|
||||||
public interface InPacket extends Packet {
|
public interface InPacket extends Packet {
|
||||||
byte readByte();
|
byte readByte();
|
||||||
|
short readUnsignedByte();
|
||||||
short readShort();
|
short readShort();
|
||||||
int readInt();
|
int readInt();
|
||||||
long readLong();
|
long readLong();
|
||||||
|
|||||||
@@ -59,12 +59,7 @@ public final class NPCMoreTalkHandler extends AbstractPacketHandler {
|
|||||||
if (p.available() >= 4) {
|
if (p.available() >= 4) {
|
||||||
selection = p.readInt();
|
selection = p.readInt();
|
||||||
} else if (p.available() > 0) {
|
} else if (p.available() > 0) {
|
||||||
selection = p.readByte();
|
selection = p.readUnsignedByte();
|
||||||
// If there are more than 127 choices, don't underflow to -128.
|
|
||||||
// This is useful if you want to have more than 127 hairs/faces at a stylist NPC.
|
|
||||||
if (selection < 0) {
|
|
||||||
selection += 256;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (c.getQM() != null) {
|
if (c.getQM() != null) {
|
||||||
if (c.getQM().isStart()) {
|
if (c.getQM().isStart()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user