I need help fixing some bugs :(

Posted by Lloyd graham on Tue 12 Oct 2004 02:29 AM — 3 posts, 13,818 views.

Canada #0
I am having two problems both of which i need addressed.
I am using 1st mud4.5.3 but one of the problems I am having is that when building and in the desc of Redit mode. when in the buffer any time you put in a string it acts as if you are trying to put in a command the writing still goes to the desc but my builders don’t like it. I checked at the place where I got the code but I couldn’t understand exactly what to do. i was told to put brackets nder the else and on the substitute_alias but i dont know what type of brackets or how to put them


else
crash_info.status = (CRASH_LIKELY);
strcpy(crash_info.logline, d->incomm);
crash_info.desc = d;
switch (d->connected)
{
case CON_PLAYING:
substitute_alias(d, d->incomm);
break;
default:
nanny(d, d->incomm);
break;
}

The other problem is that when people kill any thing I get a error that crashes the mud every time I have no clue what is causing this or how to fix it any help will be appreciated the errors are

---CRASH INFORMATION---
Signal 11 (Segmentation fault)
Log: kill cit
Details: It is VERY likely that this command caused the crash.

and

---CRASH INFORMATION---
Signal 11 (Segmentation fault)
Log: pulse_violence
Details: This crash occured while updating the above.


sincirly

Layal
Amended on Tue 12 Oct 2004 02:56 AM by Lloyd graham
Australia Forum Administrator #1
If you are not sure what kind of brackets to put under an else, or how to put them there, I suggest you need some practice writing simpler C programs than a MUD server.

It is like trying to make a 3-course meal when you aren't sure how to turn the oven on. Start simple, do some examples from "learn to program in C" books, and it will come to you.

You can find out what causes crashes, to an extent, by using gdb. I have done a lengthy write-up on using it which is available on this forum.

To get you started, the brackets they are talking about are these brackets:


else
  {
  // blah blah, do something here
  }



Canada #2
than you that is much apreceated and i will get myself a book on c and read trou it thanx.