• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revision8aa8762952f74c69d57db4f6461e974c68bcda26 (tree)
Time2019-02-20 23:38:40
AuthorDeskull <deskull@user...>
CommiterDeskull

Log Message

[Refactor] #37353 set_bound_perm_wall() を place_bound_perm_wall() に改名して grid.c に移動。 / Rename set_bound_perm_wall() to place_bound_perm_wall() and move to grid.c.

Change Summary

Incremental Difference

--- a/src/floor-generate.c
+++ b/src/floor-generate.c
@@ -462,36 +462,6 @@ bool place_quest_monsters(void)
462462 return TRUE;
463463 }
464464
465-
466-/*!
467- * @brief マスにフロア端用の永久壁を配置する / Set boundary mimic and add "solid" perma-wall
468- * @param g_ptr 永久壁を廃止したいマス構造体の参照ポインタ
469- * @return なし
470- */
471-static void set_bound_perm_wall(grid_type *g_ptr)
472-{
473- if (bound_walls_perm)
474- {
475- /* Clear boundary mimic */
476- g_ptr->mimic = 0;
477- }
478- else
479- {
480- feature_type *f_ptr = &f_info[g_ptr->feat];
481-
482- /* Hack -- Decline boundary walls with known treasure */
483- if ((have_flag(f_ptr->flags, FF_HAS_GOLD) || have_flag(f_ptr->flags, FF_HAS_ITEM)) &&
484- !have_flag(f_ptr->flags, FF_SECRET))
485- g_ptr->feat = feat_state(g_ptr->feat, FF_ENSECRET);
486-
487- /* Set boundary mimic */
488- g_ptr->mimic = g_ptr->feat;
489- }
490-
491- /* Add "solid" perma-wall */
492- place_solid_perm_grid(g_ptr);
493-}
494-
495465 /*!
496466 * @brief フロアに洞窟や湖を配置する / Generate various caverns and lakes
497467 * @details There were moved from cave_gen().
@@ -899,15 +869,15 @@ static bool cave_gen(void)
899869 /* Special boundary walls -- Top and bottom */
900870 for (x = 0; x < cur_wid; x++)
901871 {
902- set_bound_perm_wall(&grid_array[0][x]);
903- set_bound_perm_wall(&grid_array[cur_hgt - 1][x]);
872+ place_bound_perm_wall(&grid_array[0][x]);
873+ place_bound_perm_wall(&grid_array[cur_hgt - 1][x]);
904874 }
905875
906876 /* Special boundary walls -- Left and right */
907877 for (y = 1; y < (cur_hgt - 1); y++)
908878 {
909- set_bound_perm_wall(&grid_array[y][0]);
910- set_bound_perm_wall(&grid_array[y][cur_wid - 1]);
879+ place_bound_perm_wall(&grid_array[y][0]);
880+ place_bound_perm_wall(&grid_array[y][cur_wid - 1]);
911881 }
912882
913883 /* Determine the character location */
--- a/src/grid.c
+++ b/src/grid.c
@@ -749,4 +749,31 @@ void set_floor(POSITION x, POSITION y)
749749 place_floor_bold(y, x);
750750 }
751751
752+/*!
753+ * @brief マスにフロア端用の永久壁を配置する / Set boundary mimic and add "solid" perma-wall
754+ * @param g_ptr 永久壁を配置したいマス構造体の参照ポインタ
755+ * @return なし
756+ */
757+void place_bound_perm_wall(grid_type *g_ptr)
758+{
759+ if (bound_walls_perm)
760+ {
761+ /* Clear boundary mimic */
762+ g_ptr->mimic = 0;
763+ }
764+ else
765+ {
766+ feature_type *f_ptr = &f_info[g_ptr->feat];
767+
768+ /* Hack -- Decline boundary walls with known treasure */
769+ if ((have_flag(f_ptr->flags, FF_HAS_GOLD) || have_flag(f_ptr->flags, FF_HAS_ITEM)) &&
770+ !have_flag(f_ptr->flags, FF_SECRET))
771+ g_ptr->feat = feat_state(g_ptr->feat, FF_ENSECRET);
752772
773+ /* Set boundary mimic */
774+ g_ptr->mimic = g_ptr->feat;
775+ }
776+
777+ /* Add "solid" perma-wall */
778+ place_solid_perm_grid(g_ptr);
779+}
--- a/src/grid.h
+++ b/src/grid.h
@@ -281,4 +281,5 @@ extern void vault_traps(POSITION y, POSITION x, POSITION yd, POSITION xd, int nu
281281
282282 extern bool get_is_floor(POSITION x, POSITION y);
283283 extern void set_floor(POSITION x, POSITION y);
284+extern void place_bound_perm_wall(grid_type *g_ptr);
284285
Show on old repository browser