Seems i every few weeks gets a crash with this message:
May 27 04:25:44 :: SYSERR: NULL character or NOWHERE in handler.c,
char_from_room
Anyone who can tell me how to fix it ?
Code:
handler.c
/* move a player out of a room */
void char_from_room(struct char_data *ch)
{
struct char_data *temp;
if (ch == NULL || IN_ROOM(ch) == NOWHERE) {
log("SYSERR: NULL character or NOWHERE in %s, char_from_room", __FILE__);
exit(1);
}
if (FIGHTING(ch) != NULL)
stop_fighting(ch);
char_from_furniture(ch);
if (GET_EQ(ch, WEAR_LIGHT) != NULL)
if (GET_OBJ_TYPE(GET_EQ(ch, WEAR_LIGHT)) == ITEM_LIGHT)
if (GET_OBJ_VAL(GET_EQ(ch, WEAR_LIGHT), 2)) /* Light is ON */
world[IN_ROOM(ch)].light--;
REMOVE_FROM_LIST(ch, world[IN_ROOM(ch)].people, next_in_room);
IN_ROOM(ch) = NOWHERE;
ch->next_in_room = NULL;
}
Here is the second place in handler.c with char_from_room
Code:
/* Whipe character from the memory of hunters and other intelligent NPCs... */
for (temp = character_list; temp; temp = temp->next) {
/* PCs can't use MEMORY, and don't use HUNTING() */
if (!IS_NPC(temp))
continue;
/* If "temp" is hunting our extracted char, stop the hunt. */
if (HUNTING(temp) == ch)
HUNTING(temp) = NULL;
/* If "temp" has allocated memory data and our ch is a PC, forget the
* extracted character (if he/she is remembered) */
if (!IS_NPC(ch) && GET_POS(ch) == POS_DEAD && MEMORY(temp))
forget(temp, ch); /* forget() is safe to use without a check. */
}
char_from_room(ch);
if (IS_NPC(ch)) {
if (GET_MOB_RNUM(ch) != NOTHING) /* prototyped */
mob_index[GET_MOB_RNUM(ch)].number--;
clearMemory(ch);
if (SCRIPT(ch))
extract_script(ch, MOB_TRIGGER);
if (SCRIPT_MEM(ch))
extract_script_mem(SCRIPT_MEM(ch));
} else {
save_char(ch);
Crash_delete_crashfile(ch);
}
/* If there's a descriptor, they're in the menu now. */
if (IS_NPC(ch) || !ch->desc)
free_char(ch);
}