/*
 *  Clear and empty the cave
 */
void clear_cave(void)
{
    int x, y;

    /* Very simplified version of wipe_o_list() */
    C_WIPE(o_list, o_max, object_type);
    o_max = 1;
    o_cnt = 0;
    unique_count = 0;

    /* Note, when I replaced the above with wipe_o_list(), artifacts started spawning
       multiple times!
      wipe_o_list();*/

    wipe_m_list();

    /* Pre-calc cur_num of pets in party_mon[] */
    precalc_cur_num_of_pet();

    /* Start with a blank cave */
    for (y = 0; y < MAX_HGT; y++)
    {
        for (x = 0; x < MAX_WID; x++)
        {
            cave_type *c_ptr = &cave[y][x];

            /* No flags */
            c_ptr->info = 0;

            /* No features */
            c_ptr->feat = 0;

            /* No objects */
            c_ptr->o_idx = 0;

            /* No monsters */
            c_ptr->m_idx = 0;

            /* No special */
            c_ptr->special = 0;

            /* No mimic */
            c_ptr->mimic = 0;

            /* No flow */
            c_ptr->cost = 0;
            c_ptr->dist = 0;
            c_ptr->when = 0;
        }
    }

    /* Mega-Hack -- no player yet */
    px = py = 0;

    /* Set the base level */
    base_level = dun_level;

    /* Reset the monster generation level */
    monster_level = base_level;

    /* Reset the object generation level */
    object_level = base_level;
}
Пример #2
0
/*!
 * @brief フロアの全情報を初期化する / Clear and empty the cave
 * @return なし
 */
void clear_cave(void)
{
    int x, y, i;

    /* Very simplified version of wipe_o_list() */
    (void)C_WIPE(o_list, o_max, object_type);
    o_max = 1;
    o_cnt = 0;

    /* Very simplified version of wipe_m_list() */
    for (i = 1; i < max_r_idx; i++)
        r_info[i].cur_num = 0;
    (void)C_WIPE(m_list, m_max, monster_type);
    m_max = 1;
    m_cnt = 0;
    for (i = 0; i < MAX_MTIMED; i++) mproc_max[i] = 0;

    /* Pre-calc cur_num of pets in party_mon[] */
    precalc_cur_num_of_pet();


    /* Start with a blank cave */
    for (y = 0; y < MAX_HGT; y++)
    {
        for (x = 0; x < MAX_WID; x++)
        {
            cave_type *c_ptr = &cave[y][x];

            /* No flags */
            c_ptr->info = 0;

            /* No features */
            c_ptr->feat = 0;

            /* No objects */
            c_ptr->o_idx = 0;

            /* No monsters */
            c_ptr->m_idx = 0;

            /* No special */
            c_ptr->special = 0;

            /* No mimic */
            c_ptr->mimic = 0;

            /* No flow */
            c_ptr->cost = 0;
            c_ptr->dist = 0;
            c_ptr->when = 0;
        }
    }

    /* Mega-Hack -- no player yet */
    p_ptr->x = p_ptr->y = 0;

    /* Set the base level */
    base_level = dun_level;

    /* Reset the monster generation level */
    monster_level = base_level;

    /* Reset the object generation level */
    object_level = base_level;
}