diff options
author | Jared Adams <jaxad0127@gmail.com> | 2010-08-04 20:38:04 -0600 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2010-08-04 21:00:29 -0600 |
commit | 154ea41225505eee0c77652a04738d845a2e93cd (patch) | |
tree | 295b39f2881d85c26b51d7187cd4c8aab51de53e /src/net/tmwa/chathandler.cpp | |
parent | 7773f04b4beb1a24214fe1a367b645a689d2c852 (diff) | |
download | mana-154ea41225505eee0c77652a04738d845a2e93cd.tar.gz mana-154ea41225505eee0c77652a04738d845a2e93cd.tar.bz2 mana-154ea41225505eee0c77652a04738d845a2e93cd.tar.xz mana-154ea41225505eee0c77652a04738d845a2e93cd.zip |
Remove some unused headers and fix some chat events
Reviewed-by: Chuck Miller
Diffstat (limited to 'src/net/tmwa/chathandler.cpp')
-rw-r--r-- | src/net/tmwa/chathandler.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/net/tmwa/chathandler.cpp b/src/net/tmwa/chathandler.cpp index 55259624..b3400528 100644 --- a/src/net/tmwa/chathandler.cpp +++ b/src/net/tmwa/chathandler.cpp @@ -189,19 +189,24 @@ void ChatHandler::handleMessage(Net::MessageIn &msg) break; chatMsg = msg.readString(chatMsgLength); - std::string::size_type pos = chatMsg.find(" : ", 0); if (msg.getId() == SMSG_PLAYER_CHAT) { - Mana::Event event("Player"); - event.setString("message", chatMsg); - Mana::EventManager::trigger("Chat", event); + std::string::size_type pos = chatMsg.find(" : ", 0); + std::string mes = chatMsg; if (pos != std::string::npos) chatMsg.erase(0, pos + 3); trim(chatMsg); + Mana::Event event("Player"); + event.setString("message", mes); + event.setString("text", chatMsg); + event.setString("nick", player_node->getName()); + event.setInt("beingId", player_node->getId()); + Mana::EventManager::trigger("Chat", event); + player_node->setSpeech(chatMsg, SPEECH_TIME); } else |