summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-x.cvsignore3
-rw-r--r--ChangeLog6
-rw-r--r--src/game.cpp13
3 files changed, 21 insertions, 1 deletions
diff --git a/.cvsignore b/.cvsignore
index 6e5ea9c5..1461ed52 100755
--- a/.cvsignore
+++ b/.cvsignore
@@ -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
diff --git a/ChangeLog b/ChangeLog
index dca43ac3..7f47d6fd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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