OSDN Git Service

[Fix] 施設入場不可メッセージがズレるエラーを修正。
authorDeskull <61610939+sikabane-works@users.noreply.github.com>
Sun, 26 Nov 2023 09:31:30 +0000 (18:31 +0900)
committerDeskull <61610939+sikabane-works@users.noreply.github.com>
Sun, 26 Nov 2023 09:35:10 +0000 (18:35 +0900)
* 表示前にメインウィンドウの `term_type` 内 `offset_x` と `offset_y`
  が先に `TermCenteredOffsetSetter`
  でウィンドウサイズに応じて中央に回ってしまうのが原因だった。

src/cmd-building/cmd-building.cpp

index fcdd267..540fb45 100644 (file)
@@ -318,8 +318,6 @@ void do_cmd_building(PlayerType *player_ptr)
         return;
     }
 
-    TermCenteredOffsetSetter tcos(MAIN_TERM_MIN_COLS, MAIN_TERM_MIN_ROWS);
-
     int which = player_ptr->current_floor_ptr->get_grid(p_pos).get_terrain().subtype;
 
     building_type *bldg;
@@ -346,6 +344,8 @@ void do_cmd_building(PlayerType *player_ptr)
         return;
     }
 
+    TermCenteredOffsetSetter tcos(MAIN_TERM_MIN_COLS, MAIN_TERM_MIN_ROWS);
+
     auto &system = AngbandSystem::get_instance();
     if (system.is_phase_out()) {
         prepare_change_floor_mode(player_ptr, CFM_SAVE_FLOORS | CFM_NO_RETURN);