Re: Loading and Extracting

From: Daniel Koepke (dkoepke@california.com)
Date: 12/02/96


On Mon, 2 Dec 1996, Ron Hensley wrote:

> Hello,
> 
> Okay on a few occasions ive run across situations where i know the vnum of
> a mob for instance. And I need to process the mob for a bit, then im done
> with it. At no time is it loaded into a room. So ive tried something like:
> 
> Has anyone run into this situation and have a pointer how to load
> something up, obj or char, process it as a normal obj/char, then delete it
> without blowing things up.

A quick examination of extract_char() shows these lines:

  if (ch->in_room == NOWHERE) {
    log("SYSERR: NOWHERE extracting char. (handler.c, extract_char)");
    exit(1);
  }

And below that:
  char_from_room(ch);

Obviously, since your mobile isn't a room, they can't be char_from_room()
'ed the thing that is weird is it's not caught by the first if block...
Have you changed your extract_char() any?

Anyway, something tells me that you don't even need to call
extract_char().  In extract_char() there is this block:

  if (GET_MOB_RNUM(ch) > -1)
    mob_index[GET_MOB_RNUM(ch)].number--;
  clearMemory(ch);
  free_char(ch);

So you can easily use that instead of extract_char().  Also, if you're
getting a core dump and you have a debugger (eg., gdb) please post the
output from the 'backtrace' (bt) in the debugger, as this often shows
where the code crashed.  Furthermore, post the relevant code for the
highest ones on the stack (provided there is code, of course).  This will
definetly help us see the problems, provided you don't see them first.
If you don't know how to use 'gdb', uh, consult your man pages, the gdb
man page is surprisingly well written and not too confusing (uh, for
being a man page, that is), although it doesn't cover all the bases in
enough detail, IMHO.

Godspeed,


--
Daniel Koepke
dkoepke@california.com
Forgive me father, for I am sin.


+-----------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
|   http://cspo.queensu.ca/~fletcher/Circle/list_faq.html   |
+-----------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/18/00 PST