[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  SMAUG
. -> [Folder]  SMAUG coding
. . -> [Subject]  Mud Wide Socials
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Mud Wide Socials

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Neves   USA  (78 posts)  [Biography] 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
[Go to top] top

Posted by Nick Gammon   Australia  (21,392 posts)  [Biography] 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
[Go to top] top

Posted by Neves   USA  (78 posts)  [Biography] 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
[Go to top] top

Posted by Nick Gammon   Australia  (21,392 posts)  [Biography] 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
[Go to top] 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.


4,232 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]