From: DaveG <da...@us...> - 2006-04-05 09:52:12
|
Update of /cvsroot/planeshift/planeshift/src/server In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20398/src/server Modified Files: chatmanager.cpp Log Message: fixing crash on /say Index: chatmanager.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/server/chatmanager.cpp,v retrieving revision 1.154 retrieving revision 1.155 diff -C2 -d -r1.154 -r1.155 *** chatmanager.cpp 5 Apr 2006 02:13:59 -0000 1.154 --- chatmanager.cpp 5 Apr 2006 09:52:06 -0000 1.155 *************** *** 146,156 **** case CHAT_SAY: { - // send message to other players only if the NPC is not answering NpcResponse *resp = CheckNPCResponse(msg,client); ! if (resp->HasPublicResponse()) { SendSay(client, msg, client->GetName()); - resp->ExecuteScript(client, (gemNPC *)client->GetTargetObject()); - saveFlood = false; } else --- 146,154 ---- case CHAT_SAY: { NpcResponse *resp = CheckNPCResponse(msg,client); ! if (!resp || resp->HasPublicResponse()) { + // Send to all if there's no NPC response or the response is public SendSay(client, msg, client->GetName()); } else *************** *** 158,167 **** // Only the speaker sees his successful chatting with an npc. // This helps quests stay secret. ! psChatMessage newMsg(client->GetClientNum(), client->GetName(), msg.sText, msg.iChatType, msg.translate); newMsg.SendMessage(); - resp->ExecuteScript(client, (gemNPC *)client->GetTargetObject()); saveFlood = false; } client->GetActor()->LogMessage("chat: ", msg.sText); break; --- 156,168 ---- // Only the speaker sees his successful chatting with an npc. // This helps quests stay secret. ! psChatMessage newMsg(client->GetClientNum(), client->GetName(), msg.sText, msg.iChatType, msg.translate); newMsg.SendMessage(); saveFlood = false; } + + if (resp) + resp->ExecuteScript(client, (gemNPC *)client->GetTargetObject()); + client->GetActor()->LogMessage("chat: ", msg.sText); break; |