OSDN Git Service

[Refactor] #38997 build_type7(), build_type8(), build_type17() に floor_type * 引数を追加...
authordeskull <deskull@users.sourceforge.jp>
Wed, 16 Oct 2019 11:12:34 +0000 (20:12 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Wed, 16 Oct 2019 11:12:34 +0000 (20:12 +0900)
src/rooms-vault.c
src/rooms-vault.h
src/rooms.c

index 36ec04c..ad2d491 100644 (file)
@@ -638,7 +638,7 @@ static void build_vault(floor_type *floor_ptr, POSITION yval, POSITION xval, POS
 * @brief タイプ7の部屋…v_info.txtより小型vaultを生成する / Type 7 -- simple vaults (see "v_info.txt")
 * @return なし
 */
-bool build_type7(void)
+bool build_type7(floor_type *floor_ptr)
 {
        vault_type *v_ptr = NULL;
        int dummy;
@@ -672,7 +672,7 @@ bool build_type7(void)
        y = v_ptr->hgt;
 
        /* Some huge vault cannot be ratated to fit in the dungeon */
-       if (x + 2 > p_ptr->current_floor_ptr->height - 2)
+       if (x + 2 > floor_ptr->height - 2)
        {
                /* Forbid 90 or 270 degree ratation */
                transno &= ~1;
@@ -708,7 +708,7 @@ bool build_type7(void)
        msg_format_wizard(CHEAT_DUNGEON, _("小型Vault(%s)を生成しました。", "Lesser vault (%s)."), v_name + v_ptr->name);
 
        /* Hack -- Build the vault */
-       build_vault(p_ptr->current_floor_ptr, yval, xval, v_ptr->hgt, v_ptr->wid,
+       build_vault(floor_ptr, yval, xval, v_ptr->hgt, v_ptr->wid,
                v_text + v_ptr->text, xoffset, yoffset, transno);
 
        return TRUE;
@@ -718,7 +718,7 @@ bool build_type7(void)
 * @brief タイプ8の部屋…v_info.txtより大型vaultを生成する / Type 8 -- greater vaults (see "v_info.txt")
 * @return なし
 */
-bool build_type8(void)
+bool build_type8(floor_type *floor_ptr)
 {
        vault_type *v_ptr;
        int dummy;
@@ -752,7 +752,7 @@ bool build_type8(void)
        y = v_ptr->hgt;
 
        /* Some huge vault cannot be ratated to fit in the dungeon */
-       if (x + 2 > p_ptr->current_floor_ptr->height - 2)
+       if (x + 2 > floor_ptr->height - 2)
        {
                /* Forbid 90 or 270 degree ratation */
                transno &= ~1;
@@ -794,7 +794,7 @@ bool build_type8(void)
        msg_format_wizard(CHEAT_DUNGEON, _("大型固定Vault(%s)を生成しました。", "Greater vault (%s)."), v_name + v_ptr->name);
 
        /* Hack -- Build the vault */
-       build_vault(p_ptr->current_floor_ptr, yval, xval, v_ptr->hgt, v_ptr->wid,
+       build_vault(floor_ptr, yval, xval, v_ptr->hgt, v_ptr->wid,
                v_text + v_ptr->text, xoffset, yoffset, transno);
 
        return TRUE;
@@ -1238,7 +1238,7 @@ bool build_type10(void)
 * @brief タイプ17の部屋…v_info.txtより固定特殊部屋を生成する / Type 17 -- fixed special room (see "v_info.txt")
 * @return なし
 */
-bool build_type17(void)
+bool build_type17(floor_type *floor_ptr)
 {
        vault_type *v_ptr = NULL;
        int dummy;
@@ -1272,7 +1272,7 @@ bool build_type17(void)
        y = v_ptr->hgt;
 
        /* Some huge vault cannot be ratated to fit in the dungeon */
-       if (x + 2 > p_ptr->current_floor_ptr->height - 2)
+       if (x + 2 > floor_ptr->height - 2)
        {
                /* Forbid 90 or 270 degree ratation */
                transno &= ~1;
@@ -1308,7 +1308,7 @@ bool build_type17(void)
        msg_format_wizard(CHEAT_DUNGEON, _("特殊固定部屋(%s)を生成しました。", "Special Fix room (%s)."), v_name + v_ptr->name);
 
        /* Hack -- Build the vault */
-       build_vault(p_ptr->current_floor_ptr, yval, xval, v_ptr->hgt, v_ptr->wid,
+       build_vault(floor_ptr, yval, xval, v_ptr->hgt, v_ptr->wid,
                v_text + v_ptr->text, xoffset, yoffset, transno);
 
        return TRUE;
index ef42056..430f167 100644 (file)
@@ -23,8 +23,8 @@ extern char *v_text;
 
 extern VAULT_IDX max_v_idx;
 
-extern bool build_type7(void);
-extern bool build_type8(void);
+extern bool build_type7(floor_type *floor_ptr);
+extern bool build_type8(floor_type *floor_ptr);
 extern bool build_type10(void);
-extern bool build_type17(void);
+extern bool build_type17(floor_type *floor_ptr);
 
index 4b36ab7..d321f27 100644 (file)
@@ -2092,8 +2092,8 @@ static bool room_build(EFFECT_ID typ)
        case ROOM_T_INNER_FEAT:    return build_type4(p_ptr->current_floor_ptr);
        case ROOM_T_NEST:          return build_type5(p_ptr->current_floor_ptr);
        case ROOM_T_PIT:           return build_type6(p_ptr->current_floor_ptr);
-       case ROOM_T_LESSER_VAULT:  return build_type7();
-       case ROOM_T_GREATER_VAULT: return build_type8();
+       case ROOM_T_LESSER_VAULT:  return build_type7(p_ptr->current_floor_ptr);
+       case ROOM_T_GREATER_VAULT: return build_type8(p_ptr->current_floor_ptr);
        case ROOM_T_FRACAVE:       return build_type9();
        case ROOM_T_RANDOM_VAULT:  return build_type10();
        case ROOM_T_OVAL:          return build_type11(p_ptr->current_floor_ptr);
@@ -2102,7 +2102,7 @@ static bool room_build(EFFECT_ID typ)
        case ROOM_T_TRAP:          return build_type14();
        case ROOM_T_GLASS:         return build_type15();
        case ROOM_T_ARCADE:        return build_type16();
-       case ROOM_T_FIXED:         return build_type17();
+       case ROOM_T_FIXED:         return build_type17(p_ptr->current_floor_ptr);
        }
        return FALSE;
 }