diff --git a/src/main/java/client/processor/npc/DueyProcessor.java b/src/main/java/client/processor/npc/DueyProcessor.java index 505b2b9e5b..8a8615985b 100644 --- a/src/main/java/client/processor/npc/DueyProcessor.java +++ b/src/main/java/client/processor/npc/DueyProcessor.java @@ -316,30 +316,25 @@ public class DueyProcessor { return; } - Pair accIdCid; - if (c.getPlayer().getMeso() >= finalcost) { - accIdCid = getAccountCharacterIdFromCNAME(recipient); - int recipientAccId = accIdCid.getLeft(); - if (recipientAccId != -1) { - if (recipientAccId == c.getAccID()) { - c.sendPacket(PacketCreator.sendDueyMSG(DueyProcessor.Actions.TOCLIENT_SEND_SAMEACC_ERROR.getCode())); - return; - } - } else { - c.sendPacket(PacketCreator.sendDueyMSG(DueyProcessor.Actions.TOCLIENT_SEND_NAME_DOES_NOT_EXIST.getCode())); - return; - } - } else { + if(c.getPlayer().getMeso() < finalcost) { c.sendPacket(PacketCreator.sendDueyMSG(DueyProcessor.Actions.TOCLIENT_SEND_NOT_ENOUGH_MESOS.getCode())); return; } - int recipientCid = accIdCid.getRight(); - if (recipientCid == -1) { + var accIdCid = getAccountCharacterIdFromCNAME(recipient); + var recipientAccId = accIdCid.getLeft(); + var recipientCid = accIdCid.getRight(); + + if (recipientAccId == -1 || recipientCid == -1) { c.sendPacket(PacketCreator.sendDueyMSG(DueyProcessor.Actions.TOCLIENT_SEND_NAME_DOES_NOT_EXIST.getCode())); return; } + if (recipientAccId == c.getAccID()) { + c.sendPacket(PacketCreator.sendDueyMSG(DueyProcessor.Actions.TOCLIENT_SEND_SAMEACC_ERROR.getCode())); + return; + } + if (quick) { InventoryManipulator.removeById(c, InventoryType.CASH, ItemId.QUICK_DELIVERY_TICKET, (short) 1, false, false); }