I downloaded a snippet to allow mudwide socials, and it worked fine except for the ignore part since it called for next_in_room which obviously didn't reognize players in other rooms so skipped by the check to see if they were ignored. I changed it to use is_ignore(ch, victim), which somehow made it have a segmentation fault if the victim doesn't exist. What would be a good method for debugging it to see what caused the crash?
-Jay
Well, it would crash if you pass a null pointer. Make sure 'victim' points to a valid player.
I realized this, and fixed it and now have it working. Is there anywhere I can set that if victim is a null pointer it will send a bug message instead of crashing? Also I noticed it gives a warning that victim might be uninitialized, while I know most people aren't picky about warning, I try removing them since I assume they mean it is possible it can mess things up, but I am not sure what this error message means. I was thinking maybe because it doesn't necessarily require there to be a victim since you can just send a social to the room you are in, could this be it?
Thanks,
-Jay
I would have to look at the code to comment in detail, but it sounds like you are not setting victim up.
You can test victim like this:
if (victim != NULL)
blah blah
However if the compiler is warning you that it is unitialised, then it may well be non-zero but still rubbish.