#include "angband.h"
#include "util.h"
+#include "save.h"
+#include "load.h"
+#include "report.h"
#include "artifact.h"
#include "sort.h"
+#include "dungeon.h"
#include "quest.h"
#include "store.h"
#include "wild.h"
#include "objectkind.h"
#include "monsterrace.h"
#include "birth.h"
+#include "bldg.h"
/*
/* Note the operating system */
- sf_system = 0L;
+ current_world_ptr->sf_system = 0L;
/* Note when the file was saved */
- sf_when = now;
+ current_world_ptr->sf_when = now;
/* Note the number of saves */
- sf_saves++;
+ current_world_ptr->sf_saves++;
/*** Actually write the file ***/
wr_byte(H_VER_MAJOR);
/* Operating system */
- wr_u32b(sf_system);
+ wr_u32b(current_world_ptr->sf_system);
/* Time file last saved */
- wr_u32b(sf_when);
+ wr_u32b(current_world_ptr->sf_when);
/* Number of past lives */
- wr_u16b(sf_lives);
+ wr_u16b(current_world_ptr->sf_lives);
/* Number of times saved */
- wr_u16b(sf_saves);
+ wr_u16b(current_world_ptr->sf_saves);
/* Space */
counts_write(0, current_world_ptr->play_time);
/* Successful save */
- character_saved = TRUE;
+ current_world_ptr->character_saved = TRUE;
/* Success */
return (TRUE);
safe_setuid_drop();
/* Hack -- Pretend the character was loaded */
- character_loaded = TRUE;
+ current_world_ptr->character_loaded = TRUE;
#ifdef VERIFY_SAVEFILE
* allowed to save his game when he quits.
*
* We return "TRUE" if the savefile was usable, and we set the global
- * flag "character_loaded" if a real, living, character was loaded.
+ * flag "current_world_ptr->character_loaded" if a real, living, character was loaded.
*
* Note that we always try to load the "current" savefile, even if
* there is no such file, so we must check for "empty" savefile names.
{
/* Extract version */
- z_major = vvv[0];
- z_minor = vvv[1];
- z_patch = vvv[2];
- sf_extra = vvv[3];
+ current_world_ptr->z_major = vvv[0];
+ current_world_ptr->z_minor = vvv[1];
+ current_world_ptr->z_patch = vvv[2];
+ current_world_ptr->sf_extra = vvv[3];
Term_clear();
if (!err && !arg_wizard)
{
/* Hack -- Verify the timestamp */
- if (sf_when > (statbuf.st_ctime + 100) ||
- sf_when < (statbuf.st_ctime - 100))
+ if (current_world_ptr->sf_when > (statbuf.st_ctime + 100) ||
+ current_world_ptr->sf_when < (statbuf.st_ctime - 100))
{
what = _("無効なタイム・スタンプです", "Invalid timestamp");
if (!err)
{
/* Give a conversion warning */
- if ((FAKE_VER_MAJOR != z_major) ||
- (FAKE_VER_MINOR != z_minor) ||
- (FAKE_VER_PATCH != z_patch))
+ if ((FAKE_VER_MAJOR != current_world_ptr->z_major) ||
+ (FAKE_VER_MINOR != current_world_ptr->z_minor) ||
+ (FAKE_VER_PATCH != current_world_ptr->z_patch))
{
- if (z_major == 2 && z_minor == 0 && z_patch == 6)
+ if (current_world_ptr->z_major == 2 && current_world_ptr->z_minor == 0 && current_world_ptr->z_patch == 6)
{
msg_print(_("バージョン 2.0.* 用のセーブファイルを変換しました。", "Converted a 2.0.* savefile."));
}
else
{
msg_format(_("バージョン %d.%d.%d 用のセーブ・ファイルを変換しました。", "Converted a %d.%d.%d savefile."),
- (z_major > 9) ? z_major-10 : z_major , z_minor, z_patch);
+ (current_world_ptr->z_major > 9) ? current_world_ptr->z_major-10 : current_world_ptr->z_major , current_world_ptr->z_minor, current_world_ptr->z_patch);
}
msg_print(NULL);
}
if (arg_wizard)
{
/* A character was loaded */
- character_loaded = TRUE;
+ current_world_ptr->character_loaded = TRUE;
return (TRUE);
}
p_ptr->is_dead = FALSE;
/* Count lives */
- sf_lives++;
+ current_world_ptr->sf_lives++;
return (TRUE);
}
/* A character was loaded */
- character_loaded = TRUE;
+ current_world_ptr->character_loaded = TRUE;
{
u32b tmp = counts_read(2);
#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);
+ what, (current_world_ptr->z_major>9) ? current_world_ptr->z_major - 10 : current_world_ptr->z_major, current_world_ptr->z_minor, current_world_ptr->z_patch);
msg_print(NULL);