diff options
author | Andrej Sinicyn <andrej4000@gmail.com> | 2005-08-02 22:42:21 +0000 |
---|---|---|
committer | Andrej Sinicyn <andrej4000@gmail.com> | 2005-08-02 22:42:21 +0000 |
commit | ffce96d70949fa57cf512edcd3429b0fdf71a61b (patch) | |
tree | 2b72c5b4d7c12b19c2286523034ebfb6b11c511f | |
parent | bb2a8884e394094da40f82886eacb21c1f798eaf (diff) | |
download | Mana-ffce96d70949fa57cf512edcd3429b0fdf71a61b.tar.gz Mana-ffce96d70949fa57cf512edcd3429b0fdf71a61b.tar.bz2 Mana-ffce96d70949fa57cf512edcd3429b0fdf71a61b.tar.xz Mana-ffce96d70949fa57cf512edcd3429b0fdf71a61b.zip |
Fix my previous fix because it broke my own code.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | src/game.cpp | 9 | ||||
-rw-r--r-- | src/game.h | 1 | ||||
-rw-r--r-- | src/gui/requesttrade.cpp | 2 |
4 files changed, 13 insertions, 4 deletions
@@ -1,3 +1,8 @@ +2005-08-03 Andrej Sinicyn <andrej4000@gmail.com> + + * src/game.cpp, src/game.h, src/gui/requesttrade.cpp: Fix my previous fix + because it broke my own code. + 2005-08-03 Björn Steinbrink <B.Steinbrink@gmx.de> * src/main.cpp: Use PhysFS to determine user's home directory on unix diff --git a/src/game.cpp b/src/game.cpp index f18dc6f6..7fb031e5 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -80,7 +80,7 @@ ConfirmDialog *exitConfirm = NULL; Being *target = NULL; Inventory *inventory = NULL; -RequestTradeDialog *requestTradeDialog = NULL; +bool requestTradeDialogOpen = false; const int EMOTION_TIME = 150; /**< Duration of emotion icon */ const int MAX_TIME = 10000; @@ -1094,12 +1094,12 @@ void do_parse() WFIFOSET(3); break; } - if (requestTradeDialog == NULL) + if (!requestTradeDialogOpen) { + requestTradeDialogOpen = true; strcpy(tradePartnerName, RFIFOP(2)); - requestTradeDialog = new RequestTradeDialog(RFIFOP(2)); + new RequestTradeDialog(RFIFOP(2)); } - requestTradeDialog = NULL; break; // Trade: Response @@ -1123,6 +1123,7 @@ void do_parse() tradeWindow->reset(); tradeWindow->setCaption((std::string)"Trade: You and " + (std::string)tradePartnerName); tradeWindow->setVisible(true); + requestTradeDialogOpen = false; break; case 4: // Trade cancelled @@ -47,6 +47,7 @@ extern volatile int tick_time; extern int server_tick; extern bool displayPathToMouse; extern int startX, startY; +extern bool requestTradeDialogOpen; enum { JOY_UP, diff --git a/src/gui/requesttrade.cpp b/src/gui/requesttrade.cpp index ce6ccb56..151a7514 100644 --- a/src/gui/requesttrade.cpp +++ b/src/gui/requesttrade.cpp @@ -23,6 +23,7 @@ #include "requesttrade.h" #include "button.h" +#include "../game.h" #include "../net/network.h" RequestTradeDialog::RequestTradeDialog(const char *name): @@ -90,6 +91,7 @@ void RequestTradeDialog::action(const std::string& eventId) WFIFOW(0) = net_w_value(0x00e6); WFIFOB(2) = net_b_value(4); WFIFOSET(3); + requestTradeDialogOpen = false; scheduleDelete(); } } |