Some servers may have this some may not
Basically you open trade/duel get any noted item offer it and then remove x
and do 2147m and it will crash the whole server.
fixed code.
Code:
public boolean fromTrade(int itemID, int fromSlot, int amount) {
Client o = (Client) PlayerHandler.players[c.tradeWith];
if (o == null) {
return false;
}
try {
if (!c.inTrade || !c.canOffer) {
declineTrade();
return false;
}
if (amount < 0) {
return false;
}
c.tradeConfirmed = false;
o.tradeConfirmed = false;
if (!Item.itemStackable[itemID]) {
if (amount > 28) {
amount = 28;
}
for (int a = 0; a < amount; a++) {
for (GameItem item : offeredItems) {
if (item.id == itemID) {
if (!item.stackable) {
offeredItems.remove(item);
c.getItems().addItem(itemID, 1);
} else if (item.amount > amount) {
item.amount -= amount;
c.getItems().addItem(itemID, amount);
} else {
amount = item.amount;
offeredItems.remove(item);
c.getItems().addItem(itemID, amount);
}
break;
}
}
}
}
for (GameItem item : offeredItems) {
if (item.id == itemID) {
if (!item.stackable) {
} else if (item.amount > amount) {
item.amount -= amount;
c.getItems().addItem(itemID, amount);
} else {
amount = item.amount;
offeredItems.remove(item);
c.getItems().addItem(itemID, amount);
}
break;
}
}
c.tradeConfirmed = false;
o.tradeConfirmed = false;
c.getItems().resetItems(3322);
resetTempItems(3415);
o.getTradeAndDuel().resetOTItems(3416);
displayWAndI(c);
c.getPA().sendFrame126("", 3431);
o.getPA().sendFrame126("", 3431);
} catch (Exception e) {
}
return true;
}