Permanent PC death

This commit is contained in:
kinther 2025-12-23 09:46:56 -08:00
parent 0267a4c091
commit 0bb44d02b5
3 changed files with 33 additions and 5 deletions

View file

@ -467,6 +467,8 @@ int do_simple_move(struct char_data *ch, int dir, int need_specials_check)
{
mudlog(BRF, LVL_IMMORT, TRUE, "%s hit death trap #%d (%s)", GET_NAME(ch), GET_ROOM_VNUM(going_to), world[going_to].name);
death_cry(ch);
if (!IS_NPC(ch))
GET_POS(ch) = POS_DEAD;
extract_char(ch);
return (0);
}

View file

@ -356,6 +356,7 @@ struct char_data *i;
send_to_group(ch, GROUP(ch), "%s has died.\r\n", GET_NAME(ch));
update_pos(ch);
GET_POS(ch) = POS_DEAD;
make_corpse(ch);
extract_char(ch);

View file

@ -909,8 +909,12 @@ void extract_char_final(struct char_data *ch)
if (d->character && GET_IDNUM(ch) == GET_IDNUM(d->character))
STATE(d) = CON_CLOSE;
}
STATE(ch->desc) = CON_MENU;
write_to_output(ch->desc, "%s", CONFIG_MENU);
if (GET_POS(ch) == POS_DEAD) {
STATE(ch->desc) = CON_CLOSE;
} else {
STATE(ch->desc) = CON_MENU;
write_to_output(ch->desc, "%s", CONFIG_MENU);
}
}
}
@ -973,9 +977,30 @@ void extract_char_final(struct char_data *ch)
if (SCRIPT_MEM(ch))
extract_script_mem(SCRIPT_MEM(ch));
} else {
save_char(ch);
Crash_delete_crashfile(ch);
REMOVE_BIT_AR(PLR_FLAGS(ch), PLR_QUITING);
if (GET_POS(ch) == POS_DEAD) {
int pfilepos = GET_PFILEPOS(ch);
if (pfilepos < 0)
pfilepos = get_ptable_by_name(GET_NAME(ch));
if (pfilepos >= 0) {
remove_player(pfilepos);
} else {
char filename[PATH_MAX];
int i;
log("SYSERR: Could not locate player index entry for %s on death cleanup.",
GET_NAME(ch));
for (i = 0; i < MAX_FILES; i++) {
if (get_filename(filename, sizeof(filename), i, GET_NAME(ch)))
unlink(filename);
}
}
} else {
save_char(ch);
Crash_delete_crashfile(ch);
REMOVE_BIT_AR(PLR_FLAGS(ch), PLR_QUITING);
}
}
/* If there's a descriptor, they're in the menu now. */