I'm having this odd problem, and I'm not totally sure how it's not working.
With our Druid class, we have the ability for them to summon familiars.
There is a Hawk, A Dire wolf, A Bear, and a tree ent. My problem lies when
one of these summoned mobs die. Problem is it goes through extract_char and
towards then end, it loops through the char_list to locate the mobs location
in the list so it can remove it. Well it's not finding it in the list cause
it keeps bug reporting:
[*****] BUG: Extract_char: char not found.
First I went into GDB and made sure it was just these summoned mobs that was
causing it. Then I went to the function where these mobs are created. We use
create_mobile to create the mob. And in there at the end it adds the said
mob to the char_list. Pretty standard and normal, now stepping though with
gdb I made sure that the mob was the first pointer of the char_list and it
is. I even added a small thing after that call:
pet = create_mobile( pMobIndex );
if (pet != char_list)
{
pet->next = char_list;
char_list = pet;
}
To insure that it was being added. But I'll still plagued with this problem.
I don't have this problem, with the necromancers and there skeletons, or
golems. And they use create_mobile just fine. Does anyone know why these
mobs would be leaving the char_list before extract_char? I've also cause I'm
trying to track down another odd memory problem taken out my -O in my make
cause it tends to forget lines that sometimes are needed. I'm only worried
about this, cause it's causing all these floating char pointers. Cause once
it bug reports it returns, it's not calling free_char. And I don't want to
make to still do the free_char. Cause it should be in that list, and hacking
it to free it isn't the greatest of ideas (in my eyes anyways). So any help
or comments, are greatly appreciated. Thanks in advance!