Untangle nested control flow conditions.
This commit is contained in:
@@ -316,30 +316,25 @@ public class DueyProcessor {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Pair<Integer, Integer> accIdCid;
|
if(c.getPlayer().getMeso() < finalcost) {
|
||||||
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 {
|
|
||||||
c.sendPacket(PacketCreator.sendDueyMSG(DueyProcessor.Actions.TOCLIENT_SEND_NOT_ENOUGH_MESOS.getCode()));
|
c.sendPacket(PacketCreator.sendDueyMSG(DueyProcessor.Actions.TOCLIENT_SEND_NOT_ENOUGH_MESOS.getCode()));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int recipientCid = accIdCid.getRight();
|
var accIdCid = getAccountCharacterIdFromCNAME(recipient);
|
||||||
if (recipientCid == -1) {
|
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()));
|
c.sendPacket(PacketCreator.sendDueyMSG(DueyProcessor.Actions.TOCLIENT_SEND_NAME_DOES_NOT_EXIST.getCode()));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (recipientAccId == c.getAccID()) {
|
||||||
|
c.sendPacket(PacketCreator.sendDueyMSG(DueyProcessor.Actions.TOCLIENT_SEND_SAMEACC_ERROR.getCode()));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (quick) {
|
if (quick) {
|
||||||
InventoryManipulator.removeById(c, InventoryType.CASH, ItemId.QUICK_DELIVERY_TICKET, (short) 1, false, false);
|
InventoryManipulator.removeById(c, InventoryType.CASH, ItemId.QUICK_DELIVERY_TICKET, (short) 1, false, false);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user