summaryrefslogtreecommitdiff
path: root/src/net/eathena/chathandler.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-03-01 21:39:46 +0300
committerAndrei Karas <akaras@inbox.ru>2015-03-01 21:39:46 +0300
commit1911170833f19d8639adc27772aa5246d7438b6f (patch)
tree1eef1f94b34bae09790e8b858af8c27881ef64ce /src/net/eathena/chathandler.cpp
parent7a79a5fb19b07fe29112d28b8d74924e68aa007e (diff)
downloadplus-1911170833f19d8639adc27772aa5246d7438b6f.tar.gz
plus-1911170833f19d8639adc27772aa5246d7438b6f.tar.bz2
plus-1911170833f19d8639adc27772aa5246d7438b6f.tar.xz
plus-1911170833f19d8639adc27772aa5246d7438b6f.zip
eathena: show chat messages from hidden players.
Diffstat (limited to 'src/net/eathena/chathandler.cpp')
-rw-r--r--src/net/eathena/chathandler.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/net/eathena/chathandler.cpp b/src/net/eathena/chathandler.cpp
index aaad26fda..df9425b7e 100644
--- a/src/net/eathena/chathandler.cpp
+++ b/src/net/eathena/chathandler.cpp
@@ -691,11 +691,6 @@ void ChatHandler::processBeingChat(Net::MessageIn &msg)
BLOCK_START("ChatHandler::processBeingChat")
int chatMsgLength = msg.readInt16("len") - 8;
Being *const being = actorManager->findBeing(msg.readInt32("being id"));
- if (!being)
- {
- BLOCK_END("ChatHandler::processBeingChat")
- return;
- }
if (chatMsgLength <= 0)
{
@@ -705,14 +700,14 @@ void ChatHandler::processBeingChat(Net::MessageIn &msg)
std::string chatMsg = msg.readRawString(chatMsgLength, "message");
- if (being->getType() == ActorType::Player)
+ if (being && being->getType() == ActorType::Player)
being->setTalkTime();
const size_t pos = chatMsg.find(" : ", 0);
std::string sender_name = ((pos == std::string::npos)
? "" : chatMsg.substr(0, pos));
- if (sender_name != being->getName()
+ if (being && sender_name != being->getName()
&& being->getType() == ActorType::Player)
{
if (!being->getName().empty())
@@ -737,7 +732,7 @@ void ChatHandler::processBeingChat(Net::MessageIn &msg)
ChatMsgType::BY_OTHER, GENERAL_CHANNEL, false, true);
}
- if (allow && player_relations.hasPermission(sender_name,
+ if (allow && being && player_relations.hasPermission(sender_name,
PlayerRelation::SPEECH_FLOAT))
{
being->setSpeech(chatMsg, GENERAL_CHANNEL);