The entire function:
void extract_char(Creature ch) { void display_statistics_to_char(Creature ch); Creature k, temp; Descr t_desc; Object obj; int i, freed = 0; perform_dismount(ch); if (GET_FED_ON_BY(ch)) { GET_FEEDING_FROM(GET_FED_ON_BY(ch)) = NULL; GET_FED_ON_BY(ch) = NULL; } if (GET_FEEDING_FROM(ch)) { GET_FED_ON_BY(GET_FEEDING_FROM(ch)) = NULL; GET_FEEDING_FROM(ch) = NULL; } if (GET_LEADING(ch)) { GET_LED_BY(GET_LEADING(ch)) = NULL; GET_LEADING(ch) = NULL; } if (GET_LED_BY(ch)) { GET_LEADING(GET_LED_BY(ch)) = NULL; GET_LED_BY(ch) = NULL; } if (GET_PULLING(ch)) { if (GET_PULLED_BY(GET_PULLING(ch), 0) == ch) GET_PULLED_BY(GET_PULLING(ch), 0) = NULL; if (GET_PULLED_BY(GET_PULLING(ch), 1) == ch) GET_PULLED_BY(GET_PULLING(ch), 1) = NULL; GET_PULLING(ch) = NULL; } if (!IS_NPC(ch) && !ch->desc) { for (t_desc = descriptor_list; t_desc; t_desc = t_desc->next) if (t_desc->original == ch) do_return(t_desc->character, NULL, 0, 0); } if (ch->in_room == NOWHERE) { log("SYSERR: NOWHERE extracting char %s. (%s, extract_char)", GET_NAME(ch), __FILE__); exit(1); } if (ch->followers || ch->master) die_follower(ch); /* Forget snooping, if applicable */ if (ch->desc) { if (ch->desc->snooping) { ch->desc->snooping->snoop_by = NULL; ch->desc->snooping = NULL; } if (ch->desc->snoop_by) { SEND_TO_Q("Your victim is no longer among us.\r\n", ch->desc->snoop_by); ch->desc->snoop_by->snooping = NULL; ch->desc->snoop_by = NULL; } } /* transfer objects to room, if any */ while (ch->carrying) { obj = ch->carrying; obj_from_char(obj); obj_to_room(obj, ch->in_room); } /* transfer equipment to room, if any */ for (i = 0; i < NUM_WEARS; i++) if (GET_EQ(ch, i)) obj_to_room(unequip_char(ch, i), ch->in_room); if (FIGHTING(ch)) stop_fighting(ch); for (k = combat_list; k; k = temp) { temp = k->next_fighting; if (FIGHTING(k) == ch) stop_fighting(k); } char_from_room(ch); /* pull the char from the list */ REMOVE_FROM_LIST(ch, character_list, next); if (ch->desc && ch->desc->original) do_return(ch, NULL, 0, 0); if (!IS_NPC(ch)) Crash_delete_crashfile(ch); else { if (GET_MOB_RNUM(ch) > -1) /* if mobile */ mob_index[GET_MOB_RNUM(ch)].number--; free_char(ch); freed = 1; } if (!freed && ch->desc != NULL) { STATE(ch->desc) = CON_MENU; display_statistics_to_char(ch); SEND_TO_Q(MENU, ch->desc); } else { /* if a player gets purged from within the game */ if (!freed) free_char(ch); } }
The code is C.