}
wr_s16b(creature_ptr->mane_num);
- for (i = 0; i < MAX_KUBI; i++)
+ for (i = 0; i < MAX_BOUNTY; i++)
{
wr_s16b(current_world_ptr->bounty_r_idx[i]);
}
/*!
* @brief 現在フロアの書き込み /
* Write the current dungeon (new method)
- * @return なし
+ * @player_ptr プレーヤーへの参照ポインタ
+ * @return 保存に成功したらTRUE
*/
-static bool wr_dungeon(void)
+static bool wr_dungeon(player_type *player_ptr)
{
saved_floor_type *cur_sf_ptr;
int i;
if (!sf_ptr->floor_id) continue;
/* Load temporal saved floor file */
- if (load_floor(sf_ptr, (SLF_SECOND | SLF_NO_KILL)))
+ if (load_floor(player_ptr, sf_ptr, (SLF_SECOND | SLF_NO_KILL)))
{
/* Mark success */
wr_byte(0);
}
/* Restore current floor */
- if (!load_floor(cur_sf_ptr, (SLF_SECOND))) return FALSE;
+ if (!load_floor(player_ptr, cur_sf_ptr, (SLF_SECOND))) return FALSE;
/* Success */
return TRUE;
/*!
* @brief セーブデータの書き込み /
* Actually write a save-file
+ * @param player_ptr プレーヤーへの参照ポインタ
* @return 成功すればtrue
*/
-static bool wr_savefile_new(void)
+static bool wr_savefile_new(player_type *player_ptr)
{
int i, j;
KIND_OBJECT_IDX k_idx;
/* Compact the objects */
- compact_objects(p_ptr->current_floor_ptr, 0);
+ compact_objects(player_ptr->current_floor_ptr, 0);
/* Compact the monsters */
compact_monsters(0);
}
/* Dump the position in the wilderness */
- wr_s32b(p_ptr->wilderness_x);
- wr_s32b(p_ptr->wilderness_y);
+ wr_s32b(player_ptr->wilderness_x);
+ wr_s32b(player_ptr->wilderness_y);
- wr_byte(p_ptr->wild_mode);
- wr_byte(p_ptr->ambush_flag);
+ wr_byte(player_ptr->wild_mode);
+ wr_byte(player_ptr->ambush_flag);
wr_s32b(current_world_ptr->max_wild_x);
wr_s32b(current_world_ptr->max_wild_y);
/* Write the "extra" information */
- wr_extra(p_ptr);
+ wr_extra(player_ptr);
/* Dump the "player hp" entries */
tmp16u = PY_MAX_LEVEL;
wr_u16b(tmp16u);
for (i = 0; i < tmp16u; i++)
{
- wr_s16b((s16b)p_ptr->player_hp[i]);
+ wr_s16b((s16b)player_ptr->player_hp[i]);
}
/* Write spell data */
- wr_u32b(p_ptr->spell_learned1);
- wr_u32b(p_ptr->spell_learned2);
- wr_u32b(p_ptr->spell_worked1);
- wr_u32b(p_ptr->spell_worked2);
- wr_u32b(p_ptr->spell_forgotten1);
- wr_u32b(p_ptr->spell_forgotten2);
+ wr_u32b(player_ptr->spell_learned1);
+ wr_u32b(player_ptr->spell_learned2);
+ wr_u32b(player_ptr->spell_worked1);
+ wr_u32b(player_ptr->spell_worked2);
+ wr_u32b(player_ptr->spell_forgotten1);
+ wr_u32b(player_ptr->spell_forgotten2);
- wr_s16b(p_ptr->learned_spells);
- wr_s16b(p_ptr->add_spells);
+ wr_s16b(player_ptr->learned_spells);
+ wr_s16b(player_ptr->add_spells);
/* Dump the ordered spells */
for (i = 0; i < 64; i++)
{
- wr_byte((byte_hack)p_ptr->spell_order[i]);
+ wr_byte((byte_hack)player_ptr->spell_order[i]);
}
for (i = 0; i < INVEN_TOTAL; i++)
{
- object_type *o_ptr = &p_ptr->inventory_list[i];
+ object_type *o_ptr = &player_ptr->inventory_list[i];
if (!o_ptr->k_idx) continue;
/* Dump index */
}
/* Write the pet command settings */
- wr_s16b(p_ptr->pet_follow_distance);
- wr_s16b(p_ptr->pet_extra_flags);
+ wr_s16b(player_ptr->pet_follow_distance);
+ wr_s16b(player_ptr->pet_extra_flags);
/* Write screen dump for sending score */
- if (screen_dump && (p_ptr->wait_report_score || !p_ptr->is_dead))
+ if (screen_dump && (player_ptr->wait_report_score || !player_ptr->is_dead))
{
wr_string(screen_dump);
}
}
/* Player is not dead, write the dungeon */
- if (!p_ptr->is_dead)
+ if (!player_ptr->is_dead)
{
/* Dump the dungeon */
- if (!wr_dungeon()) return FALSE;
+ if (!wr_dungeon(player_ptr)) return FALSE;
/* Dump the ghost */
wr_ghost();
/*!
* @brief セーブデータ書き込みのサブルーチン /
* Medium level player saver
+ * @param player_ptr プレーヤーへの参照ポインタ
* @return 成功すればtrue
* @details
* Angband 2.8.0 will use "fd" instead of "fff" if possible
*/
-static bool save_player_aux(char *name)
+static bool save_player_aux(player_type *player_ptr, char *name)
{
bool ok = FALSE;
int fd = -1;
if (fff)
{
/* Write the savefile */
- if (wr_savefile_new()) ok = TRUE;
+ if (wr_savefile_new(player_ptr)) ok = TRUE;
/* Attempt to close it */
if (my_fclose(fff)) ok = FALSE;
/*!
* @brief セーブデータ書き込みのメインルーチン /
* Attempt to save the player in a savefile
+ * @param player_ptr プレーヤーへの参照ポインタ
* @return 成功すればtrue
*/
-bool save_player(void)
+bool save_player(player_type *player_ptr)
{
bool result = FALSE;
update_playtime();
/* Attempt to save the player */
- if (save_player_aux(safe))
+ if (save_player_aux(player_ptr, safe))
{
char temp[1024];