/* * Know inventory and home items upon death */ static void death_knowledge(void) { store_type *st_ptr = &store[STORE_HOME]; object_type *o_ptr; int i; for (i = 0; i < ALL_INVEN_TOTAL; i++) { o_ptr = &p_ptr->inventory[i]; if (!o_ptr->kind) continue; object_flavor_aware(o_ptr); object_notice_everything(o_ptr); } for (i = 0; i < st_ptr->stock_num; i++) { o_ptr = &st_ptr->stock[i]; if (!o_ptr->kind) continue; object_flavor_aware(o_ptr); object_notice_everything(o_ptr); } history_unmask_unknown(); /* Hack -- Recalculate bonuses */ p_ptr->update |= (PU_BONUS); handle_stuff(p_ptr); }
/** * Hack - Know inventory and home items upon death */ static void death_knowledge(void) { int i, which = 0; object_type *o_ptr; store_type *st_ptr = NULL; /* Get the store number of the home */ if (OPT(adult_dungeon)) which = NUM_TOWNS_SMALL * 4 + STORE_HOME; else { for (i = 0; i < NUM_TOWNS; i++) { /* Found the town */ if (p_ptr->home == towns[i]) { which += (i < NUM_TOWNS_SMALL ? 3 : STORE_HOME); break; } /* Next town */ else which += (i < NUM_TOWNS_SMALL ? MAX_STORES_SMALL : MAX_STORES_BIG); } } /* Hack -- Know everything in the inven/equip */ for (i = 0; i < ALL_INVEN_TOTAL; i++) { o_ptr = &p_ptr->inventory[i]; /* Skip non-objects */ if (!o_ptr->k_idx) continue; /* Aware and Known */ object_aware(o_ptr); object_known(o_ptr); /* Fully known */ cf_union(o_ptr->id_curse, o_ptr->flags_curse); } /* Thralls sometimes (often!) don't have a home */ if (p_ptr->home) { /* Activate the store */ st_ptr = &store[which]; /* Hack -- Know everything in the home */ for (i = 0; i < st_ptr->stock_num; i++) { o_ptr = &st_ptr->stock[i]; /* Skip non-objects */ if (!o_ptr->k_idx) continue; /* Aware and Known */ object_aware(o_ptr); object_known(o_ptr); /* Fully known */ cf_union(o_ptr->id_curse, o_ptr->flags_curse); } } history_unmask_unknown(); /* Hack -- Recalculate bonuses */ p_ptr->update |= (PU_BONUS); /* Handle stuff */ handle_stuff(); }