diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-11-13 04:57:16 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-11-13 04:57:16 +0300 |
commit | 4d453108f45f9fb2ff4f5715cc1b3ddd63d36a80 (patch) | |
tree | c1edb8d8b368fdd43cd8639e6044b0f4e8dde70a /src/net/tmwa | |
parent | ece00592ecd93f7a96db0ca82589d00846e2f938 (diff) | |
parent | d471e99fd38ac589a8a9e8e8677b9f577f0cc5c6 (diff) | |
download | manaverse-4d453108f45f9fb2ff4f5715cc1b3ddd63d36a80.tar.gz manaverse-4d453108f45f9fb2ff4f5715cc1b3ddd63d36a80.tar.bz2 manaverse-4d453108f45f9fb2ff4f5715cc1b3ddd63d36a80.tar.xz manaverse-4d453108f45f9fb2ff4f5715cc1b3ddd63d36a80.zip |
Merge branch 'master' into strippedstripped1.1.11.12
Conflicts:
data/fonts/mplus-1p-bold.ttf
data/fonts/mplus-1p-regular.ttf
src/guichan/basiccontainer.cpp
src/guichan/focushandler.cpp
src/guichan/graphics.cpp
src/guichan/gui.cpp
src/guichan/image.cpp
src/guichan/include/guichan/widgets/checkbox.hpp
src/guichan/include/guichan/widgets/dropdown.hpp
src/guichan/sdl/sdlgraphics.cpp
src/guichan/sdl/sdlimage.cpp
src/guichan/widget.cpp
src/guichan/widgets/dropdown.cpp
src/guichan/widgets/icon.cpp
src/guichan/widgets/imagebutton.cpp
src/guichan/widgets/listbox.cpp
src/guichan/widgets/scrollarea.cpp
src/guichan/widgets/tab.cpp
src/guichan/widgets/tabbedarea.cpp
src/guichan/widgets/textbox.cpp
src/guichan/widgets/window.cpp
Diffstat (limited to 'src/net/tmwa')
-rw-r--r-- | src/net/tmwa/charserverhandler.cpp | 6 | ||||
-rw-r--r-- | src/net/tmwa/chathandler.cpp | 2 | ||||
-rw-r--r-- | src/net/tmwa/generalhandler.cpp | 6 | ||||
-rw-r--r-- | src/net/tmwa/messagehandler.cpp | 2 | ||||
-rw-r--r-- | src/net/tmwa/network.cpp | 23 | ||||
-rw-r--r-- | src/net/tmwa/npchandler.cpp | 6 |
6 files changed, 24 insertions, 21 deletions
diff --git a/src/net/tmwa/charserverhandler.cpp b/src/net/tmwa/charserverhandler.cpp index 03b63aa16..69f7165ec 100644 --- a/src/net/tmwa/charserverhandler.cpp +++ b/src/net/tmwa/charserverhandler.cpp @@ -123,7 +123,7 @@ void CharServerHandler::handleMessage(Net::MessageIn &msg) player_node = mSelectedCharacter->dummy; PlayerInfo::setBackend(mSelectedCharacter->data); - mSelectedCharacter->dummy = 0; + mSelectedCharacter->dummy = nullptr; delete_all(mCharacters); mCharacters.clear(); @@ -151,7 +151,7 @@ void CharServerHandler::handleMessage(Net::MessageIn &msg) if (player_node) { player_node->setTileCoords(x, y); - player_node->setMap(0); + player_node->setMap(nullptr); } } break; @@ -271,7 +271,7 @@ void CharServerHandler::chooseCharacter(Net::Character *character) return; mSelectedCharacter = character; - mCharSelectDialog = 0; + mCharSelectDialog = nullptr; MessageOut outMsg(CMSG_CHAR_SELECT); outMsg.writeInt8(static_cast<unsigned char>(mSelectedCharacter->slot)); diff --git a/src/net/tmwa/chathandler.cpp b/src/net/tmwa/chathandler.cpp index fe6592d93..5af248e5c 100644 --- a/src/net/tmwa/chathandler.cpp +++ b/src/net/tmwa/chathandler.cpp @@ -145,7 +145,7 @@ void ChatHandler::sendRaw(const std::string &args) { std::string line = args; std::string str; - MessageOut *outMsg = 0; + MessageOut *outMsg = nullptr; if (line == "") return; diff --git a/src/net/tmwa/generalhandler.cpp b/src/net/tmwa/generalhandler.cpp index 0a9541477..293986bde 100644 --- a/src/net/tmwa/generalhandler.cpp +++ b/src/net/tmwa/generalhandler.cpp @@ -120,7 +120,7 @@ GeneralHandler::GeneralHandler(): GeneralHandler::~GeneralHandler() { delete mNetwork; - mNetwork = 0; + mNetwork = nullptr; } void GeneralHandler::handleMessage(Net::MessageIn &msg) @@ -294,10 +294,10 @@ void GeneralHandler::processEvent(Mana::Channels channel, } delete Ea::guildTab; - Ea::guildTab = 0; + Ea::guildTab = nullptr; delete Ea::partyTab; - Ea::partyTab = 0; + Ea::partyTab = nullptr; } } } diff --git a/src/net/tmwa/messagehandler.cpp b/src/net/tmwa/messagehandler.cpp index 843339718..830b3bc4f 100644 --- a/src/net/tmwa/messagehandler.cpp +++ b/src/net/tmwa/messagehandler.cpp @@ -32,7 +32,7 @@ namespace TmwAthena { MessageHandler::MessageHandler() - : mNetwork(NULL) + : mNetwork(nullptr) { } diff --git a/src/net/tmwa/network.cpp b/src/net/tmwa/network.cpp index e26f48324..3181ec898 100644 --- a/src/net/tmwa/network.cpp +++ b/src/net/tmwa/network.cpp @@ -104,16 +104,17 @@ int networkThread(void *data) return 0; } -Network *Network::mInstance = 0; +Network *Network::mInstance = nullptr; Network::Network() : - mSocket(0), + mSocket(nullptr), mInBuffer(new char[BUFFER_SIZE]), mOutBuffer(new char[BUFFER_SIZE]), - mInSize(0), mOutSize(0), + mInSize(0), + mOutSize(0), mToSkip(0), mState(IDLE), - mWorkerThread(0) + mWorkerThread(nullptr) { SDLNet_Init(); @@ -129,8 +130,8 @@ Network::~Network() disconnect(); SDL_DestroyMutex(mMutex); - mMutex = 0; - mInstance = 0; + mMutex = nullptr; + mInstance = nullptr; delete[] mInBuffer; delete[] mOutBuffer; @@ -181,15 +182,15 @@ void Network::disconnect() if (mWorkerThread && SDL_GetThreadID(mWorkerThread)) { - SDL_WaitThread(mWorkerThread, NULL); - mWorkerThread = NULL; + SDL_WaitThread(mWorkerThread, nullptr); + mWorkerThread = nullptr; } if (mSocket) { // need call SDLNet_TCP_DelSocket? SDLNet_TCP_Close(mSocket); - mSocket = 0; + mSocket = nullptr; } } @@ -212,7 +213,7 @@ void Network::unregisterHandler(MessageHandler *handler) for (const Uint16 *i = handler->handledMessages; *i; ++i) mMessageHandlers.erase(*i); - handler->setNetwork(0); + handler->setNetwork(nullptr); } void Network::clearHandlers() @@ -221,7 +222,7 @@ void Network::clearHandlers() for (i = mMessageHandlers.begin(); i != mMessageHandlers.end(); ++i) { if (i->second) - i->second->setNetwork(0); + i->second->setNetwork(nullptr); } mMessageHandlers.clear(); } diff --git a/src/net/tmwa/npchandler.cpp b/src/net/tmwa/npchandler.cpp index f80dd6e69..6b6ffcbb6 100644 --- a/src/net/tmwa/npchandler.cpp +++ b/src/net/tmwa/npchandler.cpp @@ -92,7 +92,7 @@ void NpcHandler::handleMessage(Net::MessageIn &msg) break; } - mDialog = 0; + mDialog = nullptr; } void NpcHandler::talk(int npcId) @@ -195,7 +195,7 @@ int NpcHandler::getNpc(Net::MessageIn &msg, bool haveLength) const int npcId = msg.readInt32(); NpcDialogs::const_iterator diag = mNpcDialogs.find(npcId); - mDialog = 0; + mDialog = nullptr; if (diag == mNpcDialogs.end()) { @@ -213,6 +213,8 @@ int NpcHandler::getNpc(Net::MessageIn &msg, bool haveLength) else { mDialog = new NpcDialog(npcId); + if (player_node) + player_node->stopWalking(false); Wrapper wrap; wrap.dialog = mDialog; mNpcDialogs[npcId] = wrap; |