if (o_ptr->art_flags[1]) flags |= SAVE_ITEM_ART_FLAGS1;
if (o_ptr->art_flags[2]) flags |= SAVE_ITEM_ART_FLAGS2;
if (o_ptr->art_flags[3]) flags |= SAVE_ITEM_ART_FLAGS3;
+ if (o_ptr->art_flags[4]) flags |= SAVE_ITEM_ART_FLAGS4;
if (o_ptr->curse_flags) flags |= SAVE_ITEM_CURSE_FLAGS;
if (o_ptr->held_m_idx) flags |= SAVE_ITEM_HELD_M_IDX;
if (o_ptr->xtra1) flags |= SAVE_ITEM_XTRA1;
if (flags & SAVE_ITEM_ART_FLAGS1) wr_u32b(o_ptr->art_flags[1]);
if (flags & SAVE_ITEM_ART_FLAGS2) wr_u32b(o_ptr->art_flags[2]);
if (flags & SAVE_ITEM_ART_FLAGS3) wr_u32b(o_ptr->art_flags[3]);
+ if (flags & SAVE_ITEM_ART_FLAGS4) wr_u32b(o_ptr->art_flags[4]);
if (flags & SAVE_ITEM_CURSE_FLAGS) wr_u32b(o_ptr->curse_flags);
*/
static void wr_saved_floor(saved_floor_type *sf_ptr)
{
- cave_template_type *template;
+ cave_template_type *templates;
u16b max_num_temp;
u16b num_temp = 0;
int dummy_why;
max_num_temp = 255;
/* Allocate the "template" array */
- C_MAKE(template, max_num_temp, cave_template_type);
+ C_MAKE(templates, max_num_temp, cave_template_type);
/* Extract template array */
for (y = 0; y < cur_hgt; y++)
for (i = 0; i < num_temp; i++)
{
- if (template[i].info == c_ptr->info &&
- template[i].feat == c_ptr->feat &&
- template[i].mimic == c_ptr->mimic &&
- template[i].special == c_ptr->special)
+ if (templates[i].info == c_ptr->info &&
+ templates[i].feat == c_ptr->feat &&
+ templates[i].mimic == c_ptr->mimic &&
+ templates[i].special == c_ptr->special)
{
/* Same terrain is exist */
- template[i].occurrence++;
+ templates[i].occurrence++;
break;
}
}
/* If the max_num_temp is too small, increase it. */
if (num_temp >= max_num_temp)
{
- cave_template_type *old_template = template;
+ cave_template_type *old_template = templates;
/* Re-allocate the "template" array */
- C_MAKE(template, max_num_temp + 255, cave_template_type);
- (void)C_COPY(template, old_template, max_num_temp, cave_template_type);
+ C_MAKE(templates, max_num_temp + 255, cave_template_type);
+ (void)C_COPY(templates, old_template, max_num_temp, cave_template_type);
C_KILL(old_template, max_num_temp, cave_template_type);
max_num_temp += 255;
}
/* Add new template */
- template[num_temp].info = c_ptr->info;
- template[num_temp].feat = c_ptr->feat;
- template[num_temp].mimic = c_ptr->mimic;
- template[num_temp].special = c_ptr->special;
- template[num_temp].occurrence = 1;
+ templates[num_temp].info = c_ptr->info;
+ templates[num_temp].feat = c_ptr->feat;
+ templates[num_temp].mimic = c_ptr->mimic;
+ templates[num_temp].special = c_ptr->special;
+ templates[num_temp].occurrence = 1;
/* Increase number of template */
num_temp++;
ang_sort_swap = ang_sort_swap_cave_temp;
/* Sort by occurrence */
- ang_sort(template, &dummy_why, num_temp);
+ ang_sort(templates, &dummy_why, num_temp);
/*** Dump templates ***/
/* Dump the templates */
for (i = 0; i < num_temp; i++)
{
- cave_template_type *ct_ptr = &template[i];
+ cave_template_type *ct_ptr = &templates[i];
/* Dump it */
wr_u16b(ct_ptr->info);
for (i = 0; i < num_temp; i++)
{
- if (template[i].info == c_ptr->info &&
- template[i].feat == c_ptr->feat &&
- template[i].mimic == c_ptr->mimic &&
- template[i].special == c_ptr->special)
+ if (templates[i].info == c_ptr->info &&
+ templates[i].feat == c_ptr->feat &&
+ templates[i].mimic == c_ptr->mimic &&
+ templates[i].special == c_ptr->special)
break;
}
/* Free the "template" array */
- C_KILL(template, max_num_temp, cave_template_type);
+ C_KILL(templates, max_num_temp, cave_template_type);
/*** Dump objects ***/
for (i = 0; i < max_quests; i++)
{
+ quest_type* const q_ptr = &quest[i];
+
/* Save status for every quest */
- wr_s16b(quest[i].status);
+ wr_s16b(q_ptr->status);
/* And the dungeon level too */
/* (prevents problems with multi-level quests) */
- wr_s16b(quest[i].level);
+ wr_s16b(q_ptr->level);
- wr_byte(quest[i].complev);
+ wr_byte(q_ptr->complev);
+ wr_u32b(q_ptr->comptime);
/* Save quest status if quest is running */
- if (quest[i].status == QUEST_STATUS_TAKEN || quest[i].status == QUEST_STATUS_COMPLETED || !is_fixed_quest_idx(i))
+ if (q_ptr->status == QUEST_STATUS_TAKEN || q_ptr->status == QUEST_STATUS_COMPLETED || !is_fixed_quest_idx(i))
{
- wr_s16b(quest[i].cur_num);
- wr_s16b(quest[i].max_num);
- wr_s16b(quest[i].type);
- wr_s16b(quest[i].r_idx);
- wr_s16b(quest[i].k_idx);
- wr_byte(quest[i].flags);
- wr_byte(quest[i].dungeon);
+ wr_s16b(q_ptr->cur_num);
+ wr_s16b(q_ptr->max_num);
+ wr_s16b(q_ptr->type);
+ wr_s16b(q_ptr->r_idx);
+ wr_s16b(q_ptr->k_idx);
+ wr_byte(q_ptr->flags);
+ wr_byte(q_ptr->dungeon);
}
}