summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp39
1 files changed, 31 insertions, 8 deletions
diff --git a/src/game.cpp b/src/game.cpp
index 82f919976..5a372a6bd 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -26,19 +26,19 @@
#include "actorspritemanager.h"
#include "actorsprite.h"
+#include "auctionmanager.h"
#include "being.h"
#include "channelmanager.h"
#include "client.h"
#include "commandhandler.h"
#include "configuration.h"
+#include "dropshortcut.h"
#include "effectmanager.h"
-#include "event.h"
-#include "spellmanager.h"
#include "emoteshortcut.h"
+#include "event.h"
+#include "guildmanager.h"
#include "graphics.h"
#include "itemshortcut.h"
-#include "dropshortcut.h"
-#include "spellshortcut.h"
#include "joystick.h"
#include "keyboardconfig.h"
#include "localplayer.h"
@@ -47,6 +47,8 @@
#include "particle.h"
#include "playerrelations.h"
#include "sound.h"
+#include "spellmanager.h"
+#include "spellshortcut.h"
#include "gui/botcheckerwindow.h"
#include "gui/buyselldialog.h"
@@ -156,6 +158,8 @@ Particle *particleEngine = NULL;
EffectManager *effectManager = NULL;
SpellManager *spellManager = NULL;
Viewport *viewport = NULL; /**< Viewport on the map. */
+GuildManager *guildManager = NULL;
+AuctionManager *auctionManager = NULL;
ChatTab *localChatTab = NULL;
ChatTab *debugChatTab = NULL;
@@ -175,6 +179,8 @@ static void initEngines()
commandHandler = new CommandHandler;
channelManager = new ChannelManager;
effectManager = new EffectManager;
+ AuctionManager::init();
+ GuildManager::init();
particleEngine = new Particle(NULL);
particleEngine->setupEngine();
@@ -295,6 +301,12 @@ static void destroyGuiWindows()
if (whoIsOnline)
whoIsOnline->setAllowUpdate(false);
+ if (auctionManager)
+ auctionManager->clear();
+
+ if (guildManager)
+ guildManager->clear();
+
del_0(windowMenu);
del_0(localChatTab) // Need to do this first, so it can remove itself
del_0(debugChatTab)
@@ -327,6 +339,12 @@ static void destroyGuiWindows()
del_0(didYouKnowWindow);
Mana::Event::trigger(CHANNEL_GAME, Mana::Event(EVENT_GUIWINDOWSUNLOADED));
+
+ if (auctionManager && AuctionManager::getEnableAuctionBot())
+ auctionManager->reload();
+
+ if (guildManager && GuildManager::getEnableGuildBot())
+ guildManager->reload();
}
Game *Game::mInstance = 0;
@@ -393,6 +411,9 @@ Game::Game():
setupWindow->setInGame(true);
clearKeysArray();
+ if (guildManager && GuildManager::getEnableGuildBot())
+ guildManager->requestGuildInfo();
+
Mana::Event::trigger(CHANNEL_GAME, Mana::Event(EVENT_CONSTRUCTED));
}
@@ -413,14 +434,16 @@ Game::~Game()
del_0(player_node)
del_0(channelManager)
del_0(commandHandler)
- del_0(effectManager);
+ del_0(effectManager)
del_0(joystick)
del_0(particleEngine)
del_0(viewport)
del_0(mCurrentMap)
- del_0(spellManager);
- del_0(spellShortcut);
- del_0(mumbleManager);
+ del_0(spellManager)
+ del_0(spellShortcut)
+ del_0(auctionManager)
+ del_0(guildManager)
+ del_0(mumbleManager)
Being::clearCache();