NPCMoreTalkHandler: don't underflow selection

This commit is contained in:
yuzumika
2024-01-03 16:10:23 -08:00
parent f63f7e13d4
commit cb0320a471

View File

@@ -60,6 +60,11 @@ public final class NPCMoreTalkHandler extends AbstractPacketHandler {
selection = p.readInt();
} else if (p.available() > 0) {
selection = p.readByte();
// 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().isStart()) {