* Some "local" parameters, used to help write savefiles
*/
-static FILE *fff; /* Current save "file" */
-
-static byte xor_byte; /* Simple encryption */
-
-static u32b v_stamp = 0L; /* A simple "checksum" on the actual values */
-static u32b x_stamp = 0L; /* A simple "checksum" on the encoded bytes */
+static FILE *fff; /* Current save "file" */
+static byte xor_byte; /* Simple encryption */
+static u32b v_stamp = 0L; /* A simple "checksum" on the actual values */
+static u32b x_stamp = 0L; /* A simple "checksum" on the encoded bytes */
wr_u32b(r_ptr->r_flags6);
wr_u32b(r_ptr->r_flagsr);
-
/* Monster limit per level */
wr_byte((byte_hack)r_ptr->max_num);
/*!
- * @brief 店舗情報を書き込む / Write a "store" record
+ * @brief セーブデータに店舗情報を書き込む / Write a "store" record
* @param st_ptr 店舗情報の参照ポインタ
* @return なし
*/
/*!
- * @brief 乱数情報を書き込む / Write RNG state
- * @return なし
+ * @brief セーブデータに乱数情報を書き込む / Write RNG state
+ * @return 常に0(成功を返す)
*/
static errr wr_randomizer(void)
{
int i;
-
- /* Zero */
wr_u16b(0);
-
- /* Place */
wr_u16b(Rand_place);
- /* State */
for (i = 0; i < RAND_DEG; i++)
{
wr_u32b(Rand_state[i]);
}
- /* Success */
return (0);
}
wr_byte(p_ptr->psex);
wr_byte((byte_hack)p_ptr->realm1);
wr_byte((byte_hack)p_ptr->realm2);
+ wr_byte(0);
wr_byte((byte)p_ptr->hitdie);
wr_u16b(p_ptr->expfact);
wr_s16b((s16b)max_dlv[i]);
/* More info */
+ wr_s16b(0);
+ wr_s16b(0);
+ wr_s16b(0);
+ wr_s16b(0);
wr_s16b(p_ptr->sc);
wr_s16b(p_ptr->concent);
wr_u32b(p_ptr->special_defense);
wr_byte(p_ptr->knowledge);
wr_byte(p_ptr->autopick_autoregister);
+ wr_byte(0);
wr_byte((byte_hack)p_ptr->action);
wr_byte(0);
wr_byte(preserve_mode);
for (i = 0; i < 12; i++) wr_u32b(0L);
/* Ignore some flags */
+ wr_u32b(0L);
+ wr_u32b(0L);
+ wr_u32b(0L);
/* Write the "object seeds" */
*/
static bool save_player_aux(char *name)
{
- bool ok = FALSE;
-
- int fd = -1;
-
- int mode = 0644;
-
+ bool ok = FALSE;
+ int fd = -1;
+ int mode = 0644;
/* No file yet */
fff = NULL;
-
/* File type is "SAVE" */
FILE_TYPE(FILE_TYPE_SAVE);
-
/* Grab permissions */
safe_setuid_grab();