summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrej Sinicyn <andrej4000@gmail.com>2005-08-02 22:42:21 +0000
committerAndrej Sinicyn <andrej4000@gmail.com>2005-08-02 22:42:21 +0000
commitffce96d70949fa57cf512edcd3429b0fdf71a61b (patch)
tree2b72c5b4d7c12b19c2286523034ebfb6b11c511f /src
parentbb2a8884e394094da40f82886eacb21c1f798eaf (diff)
downloadmana-ffce96d70949fa57cf512edcd3429b0fdf71a61b.tar.gz
mana-ffce96d70949fa57cf512edcd3429b0fdf71a61b.tar.bz2
mana-ffce96d70949fa57cf512edcd3429b0fdf71a61b.tar.xz
mana-ffce96d70949fa57cf512edcd3429b0fdf71a61b.zip
Fix my previous fix because it broke my own code.
Diffstat (limited to 'src')
-rw-r--r--src/game.cpp9
-rw-r--r--src/game.h1
-rw-r--r--src/gui/requesttrade.cpp2
3 files changed, 8 insertions, 4 deletions
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
diff --git a/src/game.h b/src/game.h
index a3941c89..89613b50 100644
--- a/src/game.h
+++ b/src/game.h
@@ -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();
}
}