Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ SMAUG
➜ SMAUG coding
➜ Mud Wide Socials
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Neves
USA (78 posts) Bio
|
Date
| Tue 14 May 2002 05:18 AM (UTC) |
Message
| 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 | Top |
|
Posted by
| Nick Gammon
Australia (23,158 posts) Bio
Forum Administrator |
Date
| Reply #1 on Wed 15 May 2002 03:23 AM (UTC) |
Message
| Well, it would crash if you pass a null pointer. Make sure 'victim' points to a valid player. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Neves
USA (78 posts) Bio
|
Date
| Reply #2 on Wed 15 May 2002 03:46 AM (UTC) |
Message
| 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 | Top |
|
Posted by
| Nick Gammon
Australia (23,158 posts) Bio
Forum Administrator |
Date
| Reply #3 on Wed 15 May 2002 04:54 AM (UTC) |
Message
| 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. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
14,915 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top