• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

変愚蛮怒のメインリポジトリです


Commit MetaInfo

Revision723f2f1b65664758fa653a38bdaed56e26e03f9d (tree)
Time2003-09-16 16:44:55
Authornothere <nothere@0568...>
Commiternothere

Log Message

lesser vaultやgreater vaultの生成失敗時のreturn FALSEする位置を変更.
また, cheat_room時にはlesser vaultかgreater vaultかを区別して表示する
ようにした.

Change Summary

Incremental Difference

--- a/src/rooms.c
+++ b/src/rooms.c
@@ -2826,18 +2826,16 @@ static void build_vault(int yval, int xval, int ymax, int xmax, cptr data,
28262826 */
28272827 static bool build_type7(void)
28282828 {
2829- vault_type *v_ptr = NULL;
2830- int dummy = 0;
2829+ vault_type *v_ptr;
2830+ int dummy;
28312831 int x, y;
28322832 int xval, yval;
28332833 int xoffset, yoffset;
28342834 int transno;
28352835
28362836 /* Pick a lesser vault */
2837- while (dummy < SAFE_MAX_ATTEMPTS)
2837+ for (dummy = 0; dummy < SAFE_MAX_ATTEMPTS; dummy++)
28382838 {
2839- dummy++;
2840-
28412839 /* Access a random vault record */
28422840 v_ptr = &v_info[randint0(max_v_idx)];
28432841
@@ -2846,7 +2844,18 @@ static bool build_type7(void)
28462844 }
28472845
28482846 /* No lesser vault found */
2849- if (!v_ptr) return FALSE;
2847+ if (dummy >= SAFE_MAX_ATTEMPTS)
2848+ {
2849+ if (cheat_room)
2850+ {
2851+#ifdef JP
2852+ msg_print("警告!小さな地下室を配置できません!");
2853+#else
2854+ msg_print("Warning! Could not place lesser vault!");
2855+#endif
2856+ }
2857+ return FALSE;
2858+ }
28502859
28512860 /* pick type of transformation (0-7) */
28522861 transno = randint0(8);
@@ -2882,32 +2891,19 @@ static bool build_type7(void)
28822891 yoffset = 0;
28832892 }
28842893
2885-
28862894 /* Find and reserve some space in the dungeon. Get center of room. */
28872895 if (!find_space(&yval, &xval, abs(y), abs(x))) return FALSE;
28882896
2889-
2890- if (dummy >= SAFE_MAX_ATTEMPTS)
2891- {
2892- if (cheat_room)
2893- {
2894-#ifdef JP
2895-msg_print("警告!小さな地下室を配置できません!");
2896-#else
2897- msg_print("Warning! Could not place lesser vault!");
2898-#endif
2899-
2900- }
2901- return FALSE;
2902- }
2903-
2904-
29052897 #ifdef FORCE_V_IDX
29062898 v_ptr = &v_info[2];
29072899 #endif
29082900
29092901 /* Message */
2910- if (cheat_room) msg_format("%s", v_name + v_ptr->name);
2902+#ifdef JP
2903+ if (cheat_room) msg_format("小さな地下室(%s)", v_name + v_ptr->name);
2904+#else
2905+ if (cheat_room) msg_format("Lesser vault (%s)", v_name + v_ptr->name);
2906+#endif
29112907
29122908 /* Boost the rating */
29132909 rating += v_ptr->rat;
@@ -2932,18 +2928,16 @@ msg_print("
29322928 */
29332929 static bool build_type8(void)
29342930 {
2935- vault_type *v_ptr = NULL;
2936- int dummy = 0;
2931+ vault_type *v_ptr;
2932+ int dummy;
29372933 int xval, yval;
29382934 int x, y;
29392935 int transno;
29402936 int xoffset, yoffset;
29412937
29422938 /* Pick a greater vault */
2943- while (dummy < SAFE_MAX_ATTEMPTS)
2939+ for (dummy = 0; dummy < SAFE_MAX_ATTEMPTS; dummy++)
29442940 {
2945- dummy++;
2946-
29472941 /* Access a random vault record */
29482942 v_ptr = &v_info[randint0(max_v_idx)];
29492943
@@ -2952,7 +2946,18 @@ static bool build_type8(void)
29522946 }
29532947
29542948 /* No greater vault found */
2955- if (!v_ptr) return FALSE;
2949+ if (dummy >= SAFE_MAX_ATTEMPTS)
2950+ {
2951+ if (cheat_room)
2952+ {
2953+#ifdef JP
2954+ msg_print("警告!巨大な地下室を配置できません!");
2955+#else
2956+ msg_print("Warning! Could not place greater vault!");
2957+#endif
2958+ }
2959+ return FALSE;
2960+ }
29562961
29572962 /* pick type of transformation (0-7) */
29582963 transno = randint0(8);
@@ -2997,28 +3002,16 @@ static bool build_type8(void)
29973002 /* Find and reserve some space in the dungeon. Get center of room. */
29983003 if (!find_space(&yval, &xval, abs(y) + 2, abs(x) + 2)) return FALSE;
29993004
3000-
3001- if (dummy >= SAFE_MAX_ATTEMPTS)
3002- {
3003- if (cheat_room)
3004- {
3005-#ifdef JP
3006-msg_print("警告!巨大な地下室を配置できません!");
3007-#else
3008- msg_print("Warning! Could not place greater vault!");
3009-#endif
3010-
3011- }
3012- return FALSE;
3013- }
3014-
3015-
30163005 #ifdef FORCE_V_IDX
30173006 v_ptr = &v_info[76 + randint1(3)];
30183007 #endif
30193008
30203009 /* Message */
3021- if (cheat_room) msg_format("%s", v_name + v_ptr->name);
3010+#ifdef JP
3011+ if (cheat_room) msg_format("巨大な地下室(%s)", v_name + v_ptr->name);
3012+#else
3013+ if (cheat_room) msg_format("Greater vault (%s)", v_name + v_ptr->name);
3014+#endif
30223015
30233016 /* Boost the rating */
30243017 rating += v_ptr->rat;
Show on old repository browser