/* File: init2.c */
+/*
+ * Copyright (c) 1997 Ben Harrison
+ *
+ * This software may be copied and distributed for educational, research,
+ * and not for profit purposes provided that this copyright and statement
+ * are included in all such copies. Other copyrights may also apply.
+ */
+
/* Purpose: Initialization (part 2) -BEN- */
#include "angband.h"
{
#ifdef CHECK_MODIFICATION_TIME
- err = check_modification_date(fd, format("%s_j.txt", filename));
+ err = check_modification_date(fd, format("%s.txt", filename));
#endif /* CHECK_MODIFICATION_TIME */
/* Build the filename */
- path_build(buf, sizeof(buf), ANGBAND_DIR_EDIT, format("%s_j.txt", filename));
+ path_build(buf, sizeof(buf), ANGBAND_DIR_EDIT, format("%s.txt", filename));
/* Open the file */
fp = my_fopen(buf, "r");
/* Parse it */
#ifdef JP
- if (!fp) quit(format("'%s_j.txt'¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó¤Ç¤¤Þ¤»¤ó¡£", filename));
+ if (!fp) quit(format("'%s.txt'¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó¤Ç¤¤Þ¤»¤ó¡£", filename));
#else
if (!fp) quit(format("Cannot open '%s.txt' file.", filename));
#endif
oops = ((err > 0) ? err_str[err] : "̤ÃΤÎ");
/* Oops */
- msg_format("'%s_j.txt'¥Õ¥¡¥¤¥ë¤Î %d ¹ÔÌܤ˥¨¥é¡¼¡£", filename, error_line);
+ msg_format("'%s.txt'¥Õ¥¡¥¤¥ë¤Î %d ¹ÔÌܤ˥¨¥é¡¼¡£", filename, error_line);
msg_format("¥ì¥³¡¼¥É %d ¤Ï '%s' ¥¨¥é¡¼¤¬¤¢¤ê¤Þ¤¹¡£", error_idx, oops);
msg_format("¹½Ê¸ '%s'¡£", buf);
msg_print(NULL);
/* Quit */
- quit(format("'%s_j.txt'¥Õ¥¡¥¤¥ë¤Ë¥¨¥é¡¼", filename));
+ quit(format("'%s.txt'¥Õ¥¡¥¤¥ë¤Ë¥¨¥é¡¼", filename));
#else
/* Error string */
oops = (((err > 0) && (err < PARSE_ERROR_MAX)) ? err_str[err] : "unknown");
#endif
+ /* Grab permissions */
+ safe_setuid_grab();
+
/* Kill the old file */
(void)fd_kill(buf);
/* Attempt to create the raw file */
fd = fd_make(buf, mode);
+ /* Drop permissions */
+ safe_setuid_drop();
+
/* Dump to the file */
if (fd >= 0)
{
/* Dump it */
fd_write(fd, (cptr)(head), head->head_size);
- /* Dump the "*_info" array */
+ /* Dump the "*_info" array */
fd_write(fd, head->info_ptr, head->info_size);
/* Dump the "*_name" array */
#endif /* ALLOW_TEMPLATES */
return init_info("f_info", &f_head,
- (void*)&f_info, (void*)&f_name, (void*)&f_text);
+ (void*)&f_info, (void*)&f_name, NULL);
}
#endif /* ALLOW_TEMPLATES */
return init_info("s_info", &s_head,
- (void*)&s_info, (void*)&s_name, (void*)&s_text);
+ (void*)&s_info, NULL, NULL);
}
#endif /* ALLOW_TEMPLATES */
return init_info("m_info", &m_head,
- (void*)&m_info, (void*)&m_name, (void*)&m_text);
+ (void*)&m_info, NULL, NULL);
}
{ TV_FOOD, SV_FOOD_RATION },
{ TV_FOOD, SV_FOOD_RATION },
- { TV_LITE, SV_LITE_TORCH },
- { TV_LITE, SV_LITE_TORCH },
+ { TV_POTION, SV_POTION_WATER },
+ { TV_POTION, SV_POTION_WATER },
{ TV_LITE, SV_LITE_LANTERN },
{ TV_LITE, SV_LITE_LANTERN },
- { TV_FLASK, 0 },
- { TV_FLASK, 0 },
-
+ { TV_FOOD, SV_FOOD_WAYBREAD },
+ { TV_FOOD, SV_FOOD_WAYBREAD },
{ TV_CAPTURE, 0 },
-
{ TV_FIGURINE, 0 },
{ TV_SHOT, SV_AMMO_NORMAL },
{ TV_SCROLL, SV_SCROLL_DETECT_INVIS },
{ TV_SCROLL, SV_SCROLL_RECHARGING },
- { TV_SCROLL, SV_SCROLL_SATISFY_HUNGER },
+ { TV_SCROLL, SV_SCROLL_TELEPORT },
{ TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
{ TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
{ TV_SCROLL, SV_SCROLL_ENCHANT_ARMOR },
{ TV_SCROLL, SV_SCROLL_RECHARGING },
- { TV_SCROLL, SV_SCROLL_SATISFY_HUNGER },
- { TV_SCROLL, SV_SCROLL_SATISFY_HUNGER },
- { TV_SCROLL, SV_SCROLL_SATISFY_HUNGER }
+ { TV_SCROLL, SV_SCROLL_PHASE_DOOR },
+ { TV_SCROLL, SV_SCROLL_ENCHANT_WEAPON_TO_HIT },
+ { TV_SCROLL, SV_SCROLL_ENCHANT_WEAPON_TO_DAM },
},
static errr init_misc(void)
{
/* Initialize the values */
- process_dungeon_file("misc_j.txt", 0, 0, 0, 0);
+ process_dungeon_file("misc.txt", 0, 0, 0, 0);
return 0;
}
C_MAKE(inventory, INVEN_TOTAL, object_type);
- /*** Pre-allocate the basic "auto-inscriptions" ***/
-
- /* The "basic" feelings */
-#ifdef JP
- (void)quark_add("¼ö¤ï¤ì¤Æ¤¤¤ë");
- (void)quark_add("²õ¤ì¤Æ¤¤¤ë");
- (void)quark_add("ÊÂ");
- (void)quark_add("¾å¼Á");
-#else
- (void)quark_add("cursed");
- (void)quark_add("broken");
- (void)quark_add("average");
- (void)quark_add("good");
-#endif
-
-
- /* The "extra" feelings */
-#ifdef JP
- (void)quark_add("¹âµéÉÊ");
- (void)quark_add("̵²ÁÃÍ");
- (void)quark_add("ÆÃÊÌÀ½");
- (void)quark_add("¶²¤í¤·¤¤");
-#else
- (void)quark_add("excellent");
- (void)quark_add("worthless");
- (void)quark_add("special");
- (void)quark_add("terrible");
-#endif
-
-
- /* Some extra strings */
-#ifdef JP
- (void)quark_add("¼ö¤¤¤Ê¤·");
- (void)quark_add("Çä½ÐÃæ");
-#else
- (void)quark_add("uncursed");
- (void)quark_add("on sale");
-#endif
-
-
-
/*** Prepare the options ***/
/* Scan the options */
{
int fd = -1;
- int mode = 0644;
+ int mode = 0664;
FILE *fp;
/* File type is "DATA" */
FILE_TYPE(FILE_TYPE_DATA);
+ /* Grab permissions */
+ safe_setuid_grab();
+
/* Create a new high score file */
fd = fd_make(buf, mode);
+ /* Drop permissions */
+ safe_setuid_drop();
+
/* Failure */
if (fd < 0)
{
#endif
+ /* Initialize vault info */
+#ifdef JP
+ if (init_v_info()) quit("vault ½é´ü²½ÉÔǽ");
+#else
+ if (init_v_info()) quit("Cannot initialize vaults");
+#endif
+
+
/* Initialize some other arrays */
#ifdef JP
note("[¥Ç¡¼¥¿¤Î½é´ü²½Ãæ... (¤½¤Î¾)]");