void rd_dummy3(void)
{
- u32b tmp32u;
- rd_u32b(&tmp32u);
-
u16b tmp16u;
rd_u16b(&tmp16u);
current_world_ptr->h_ver_patch = H_VER_PATCH;
current_world_ptr->h_ver_minor = H_VER_MINOR;
current_world_ptr->h_ver_major = H_VER_MAJOR;
+ loading_savefile_version = SAVEFILE_VERSION;
u32b tmp32u;
rd_u32b(&tmp32u);
byte old_h_ver_minor = 0;
byte old_h_ver_patch = 0;
byte old_h_ver_extra = 0;
+ u32b old_loading_savefile_version = 0;
if (mode & SLF_SECOND) {
old_fff = loading_savefile;
old_xor_byte = load_xor_byte;
old_h_ver_minor = current_world_ptr->h_ver_minor;
old_h_ver_patch = current_world_ptr->h_ver_patch;
old_h_ver_extra = current_world_ptr->h_ver_extra;
+ old_loading_savefile_version = loading_savefile_version;
}
char floor_savefile[sizeof(savefile) + 32];
current_world_ptr->h_ver_minor = old_h_ver_minor;
current_world_ptr->h_ver_patch = old_h_ver_patch;
current_world_ptr->h_ver_extra = old_h_ver_extra;
+ loading_savefile_version = old_loading_savefile_version;
}
byte old_kanji_code = kanji_code;
#endif
FILE *loading_savefile;
+u32b loading_savefile_version;
byte load_xor_byte; // Old "encryption" byte.
u32b v_check = 0L; // Simple "checksum" on the actual values.
u32b x_check = 0L; // Simple "checksum" on the encoded bytes.
while (n--)
rd_byte(&tmp8u);
}
+
+/**
+ * @brief ロード中のセーブファイルのバージョンが引数で指定したバージョンと比較して古いかどうか調べる
+ *
+ * @param version 比較するセーブファイルのバージョン
+ * @return bool ロード中のセーブファイルのバージョンが version より古いなら true
+ * version と等しいかより新しいなら false
+ */
+bool loading_savefile_version_is_older_than(u32b version)
+{
+ return loading_savefile_version < version;
+}
#include "system/angband.h"
extern FILE *loading_savefile;
+extern u32b loading_savefile_version;
extern byte load_xor_byte;
extern u32b v_check;
extern u32b x_check;
void rd_s32b(s32b *ip);
void rd_string(char *str, int max);
void strip_bytes(int n);
+bool loading_savefile_version_is_older_than(u32b version);
static errr exe_reading_savefile(player_type *creature_ptr)
{
rd_version_info();
+ rd_u32b(&loading_savefile_version);
rd_dummy3();
rd_system_info();
rd_unique_info();
wr_u16b(current_world_ptr->sf_lives);
wr_u16b(current_world_ptr->sf_saves);
- wr_u32b(0L);
+ wr_u32b(SAVEFILE_VERSION);
wr_u16b(0);
wr_byte(0);
enum spell_type { SPELL_NAME = 0, SPELL_DESC = 1, SPELL_INFO = 2, SPELL_CAST = 3, SPELL_FAIL = 4, SPELL_STOP = 5, SPELL_CONT = 6 };
-enum spell_operation : uint16_t {
+enum spell_operation {
SPOP_NONE = 0x0000U,
SPOP_DISPLAY_MES = 0x0001U, // !< スペル処理オプション … メッセージを表示する
SPOP_NO_UPDATE = 0x0002U, // !< スペル処理オプション … ステータス更新を解決後行う
#pragma once
+#include "system/h-type.h"
+
#define VERSION_NAME "Hengband" /*!< バリアント名称 / Name of the version/variant */
/*!
#define H_VER_PATCH FAKE_VER_PATCH /*!< セーブファイル上のバージョン定義(パッチ番号) */
#define H_VER_EXTRA FAKE_VER_EXTRA /*!< セーブファイル上のバージョン定義(エクストラ番号) */
+/** セーブファイルのバージョン */
+constexpr u32b SAVEFILE_VERSION = 1;
+
void put_version(char *buf);