From 3fcb588f254ccf5869842dfd1965decaf2008817 Mon Sep 17 00:00:00 2001 From: David Athay Date: Sat, 14 Jun 2008 16:59:25 +0000 Subject: Fixed trade bug again. --- ChangeLog | 1 + src/net/tradehandler.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 419e4e4e..69c8fff3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,7 @@ * src/gui/shop.cpp, src/gui/browserbox.cpp, src/net/tradehandler.cpp: Fixed compilation errors. Fixed trade bug (although a little hacky right now). + * src/net/tradehandler.cpp: Changed bug fix as requested by Bjørn. 2008-06-08 Fate diff --git a/src/net/tradehandler.cpp b/src/net/tradehandler.cpp index ed1536eb..af000b3b 100644 --- a/src/net/tradehandler.cpp +++ b/src/net/tradehandler.cpp @@ -159,12 +159,12 @@ void TradeHandler::handleMessage(MessageIn *msg) // Trade: New Item add response (was 0x00ea, now 01b1) { const int index = msg->readInt16(); - if (index == 0) + Item *item = player_node->getInventory()->getItem(index); + if (!item) { tradeWindow->receivedOk(true); return; } - Item *item = player_node->getInventory()->getItem(index); Sint16 quantity = msg->readInt16(); switch (msg->readInt8()) -- cgit v1.2.3-70-g09d2