*/
#include "angband.h"
+#include "sort.h"
+#include "quest.h"
+#include "store.h"
* 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 */
* @param str 書き込む文字列
* @return なし
*/
-static void wr_string(cptr str)
+static void wr_string(concptr str)
{
while (*str)
{
*/
static void wr_item(object_type *o_ptr)
{
- u32b flags = 0x00000000;
+ BIT_FLAGS flags = 0x00000000;
if (o_ptr->pval) flags |= SAVE_ITEM_PVAL;
if (o_ptr->discount) flags |= SAVE_ITEM_DISCOUNT;
/*** Write only un-obvious elements ***/
wr_s16b(o_ptr->k_idx);
- /* Location */
- wr_byte(o_ptr->iy);
- wr_byte(o_ptr->ix);
+ wr_byte((byte_hack)o_ptr->iy);
+ wr_byte((byte_hack)o_ptr->ix);
if (flags & SAVE_ITEM_PVAL) wr_s16b(o_ptr->pval);
if (flags & SAVE_ITEM_DISCOUNT) wr_byte(o_ptr->discount);
- if (flags & SAVE_ITEM_NUMBER) wr_byte(o_ptr->number);
+ if (flags & SAVE_ITEM_NUMBER) wr_byte((byte_hack)o_ptr->number);
- wr_s16b(o_ptr->weight);
+ wr_s16b((s16b)o_ptr->weight);
- if (flags & SAVE_ITEM_NAME1) wr_byte(o_ptr->name1);
- if (flags & SAVE_ITEM_NAME2) wr_byte(o_ptr->name2);
+ if (flags & SAVE_ITEM_NAME1) wr_byte((byte_hack)o_ptr->name1);
+ if (flags & SAVE_ITEM_NAME2) wr_byte((byte_hack)o_ptr->name2);
if (flags & SAVE_ITEM_TIMEOUT) wr_s16b(o_ptr->timeout);
if (flags & SAVE_ITEM_TO_H) wr_s16b(o_ptr->to_h);
- if (flags & SAVE_ITEM_TO_D) wr_s16b(o_ptr->to_d);
+ if (flags & SAVE_ITEM_TO_D) wr_s16b((s16b)o_ptr->to_d);
if (flags & SAVE_ITEM_TO_A) wr_s16b(o_ptr->to_a);
if (flags & SAVE_ITEM_AC) wr_s16b(o_ptr->ac);
- if (flags & SAVE_ITEM_DD) wr_byte(o_ptr->dd);
- if (flags & SAVE_ITEM_DS) wr_byte(o_ptr->ds);
+ if (flags & SAVE_ITEM_DD) wr_byte((byte_hack)o_ptr->dd);
+ if (flags & SAVE_ITEM_DS) wr_byte((byte_hack)o_ptr->ds);
if (flags & SAVE_ITEM_IDENT) wr_byte(o_ptr->ident);
*/
static void wr_monster(monster_type *m_ptr)
{
- u32b flags = 0x00000000;
+ BIT_FLAGS flags = 0x00000000;
byte tmp8u;
if (!is_original_ap(m_ptr)) flags |= SAVE_MON_AP_R_IDX;
/*** Write only un-obvious elements ***/
wr_s16b(m_ptr->r_idx);
- wr_byte(m_ptr->fy);
- wr_byte(m_ptr->fx);
- wr_s16b(m_ptr->hp);
- wr_s16b(m_ptr->maxhp);
- wr_s16b(m_ptr->max_maxhp);
+ wr_byte((byte_hack)m_ptr->fy);
+ wr_byte((byte_hack)m_ptr->fx);
+ wr_s16b((s16b)m_ptr->hp);
+ wr_s16b((s16b)m_ptr->maxhp);
+ wr_s16b((s16b)m_ptr->max_maxhp);
wr_u32b(m_ptr->dealt_damage);
if (flags & SAVE_MON_SUB_ALIGN) wr_byte(m_ptr->sub_align);
if (flags & SAVE_MON_CSLEEP) wr_s16b(m_ptr->mtimed[MTIMED_CSLEEP]);
- wr_byte(m_ptr->mspeed);
+ wr_byte((byte)m_ptr->mspeed);
wr_s16b(m_ptr->energy_need);
if (flags & SAVE_MON_FAST)
tmp8u = (byte)m_ptr->mtimed[MTIMED_MONFEAR];
wr_byte(tmp8u);
}
- if (flags & SAVE_MON_TARGET_Y) wr_s16b(m_ptr->target_y);
- if (flags & SAVE_MON_TARGET_X) wr_s16b(m_ptr->target_x);
+ if (flags & SAVE_MON_TARGET_Y) wr_s16b((s16b)m_ptr->target_y);
+ if (flags & SAVE_MON_TARGET_X) wr_s16b((s16b)m_ptr->target_x);
if (flags & SAVE_MON_INVULNER)
{
tmp8u = (byte)m_ptr->mtimed[MTIMED_INVULNER];
* @param r_idx モンスター種族ID
* @return なし
*/
-static void wr_lore(int r_idx)
+static void wr_lore(MONRACE_IDX r_idx)
{
monster_race *r_ptr = &r_info[r_idx];
/* Count sights/deaths/kills */
- wr_s16b(r_ptr->r_sights);
- wr_s16b(r_ptr->r_deaths);
- wr_s16b(r_ptr->r_pkills);
- wr_s16b(r_ptr->r_akills);
- wr_s16b(r_ptr->r_tkills);
+ wr_s16b((s16b)r_ptr->r_sights);
+ wr_s16b((s16b)r_ptr->r_deaths);
+ wr_s16b((s16b)r_ptr->r_pkills);
+ wr_s16b((s16b)r_ptr->r_akills);
+ wr_s16b((s16b)r_ptr->r_tkills);
/* Count wakes and ignores */
wr_byte(r_ptr->r_wake);
wr_byte(r_ptr->r_xtra2);
/* Count drops */
- wr_byte(r_ptr->r_drop_gold);
- wr_byte(r_ptr->r_drop_item);
+ wr_byte((byte_hack)r_ptr->r_drop_gold);
+ wr_byte((byte_hack)r_ptr->r_drop_item);
/* Count spells */
wr_byte(0); /* unused now */
wr_u32b(r_ptr->r_flags6);
wr_u32b(r_ptr->r_flagsr);
-
/* Monster limit per level */
- wr_byte(r_ptr->max_num);
+ wr_byte((byte_hack)r_ptr->max_num);
/* Location in saved floor */
wr_s16b(r_ptr->floor_id);
* @param k_idx ベースアイテムのID
* @return なし
*/
-static void wr_xtra(int k_idx)
+static void wr_xtra(KIND_OBJECT_IDX k_idx)
{
byte tmp8u = 0;
/*!
- * @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);
}
/*** Oops ***/
- /* Oops */
for (i = 0; i < 4; i++) wr_u32b(0L);
if (p_ptr->wizard) c |= 0x0002;
+ if (cheat_sight) c |= 0x0040;
+ if (cheat_turn) c |= 0x0080;
+
if (cheat_peek) c |= 0x0100;
if (cheat_hear) c |= 0x0200;
if (cheat_room) c |= 0x0400;
int i;
wr_byte(previous_char.psex);
- wr_byte(previous_char.prace);
- wr_byte(previous_char.pclass);
- wr_byte(previous_char.pseikaku);
- wr_byte(previous_char.realm1);
- wr_byte(previous_char.realm2);
+ wr_byte((byte_hack)previous_char.prace);
+ wr_byte((byte_hack)previous_char.pclass);
+ wr_byte((byte_hack)previous_char.pseikaku);
+ wr_byte((byte_hack)previous_char.realm1);
+ wr_byte((byte_hack)previous_char.realm2);
wr_s16b(previous_char.age);
wr_s16b(previous_char.ht);
wr_s16b(previous_char.sc);
wr_s32b(previous_char.au);
- for (i = 0; i < 6; i++) wr_s16b(previous_char.stat_max[i]);
- for (i = 0; i < 6; i++) wr_s16b(previous_char.stat_max_max[i]);
+ for (i = 0; i < A_MAX; i++) wr_s16b(previous_char.stat_max[i]);
+ for (i = 0; i < A_MAX; i++) wr_s16b(previous_char.stat_max_max[i]);
- for (i = 0; i < PY_MAX_LEVEL; i++) wr_s16b(previous_char.player_hp[i]);
+ for (i = 0; i < PY_MAX_LEVEL; i++) wr_s16b((s16b)previous_char.player_hp[i]);
wr_s16b(previous_char.chaos_patron);
byte tmp8u;
wr_string(p_ptr->name);
-
wr_string(p_ptr->died_from);
-
wr_string(p_ptr->last_message ? p_ptr->last_message : "");
save_quick_start();
}
/* Race/Class/Gender/Spells */
- wr_byte(p_ptr->prace);
- wr_byte(p_ptr->pclass);
- wr_byte(p_ptr->pseikaku);
- wr_byte(p_ptr->psex);
- wr_byte(p_ptr->realm1);
- wr_byte(p_ptr->realm2);
- wr_byte(0); /* oops */
-
- wr_byte(p_ptr->hitdie);
+ wr_byte((byte_hack)p_ptr->prace);
+ wr_byte((byte_hack)p_ptr->pclass);
+ wr_byte((byte_hack)p_ptr->pseikaku);
+ wr_byte((byte_hack)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(p_ptr->age);
wr_s16b(p_ptr->wt);
/* Dump the stats (maximum and current) */
- for (i = 0; i < 6; ++i) wr_s16b(p_ptr->stat_max[i]);
- for (i = 0; i < 6; ++i) wr_s16b(p_ptr->stat_max_max[i]);
- for (i = 0; i < 6; ++i) wr_s16b(p_ptr->stat_cur[i]);
+ for (i = 0; i < A_MAX; ++i) wr_s16b(p_ptr->stat_max[i]);
+ for (i = 0; i < A_MAX; ++i) wr_s16b(p_ptr->stat_max_max[i]);
+ for (i = 0; i < A_MAX; ++i) wr_s16b(p_ptr->stat_cur[i]);
/* Ignore the transient stats */
for (i = 0; i < 12; ++i) wr_s16b(0);
for (i = 0; i < 108; i++) wr_s32b(p_ptr->magic_num1[i]);
for (i = 0; i < 108; i++) wr_byte(p_ptr->magic_num2[i]);
- wr_byte(p_ptr->start_race);
+ wr_byte((byte_hack)p_ptr->start_race);
wr_s32b(p_ptr->old_race1);
wr_s32b(p_ptr->old_race2);
wr_s16b(p_ptr->old_realm);
for (i = 0; i < MAX_MANE; i++)
{
- wr_s16b(p_ptr->mane_spell[i]);
- wr_s16b(p_ptr->mane_dam[i]);
+ wr_s16b((s16b)p_ptr->mane_spell[i]);
+ wr_s16b((s16b)p_ptr->mane_dam[i]);
}
wr_s16b(p_ptr->mane_num);
wr_byte(p_ptr->exit_bldg);
wr_byte(0); /* Unused */
- wr_s16b(p_ptr->oldpx);
- wr_s16b(p_ptr->oldpy);
+ wr_s16b((s16b)p_ptr->oldpx);
+ wr_s16b((s16b)p_ptr->oldpy);
/* Was number of p_ptr->rewards[] */
wr_s16b(0);
tmp8u = (byte)max_d_idx;
wr_byte(tmp8u);
for (i = 0; i < tmp8u; i++)
- wr_s16b(max_dlv[i]);
+ wr_s16b((s16b)max_dlv[i]);
/* More info */
- wr_s16b(0); /* oops */
- wr_s16b(0); /* oops */
- wr_s16b(0); /* oops */
- wr_s16b(0); /* oops */
+ wr_s16b(0);
+ wr_s16b(0);
+ wr_s16b(0);
+ wr_s16b(0);
wr_s16b(p_ptr->sc);
wr_s16b(p_ptr->concent);
wr_s16b(p_ptr->magicdef);
wr_s16b(p_ptr->tim_res_nether);
wr_s16b(p_ptr->tim_res_time);
- wr_byte(p_ptr->mimic_form);
+ wr_byte((byte)p_ptr->mimic_form);
wr_s16b(p_ptr->tim_mimic);
wr_s16b(p_ptr->tim_sh_fire);
wr_s16b(p_ptr->tim_sh_holy);
wr_u32b(p_ptr->special_defense);
wr_byte(p_ptr->knowledge);
wr_byte(p_ptr->autopick_autoregister);
- wr_byte(0); /* oops */
- wr_byte(p_ptr->action);
+ wr_byte(0);
+ wr_byte((byte_hack)p_ptr->action);
wr_byte(0);
wr_byte(preserve_mode);
wr_byte(p_ptr->wait_report_score);
for (i = 0; i < 12; i++) wr_u32b(0L);
/* Ignore some flags */
- wr_u32b(0L); /* oops */
- wr_u32b(0L); /* oops */
- wr_u32b(0L); /* oops */
+ wr_u32b(0L);
+ wr_u32b(0L);
+ wr_u32b(0L);
/* Write the "object seeds" */
/*!
- * @brief フロア保存時のcave情報テンプレートをソートするための比較処理
- * @param u caveテンプレートの参照ポインタ
+ * @brief フロア保存時のcurrent_floor_ptr->grid_array情報テンプレートをソートするための比較処理
+ * @param u current_floor_ptr->grid_arrayテンプレートの参照ポインタ
* @param v 未使用
* @param a スワップするモンスター種族のID1
* @param b スワップするモンスター種族のID2
/*!
- * @brief フロア保存時のcave情報テンプレートをソートするためのスワップ処理 / Sorting hook -- Swap function
- * @param u caveテンプレートの参照ポインタ
+ * @brief フロア保存時のcurrent_floor_ptr->grid_array情報テンプレートをソートするためのスワップ処理 / Sorting hook -- Swap function
+ * @param u current_floor_ptr->grid_arrayテンプレートの参照ポインタ
* @param v 未使用
* @param a スワップするモンスター種族のID1
* @param b スワップするモンスター種族のID2
{
/*** Not a saved floor ***/
- wr_s16b(dun_level);
+ wr_s16b((s16b)current_floor_ptr->dun_level);
}
else
{
/*** The saved floor ***/
wr_s16b(sf_ptr->floor_id);
- wr_byte(sf_ptr->savefile_id);
- wr_s16b(sf_ptr->dun_level);
+ wr_byte((byte_hack)sf_ptr->savefile_id);
+ wr_s16b((s16b)sf_ptr->dun_level);
wr_s32b(sf_ptr->last_visit);
wr_u32b(sf_ptr->visit_mark);
wr_s16b(sf_ptr->upper_floor_id);
wr_s16b(sf_ptr->lower_floor_id);
}
- wr_u16b(base_level);
- wr_u16b(num_repro);
+ wr_u16b((u16b)current_floor_ptr->base_level);
+ wr_u16b((s16b)num_repro);
wr_u16b((u16b)p_ptr->y);
wr_u16b((u16b)p_ptr->x);
- wr_u16b(cur_hgt);
- wr_u16b(cur_wid);
+ wr_u16b((u16b)current_floor_ptr->height);
+ wr_u16b((u16b)current_floor_ptr->width);
wr_byte(p_ptr->feeling);
- /*********** Make template for cave_type **********/
+ /*********** Make template for grid_type **********/
/*
* Usually number of templates are fewer than 255. Even if
C_MAKE(templates, max_num_temp, cave_template_type);
/* Extract template array */
- for (y = 0; y < cur_hgt; y++)
+ for (y = 0; y < current_floor_ptr->height; y++)
{
- for (x = 0; x < cur_wid; x++)
+ for (x = 0; x < current_floor_ptr->width; x++)
{
- cave_type *c_ptr = &cave[y][x];
+ grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
for (i = 0; i < num_temp; i++)
{
- 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)
+ if (templates[i].info == g_ptr->info &&
+ templates[i].feat == g_ptr->feat &&
+ templates[i].mimic == g_ptr->mimic &&
+ templates[i].special == g_ptr->special)
{
/* Same terrain is exist */
templates[i].occurrence++;
}
/* Add new template */
- 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].info = g_ptr->info;
+ templates[num_temp].feat = g_ptr->feat;
+ templates[num_temp].mimic = g_ptr->mimic;
+ templates[num_temp].special = g_ptr->special;
templates[num_temp].occurrence = 1;
/* Increase number of template */
cave_template_type *ct_ptr = &templates[i];
/* Dump it */
- wr_u16b(ct_ptr->info);
+ wr_u16b((u16b)ct_ptr->info);
wr_s16b(ct_ptr->feat);
wr_s16b(ct_ptr->mimic);
wr_s16b(ct_ptr->special);
- /*** "Run-Length-Encoding" of cave ***/
+ /*** "Run-Length-Encoding" of current_floor_ptr->grid_array ***/
/* Note that this will induce two wasted bytes */
count = 0;
prev_u16b = 0;
- /* Dump the cave */
- for (y = 0; y < cur_hgt; y++)
+ /* Dump the current_floor_ptr->grid_array */
+ for (y = 0; y < current_floor_ptr->height; y++)
{
- for (x = 0; x < cur_wid; x++)
+ for (x = 0; x < current_floor_ptr->width; x++)
{
- cave_type *c_ptr = &cave[y][x];
+ grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
for (i = 0; i < num_temp; i++)
{
- 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)
+ if (templates[i].info == g_ptr->info &&
+ templates[i].feat == g_ptr->feat &&
+ templates[i].mimic == g_ptr->mimic &&
+ templates[i].special == g_ptr->special)
break;
}
/* Extract an ID */
- tmp16u = i;
+ tmp16u = (u16b)i;
/* If the run is broken, or too full, flush it */
if ((tmp16u != prev_u16b) || (count == MAX_UCHAR))
saved_floor_type *cur_sf_ptr;
int i;
- /* Forget the lite */
forget_lite();
-
- /* Forget the view */
forget_view();
-
- /* Forget the view */
clear_mon_lite();
/* Update lite/view */
p_ptr->update |= (PU_VIEW | PU_LITE | PU_MON_LITE);
-
- /* Update monsters */
p_ptr->update |= (PU_MONSTERS | PU_DISTANCE | PU_FLOW);
-
/*** Meta info ***/
/* Number of floor_id used from birth */
wr_s16b(max_floor_id);
/* Current dungeon type */
- wr_byte(dungeon_type);
+ wr_byte((byte_hack)p_ptr->dungeon_idx);
/*** No saved floor (On the surface etc.) ***/
saved_floor_type *sf_ptr = &saved_floors[i];
wr_s16b(sf_ptr->floor_id);
- wr_byte(sf_ptr->savefile_id);
- wr_s16b(sf_ptr->dun_level);
+ wr_byte((byte_hack)sf_ptr->savefile_id);
+ wr_s16b((s16b)sf_ptr->dun_level);
wr_s32b(sf_ptr->last_visit);
wr_u32b(sf_ptr->visit_mark);
wr_s16b(sf_ptr->upper_floor_id);
u16b tmp16u;
u32b tmp32u;
+ MONRACE_IDX r_idx;
+ KIND_OBJECT_IDX k_idx;
/* Compact the objects */
compact_objects(0);
compact_monsters(0);
/* Guess at the current time */
- now = time((time_t *)0);
+ now = (u32b)time((time_t *)0);
/* Note the operating system */
wr_string(message_str((s16b)i));
}
-
/* Dump the monster lore */
tmp16u = max_r_idx;
wr_u16b(tmp16u);
- for (i = 0; i < tmp16u; i++) wr_lore(i);
-
+ for (r_idx = 0; r_idx < tmp16u; r_idx++) wr_lore(r_idx);
/* Dump the object memory */
tmp16u = max_k_idx;
wr_u16b(tmp16u);
- for (i = 0; i < tmp16u; i++) wr_xtra(i);
+ for (k_idx = 0; k_idx < tmp16u; k_idx++) wr_xtra(k_idx);
/* Dump the towns */
tmp16u = max_towns;
wr_u16b(tmp16u);
/* Dump the quests */
- tmp16u = max_quests;
+ tmp16u = max_q_idx;
wr_u16b(tmp16u);
/* Dump the quests */
tmp8u = MAX_RANDOM_QUEST-MIN_RANDOM_QUEST;
wr_byte(tmp8u);
- for (i = 0; i < max_quests; i++)
+ for (i = 0; i < max_q_idx; i++)
{
quest_type* const q_ptr = &quest[i];
/* And the dungeon level too */
/* (prevents problems with multi-level quests) */
- wr_s16b(q_ptr->level);
+ wr_s16b((s16b)q_ptr->level);
- wr_byte(q_ptr->complev);
+ wr_byte((byte_hack)q_ptr->complev);
wr_u32b(q_ptr->comptime);
/* Save quest status if quest is running */
if (q_ptr->status == QUEST_STATUS_TAKEN || q_ptr->status == QUEST_STATUS_COMPLETED || !is_fixed_quest_idx(i))
{
- wr_s16b(q_ptr->cur_num);
- wr_s16b(q_ptr->max_num);
+ wr_s16b((s16b)q_ptr->cur_num);
+ wr_s16b((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);
+ wr_byte((byte_hack)q_ptr->flags);
+ wr_byte((byte_hack)q_ptr->dungeon);
}
}
wr_u16b(tmp16u);
for (i = 0; i < tmp16u; i++)
{
- wr_s16b(p_ptr->player_hp[i]);
+ wr_s16b((s16b)p_ptr->player_hp[i]);
}
/* Dump the ordered spells */
for (i = 0; i < 64; i++)
{
- wr_byte(p_ptr->spell_order[i]);
+ wr_byte((byte_hack)p_ptr->spell_order[i]);
}
{
for (j = 0; j < MAX_STORES; j++)
{
- wr_store(&town[i].store[j]);
+ wr_store(&town_info[i].store[j]);
}
}
* Medium level player saver
* @return 成功すればtrue
* @details
- * XXX XXX XXX Angband 2.8.0 will use "fd" instead of "fff" if possible
+ * Angband 2.8.0 will use "fd" instead of "fff" if possible
*/
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();
*/
bool save_player(void)
{
- int result = FALSE;
+ bool result = FALSE;
- char safe[1024];
+ char safe[1024];
#ifdef SET_UID
struct stat statbuf;
#endif
- cptr what = "generic";
+ concptr what = "generic";
/* Paranoia */
#if !defined(MACINTOSH) && !defined(WINDOWS)
- /* XXX XXX XXX Fix this */
+ /* Fix this */
/* Verify the existance of the savefile */
if (access(savefile, 0) < 0)
/* Oops, lock exists */
if (fkk)
{
- /* Close the file */
my_fclose(fkk);
- /* Message */
msg_print(_("セーブファイルは現在使用中です。", "Savefile is currently in use."));
msg_print(NULL);
- /* Oops */
return (FALSE);
}
#endif
- /* Okay */
if (!err)
{
/* Open the savefile */
/* What */
if (err) what = _("セーブファイルを読めません。", "Cannot read savefile");
-
- /* Close the file */
(void)fd_close(fd);
}
z_patch = vvv[2];
sf_extra = vvv[3];
-
- /* Clear screen */
Term_clear();
/* Attempt to load */
if (sf_when > (statbuf.st_ctime + 100) ||
sf_when < (statbuf.st_ctime - 100))
{
- /* Message */
what = _("無効なタイム・スタンプです", "Invalid timestamp");
- /* Oops */
err = -1;
}
}
#endif
- /* Okay */
if (!err)
{
/* Give a conversion warning */
}
else
{
- /* Message */
-#ifdef JP
- msg_format("バージョン %d.%d.%d 用のセーブ・ファイルを変換しました。",
- (z_major > 9) ? z_major-10 : z_major , z_minor, z_patch);
-#else
- msg_format("Converted a %d.%d.%d savefile.",
+ msg_format(_("バージョン %d.%d.%d 用のセーブ・ファイルを変換しました。", "Converted a %d.%d.%d savefile."),
(z_major > 9) ? z_major-10 : z_major , z_minor, z_patch);
-#endif
}
msg_print(NULL);
}
{
/* A character was loaded */
character_loaded = TRUE;
-
- /* Done */
return (TRUE);
}
/* Count lives */
sf_lives++;
- /* Done */
return (TRUE);
}
#endif
+ msg_format(_("エラー(%s)がバージョン%d.%d.%d 用セーブファイル読み込み中に発生。", "Error (%s) reading %d.%d.%d savefile."),
+ what, (z_major>9) ? z_major - 10 : z_major, z_minor, z_patch);
- /* Message */
-#ifdef JP
- msg_format("エラー(%s)がバージョン%d.%d.%d 用セーブファイル読み込中に発生。",
- what, (z_major>9) ? z_major - 10 : z_major, z_minor, z_patch);
-#else
- msg_format("Error (%s) reading %d.%d.%d savefile.",
- what, (z_major>9) ? z_major - 10 : z_major, z_minor, z_patch);
-#endif
msg_print(NULL);
- /* Oops */
return (FALSE);
}
* @param mode 保存オプション
* @return なし
*/
-bool save_floor(saved_floor_type *sf_ptr, u32b mode)
+bool save_floor(saved_floor_type *sf_ptr, BIT_FLAGS mode)
{
FILE *old_fff = NULL;
byte old_xor_byte = 0;