PlaneShift
Support => Technical Help: IN GAME bugs (after loading world) => Topic started by: Bereror on December 04, 2005, 06:01:35 pm
-
As the subject says, client crashes when trying to cure Gorbiak with a segmentation fault error.
It happens when executing the following line in chatwindow.cpp:
case CHAT_SERVER_TELL:
// allows /tell /me sits down for a private action
[COLOR=red]if (!strncmp(msg.sText,\"/me \",4))[/COLOR]
cs_snprintf(buff,1024,\"%s %s\",(const char *)msg.sPerson,((const char *)msg.sText)+4);
else if (!strncmp(msg.sText,\"/my \",4))
And here are the msg object fields right before the crash:
$1 = { = {_vptr.psMessageCracker = 0x8395420,
static msghandler = 0x85c3cd8, msg = 0x0, valid = false}, iChatType = 13,
sPerson = {> = {<> = {},
minibuff = \"Gorbiak\\000\\000\\000\\000\\000\\000\\000\\200?\", \'\\0\' , \"\\200?žME\\b\", miniused = 8}, },
sText = {> = {<> = {},
minibuff = \"?7??\\220:??/9????;??\\a\\030\\v\\b:??\\220:????;?\\000\\000\\000\",
miniused = 0}, }, translate = false}
-
Is the NPC trying to do a /me?
-
Gorbiak is trying to tell us something when we offer him the cure potion, but he fails terribly (msg.sText returns NULL).
With some effort I survived whatever Gorbiak was trying to tell me, but the cure potion was still wrong and he didn\'t want it.
-
Ok, msg.sText is a csString, so I\'m switching those checks to StartsWith() which internally checks for NULLs. That should prevent the client from crashing, but there may also be a bug server-side.
-
Bereror, I get even problems loading the quest in my server and when I do it, it simply crashes at startup.
I really think there is something wrong with the quest itself and not the code. Despite that some \"check for null\" in the messages would have been more than enough.