summaryrefslogtreecommitdiff
path: root/src/net/ea
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-03-07 17:46:31 +0300
committerAndrei Karas <akaras@inbox.ru>2013-03-07 17:46:31 +0300
commita80e10b7ba9771dca3fcddb3f0182a5aa1825226 (patch)
tree85f7ad40f3bc0d030e2dab57cb2af65dfa04cf33 /src/net/ea
parentf8fcfcfef1e5a8cbda66328664f41b3f9aa2a773 (diff)
downloadmanaplus-a80e10b7ba9771dca3fcddb3f0182a5aa1825226.tar.gz
manaplus-a80e10b7ba9771dca3fcddb3f0182a5aa1825226.tar.bz2
manaplus-a80e10b7ba9771dca3fcddb3f0182a5aa1825226.tar.xz
manaplus-a80e10b7ba9771dca3fcddb3f0182a5aa1825226.zip
Fix server switch incorrect map loading.
Diffstat (limited to 'src/net/ea')
-rw-r--r--src/net/ea/gamehandler.cpp8
-rw-r--r--src/net/ea/gamehandler.h2
2 files changed, 9 insertions, 1 deletions
diff --git a/src/net/ea/gamehandler.cpp b/src/net/ea/gamehandler.cpp
index 3e9e36541..eaed1ec5d 100644
--- a/src/net/ea/gamehandler.cpp
+++ b/src/net/ea/gamehandler.cpp
@@ -48,7 +48,7 @@ void GameHandler::processEvent(Channels channel,
{
if (event.getName() == EVENT_ENGINESINITALIZED)
{
- if (mMap != "")
+ if (!mMap.empty())
Game::instance()->changeMap(mMap);
}
else if (event.getName() == EVENT_MAPLOADED)
@@ -99,4 +99,10 @@ void GameHandler::processMapQuitResponse(Net::MessageIn &msg)
new OkDialog(_("Game"), _("Request to quit denied!"), DIALOG_ERROR);
}
+void GameHandler::clear()
+{
+ mMap.clear();
+ mCharID = 0;
+}
+
} // namespace Ea
diff --git a/src/net/ea/gamehandler.h b/src/net/ea/gamehandler.h
index 93773e33d..c0b4286ce 100644
--- a/src/net/ea/gamehandler.h
+++ b/src/net/ea/gamehandler.h
@@ -62,6 +62,8 @@ class GameHandler : public Net::GameHandler, public Listener
virtual void processMapQuitResponse(Net::MessageIn &msg);
+ virtual void clear();
+
protected:
std::string mMap;
int mCharID; /// < Saved for map-server switching