変愚蛮怒のメインリポジトリです
Revision | 723f2f1b65664758fa653a38bdaed56e26e03f9d (tree) |
---|---|
Time | 2003-09-16 16:44:55 |
Author | nothere <nothere@0568...> |
Commiter | nothere |
lesser vaultやgreater vaultの生成失敗時のreturn FALSEする位置を変更.
また, cheat_room時にはlesser vaultかgreater vaultかを区別して表示する
ようにした.
@@ -2826,18 +2826,16 @@ static void build_vault(int yval, int xval, int ymax, int xmax, cptr data, | ||
2826 | 2826 | */ |
2827 | 2827 | static bool build_type7(void) |
2828 | 2828 | { |
2829 | - vault_type *v_ptr = NULL; | |
2830 | - int dummy = 0; | |
2829 | + vault_type *v_ptr; | |
2830 | + int dummy; | |
2831 | 2831 | int x, y; |
2832 | 2832 | int xval, yval; |
2833 | 2833 | int xoffset, yoffset; |
2834 | 2834 | int transno; |
2835 | 2835 | |
2836 | 2836 | /* Pick a lesser vault */ |
2837 | - while (dummy < SAFE_MAX_ATTEMPTS) | |
2837 | + for (dummy = 0; dummy < SAFE_MAX_ATTEMPTS; dummy++) | |
2838 | 2838 | { |
2839 | - dummy++; | |
2840 | - | |
2841 | 2839 | /* Access a random vault record */ |
2842 | 2840 | v_ptr = &v_info[randint0(max_v_idx)]; |
2843 | 2841 |
@@ -2846,7 +2844,18 @@ static bool build_type7(void) | ||
2846 | 2844 | } |
2847 | 2845 | |
2848 | 2846 | /* 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 | + } | |
2850 | 2859 | |
2851 | 2860 | /* pick type of transformation (0-7) */ |
2852 | 2861 | transno = randint0(8); |
@@ -2882,32 +2891,19 @@ static bool build_type7(void) | ||
2882 | 2891 | yoffset = 0; |
2883 | 2892 | } |
2884 | 2893 | |
2885 | - | |
2886 | 2894 | /* Find and reserve some space in the dungeon. Get center of room. */ |
2887 | 2895 | if (!find_space(&yval, &xval, abs(y), abs(x))) return FALSE; |
2888 | 2896 | |
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 | - | |
2905 | 2897 | #ifdef FORCE_V_IDX |
2906 | 2898 | v_ptr = &v_info[2]; |
2907 | 2899 | #endif |
2908 | 2900 | |
2909 | 2901 | /* 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 | |
2911 | 2907 | |
2912 | 2908 | /* Boost the rating */ |
2913 | 2909 | rating += v_ptr->rat; |
@@ -2932,18 +2928,16 @@ msg_print(" | ||
2932 | 2928 | */ |
2933 | 2929 | static bool build_type8(void) |
2934 | 2930 | { |
2935 | - vault_type *v_ptr = NULL; | |
2936 | - int dummy = 0; | |
2931 | + vault_type *v_ptr; | |
2932 | + int dummy; | |
2937 | 2933 | int xval, yval; |
2938 | 2934 | int x, y; |
2939 | 2935 | int transno; |
2940 | 2936 | int xoffset, yoffset; |
2941 | 2937 | |
2942 | 2938 | /* Pick a greater vault */ |
2943 | - while (dummy < SAFE_MAX_ATTEMPTS) | |
2939 | + for (dummy = 0; dummy < SAFE_MAX_ATTEMPTS; dummy++) | |
2944 | 2940 | { |
2945 | - dummy++; | |
2946 | - | |
2947 | 2941 | /* Access a random vault record */ |
2948 | 2942 | v_ptr = &v_info[randint0(max_v_idx)]; |
2949 | 2943 |
@@ -2952,7 +2946,18 @@ static bool build_type8(void) | ||
2952 | 2946 | } |
2953 | 2947 | |
2954 | 2948 | /* 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 | + } | |
2956 | 2961 | |
2957 | 2962 | /* pick type of transformation (0-7) */ |
2958 | 2963 | transno = randint0(8); |
@@ -2997,28 +3002,16 @@ static bool build_type8(void) | ||
2997 | 3002 | /* Find and reserve some space in the dungeon. Get center of room. */ |
2998 | 3003 | if (!find_space(&yval, &xval, abs(y) + 2, abs(x) + 2)) return FALSE; |
2999 | 3004 | |
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 | - | |
3016 | 3005 | #ifdef FORCE_V_IDX |
3017 | 3006 | v_ptr = &v_info[76 + randint1(3)]; |
3018 | 3007 | #endif |
3019 | 3008 | |
3020 | 3009 | /* 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 | |
3022 | 3015 | |
3023 | 3016 | /* Boost the rating */ |
3024 | 3017 | rating += v_ptr->rat; |