Hi Thomas,
For some reason I am still continuing to have issues with the game crashing
I dug deeper into GDB but I still can't make heads or tails of what the actual issue is.
It continues to act like there is an error in db.c specifically with the free_char
The attached screenshot seems to reference a character that doesn't exist in a room that also does not exist in the game.
You mentioned making the specials = NULL?
So should I just remove the if check and replace it with that?
Code:
/* release memory allocated for a char struct */
void free_char(struct char_data *ch)
{
int i;
struct alias_data *a;
if (ch->player_specials != NULL && ch->player_specials != &dummy_mob) {
while ((a = GET_ALIASES(ch)) != NULL) {
GET_ALIASES(ch) = (GET_ALIASES(ch))->next;
free_alias(a);
}
if (ch->player_specials->poofin)
free(ch->player_specials->poofin);
if (ch->player_specials->poofout)
free(ch->player_specials->poofout);
if (ch->player_specials->saved.completed_quests)
free(ch->player_specials->saved.completed_quests);
if (GET_HOST(ch))
free(GET_HOST(ch));
if (IS_NPC(ch))
log("SYSERR: Mob %s (#%d) had player_specials allocated!", GET_NAME(ch), GET_MOB_VNUM(ch));
}
if (!IS_NPC(ch) || (IS_NPC(ch) && GET_MOB_RNUM(ch) == NOBODY)) {
/* if this is a player, or a non-prototyped non-player, free all */
if (GET_NAME(ch))
free(GET_NAME(ch));
if (ch->player.title)
free(ch->player.title);
if (ch->player.short_descr)
free(ch->player.short_descr);
if (ch->player.long_descr)
free(ch->player.long_descr);
if (ch->player.description)
free(ch->player.description);
if (ch->player_specials)
free(ch->player_specials);
/* free script proto list */
free_proto_script(ch, MOB_TRIGGER);
} else if ((i = GET_MOB_RNUM(ch)) != NOBODY) {
/* otherwise, free strings only if the string is not pointing at proto */
if (ch->player.name && ch->player.name != mob_proto[i].player.name)
free(ch->player.name);
if (ch->player.title && ch->player.title != mob_proto[i].player.title)
free(ch->player.title);
if (ch->player.short_descr && ch->player.short_descr != mob_proto[i].player.short_descr)
free(ch->player.short_descr);
if (ch->player.long_descr && ch->player.long_descr != mob_proto[i].player.long_descr)
free(ch->player.long_descr);
if (ch->player.description && ch->player.description != mob_proto[i].player.description)
free(ch->player.description);
/* free script proto list if it's not the prototype */
if (ch->proto_script && ch->proto_script != mob_proto[i].proto_script)
free_proto_script(ch, MOB_TRIGGER);
}
while (ch->affected)
affect_remove(ch, ch->affected);
/* free any assigned scripts */
if (SCRIPT(ch))
extract_script(ch, MOB_TRIGGER);
/* new version of free_followers take the followers pointer as arg */
free_followers(ch->followers);
if (ch->desc)
ch->desc->character = NULL;
/* find_char helper */
/*
* when free_char is called with a blank character struct, ID is set
* to 0, and has not yet been added to the lookup table.
*/
if (GET_ID(ch) != 0)
remove_from_lookup_table(GET_ID(ch));
free(ch);
}