Yes I am still having the game crash and it still wants to point to this ch if (ch->player_specials)
free(ch->player_specials);
I recently tried redefining the IS_UNDEAD(CH) in utils.h to add a check for AFF_FLAG Undead. The idea was that it would let us equip items that provided an undead affect while still keeping the player's base race. I am not sure if this is the root cause because the game crashes on occasion like most games do but it seems to be way more frequent lately:
#define IS_UNDEAD(ch) ((GET_RACE(ch) == RACE_UNDEAD) || AFF_FLAGGED(ch, AFF_UNDEAD) || (GET_RACE(ch) == RACE_VAMPIRE)|| (GET_RACE(ch) == RACE_SKELETON))
I went ahead and reverted it back to its original define for now and booted the game back up in gdb mode to keep an eye on it.
here is what I have for comm.c
Code:
void close_socket(struct descriptor_data *d)
{
struct descriptor_data *temp;
REMOVE_FROM_LIST(d, descriptor_list, next);
if (0 != d->descriptor) {
CLOSE_SOCKET(d->descriptor);
}
flush_queues(d);
/* Forget snooping */
if (d->snooping)
d->snooping->snoop_by = NULL;
if (d->snoop_by) {
write_to_output(d->snoop_by, "Your victim is no longer among us.\r\n");
d->snoop_by->snooping = NULL;
}
if (d->character) {
/* If we're switched, this resets the mobile taken. */
d->character->desc = NULL;
/* Plug memory leak, from Eric Green. */
if (!IS_NPC(d->character) && PLR_FLAGGED(d->character, PLR_MAILING) && d->str) {
if (*(d->str))
free(*(d->str));
free(d->str);
d->str = NULL;
} else if (d->backstr && !IS_NPC(d->character) && !PLR_FLAGGED(d->character, PLR_WRITING)) {
free(d->backstr); /* editing description ... not olc */
d->backstr = NULL;
}
if (IS_PLAYING(d) || STATE(d) == CON_DISCONNECT) {
struct char_data *link_challenged = d->original ? d->original : d->character;
/* We are guaranteed to have a person. */
act("$n has lost $s link.", TRUE, link_challenged, 0, 0, TO_ROOM);
save_char(link_challenged);
mudlog(NRM, MAX(LVL_IMMORT, GET_INVIS_LEV(link_challenged)), TRUE, "Closing link to: %s.",
GET_NAME(link_challenged));
} else {
/* mudlog(CMP, LVL_IMMORT, TRUE, "Losing player: %s.", GET_NAME(d->character) ? GET_NAME(d->character) :
* "<null>"); */
free_char(d->character);
}
} else
mudlog(CMP, LVL_IMMORT, TRUE, "Losing descriptor without char.");
/* JE 2/22/95 -- part of my unending quest to make switch stable */
if (d->original && d->original->desc)
d->original->desc = NULL;
/* Clear the command history. */
if (d->history) {
for (int cnt = 0; cnt < HISTORY_SIZE; cnt++)
if (d->history[cnt])
free(d->history[cnt]);
free(d->history);
}
if (d->showstr_head)
free(d->showstr_head);
if (d->showstr_count)
free(d->showstr_vector);