diff options
-rwxr-xr-x | .cvsignore | 3 | ||||
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | src/game.cpp | 13 |
3 files changed, 21 insertions, 1 deletions
@@ -22,4 +22,5 @@ depcomp chatlog.txt config.xml stdout.txt -stderr.txt
\ No newline at end of file +stderr.txt +updates
\ No newline at end of file @@ -1,3 +1,9 @@ +2005-07-31 Andrej Sinicyn <andrej4000@gmail.com> + + * src/game.cpp: Don't allow more than one trade dialog at once; if a + trade is canceled on the other side, close the trade + window. + 2005-07-30 Andrej Sinicyn <andrej4000@gmail.com> * src/main.cpp: Removed unnecessary value assignment to a variable. diff --git a/src/game.cpp b/src/game.cpp index 191141a8..24fe3723 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -1078,6 +1078,18 @@ void do_parse() // Trade: Receiving a request to trade case 0x00e5: + // If a trade window is already open, send a trade cancel + // to any other trade request. + // It would still be nice to implement an independent message + // that the person you want to trade with can't do that now. + if (tradeWindow->isVisible() == true) + { + // 0xff packet means cancel + WFIFOW(0) = net_w_value(0x00e6); + WFIFOB(2) = net_b_value(4); + WFIFOSET(3); + break; + } new RequestTradeDialog(RFIFOP(2)); break; @@ -1105,6 +1117,7 @@ void do_parse() case 4: // Trade cancelled chatWindow->chat_log("Trade cancelled.", BY_SERVER); + tradeWindow->setVisible(false); break; default: // Shouldn't happen as well, but to be sure |