This commit is contained in:
dginovker
2019-10-27 15:06:29 -04:00
3 changed files with 35 additions and 12 deletions
@@ -2431,10 +2431,13 @@ public class ClickingButtons implements PacketType {
}
Client ot = (Client) PlayerHandler.players[player.tradeWith];
if (ot == null) {
if (ot == null || !ot.inTrade) {
player.getTrading().declineTrade();
player.getActionSender().sendMessage(
"Trade declined as the other player has disconnected.");
ot.getTrading().declineTrade();
ot.getActionSender().sendMessage(
"Trade declined as you disconnected.");
break;
}
player.getPlayerAssistant().sendFrame126(
@@ -2525,6 +2528,11 @@ public class ClickingButtons implements PacketType {
ot1.acceptedTrade = true;
player.getTrading().giveItems();
ot1.getTrading().giveItems();
//here
player.getActionSender().sendMessage(
"@red@Trade completed.");
ot1.getActionSender().sendMessage(
"@red@Trade completed.");
break;
}
ot1.getPlayerAssistant().sendFrame126(
@@ -20,8 +20,9 @@ public class ClickingStuff implements PacketType {
if(player.isShopping)
player.isShopping = false;
if (player.inTrade) {
if (!player.acceptedTrade) {
Client opponent = (Client) PlayerHandler.players[player.tradeWith];
Client opponent = (Client) PlayerHandler.players[player.tradeWith];
if (!player.acceptedTrade || !opponent.inTrade || opponent == null) {
opponent = (Client) PlayerHandler.players[player.tradeWith];
opponent.tradeAccepted = false;
player.tradeAccepted = false;
opponent.tradeStatus = 0;
@@ -32,8 +33,9 @@ public class ClickingStuff implements PacketType {
opponent.getActionSender().sendMessage("@red@Other player has declined the trade.");
Misc.println("trade reset");
player.getTrading().declineTrade();
opponent.getTrading().declineTrade();
}
}
}
if(player.openDuel && player.duelStatus >= 1 && player.duelStatus <= 4) {
Client o = (Client) PlayerHandler.players[player.duelingWith];