[PI] Fixing the 'Offer X' bug in trade screen
How to fix the 'Offer X' bug in PI
What's the bug? When you trade another player and you offer a higher amount than you got on you (by using 'Offer X'), the amount you write will be shown. Then you can close the trade screen and you got the amount you wrote of that item.
Will this fix it? Yes! ;)
-----------------------
Open your BankX2 class ( server.model.players.packets; )
Find this line:
Code:
case 3322:
if (c.duelStatus <= 0) {
c.getTradeAndDuel().tradeItem(c.xRemoveId, c.xRemoveSlot,
Xamount);
} else {
c.getTradeAndDuel().stakeItem(c.xRemoveId, c.xRemoveSlot,
Xamount);
}
break;
Simply replace it with this:
Code:
case 3322:
if (c.duelStatus <= 0) {
if (Xamount > c.getItems().getItemAmount(c.xRemoveId))
c.getTradeAndDuel().tradeItem(c.xRemoveId, c.xRemoveSlot,
c.getItems().getItemAmount(c.xRemoveId));
else
c.getTradeAndDuel().tradeItem(c.xRemoveId, c.xRemoveSlot,
Xamount);
} else {
if (Xamount > c.getItems().getItemAmount(c.xRemoveId))
c.getTradeAndDuel().stakeItem(c.xRemoveId, c.xRemoveSlot,
c.getItems().getItemAmount(c.xRemoveId));
else
c.getTradeAndDuel().stakeItem(c.xRemoveId, c.xRemoveSlot,
Xamount);
}
break;
-----------------------
No more bug. :)