OSDN Git Service

[Refactor] #40577 Moved player_has_los_bold() from floor.h to cave.c/h
authorHourier <hourier@users.sourceforge.jp>
Sat, 18 Jul 2020 13:47:33 +0000 (22:47 +0900)
committerHourier <hourier@users.sourceforge.jp>
Sat, 18 Jul 2020 13:47:33 +0000 (22:47 +0900)
14 files changed:
src/cmd-action/cmd-mane.c
src/effect/effect-item.c
src/floor/cave.c
src/floor/cave.h
src/floor/floor.h
src/floor/geometry.c
src/mind/mind-switcher.c
src/monster-floor/monster-object.c
src/monster-floor/monster-runaway.c
src/monster/monster-status.c
src/monster/monster-update.c
src/mspell/mspell-learn-checker.c
src/spell-kind/spells-sight.c
src/spell-kind/spells-world.c

index aa82475..cfd807f 100644 (file)
@@ -16,8 +16,9 @@
 #include "core/player-redraw-types.h"
 #include "core/stuff-handler.h"
 #include "core/window-redrawer.h"
-#include "floor/floor-object.h"
+#include "floor/cave.h"
 #include "floor/floor.h"
+#include "floor/floor-object.h"
 #include "game-option/disturbance-options.h"
 #include "game-option/text-display-options.h"
 #include "grid/grid.h"
index 3361b6d..3f0f2ff 100644 (file)
@@ -2,8 +2,8 @@
 #include "autopick/autopick.h"
 #include "flavor/flavor-describer.h"
 #include "flavor/object-flavor-types.h"
+#include "floor/cave.h"
 #include "floor/floor-object.h"
-#include "floor/floor.h"
 #include "monster-floor/monster-summon.h"
 #include "monster-floor/place-monster-types.h"
 #include "monster/monster-info.h"
index 49a19b8..4055861 100644 (file)
@@ -32,3 +32,11 @@ bool cave_have_flag_bold(floor_type *floor_ptr, POSITION y, POSITION x, feature_
 {
     return have_flag(f_info[floor_ptr->grid_array[y][x].feat].flags, f_idx);
 }
+
+/*
+ * Determine if a "legal" grid is within "los" of the player
+ */
+bool player_has_los_bold(player_type *player_ptr, POSITION y, POSITION x)
+{
+    return ((player_ptr->current_floor_ptr->grid_array[y][x].info & CAVE_VIEW) != 0) || player_ptr->phase_out;
+}
index ee839df..bf4e4f6 100644 (file)
@@ -7,3 +7,4 @@ bool in_bounds(floor_type *floor_ptr, POSITION y, POSITION x);
 bool in_bounds2(floor_type *floor_ptr, POSITION y, POSITION x);
 bool in_bounds2u(floor_type *floor_ptr, POSITION y, POSITION x);
 bool cave_have_flag_bold(floor_type *floor_ptr, POSITION y, POSITION x, feature_flag_type f_idx);
+bool player_has_los_bold(player_type *player_ptr, POSITION y, POSITION x);
index 5832128..bdbd2d4 100644 (file)
@@ -104,15 +104,6 @@ extern floor_type floor_info;
     (((C)->info & (CAVE_VIEW)) != 0)
 
 /*
- * Determine if a "legal" grid is within "los" of the player
- *
- * Note the use of comparison to zero to force a "boolean" result
- */
-#define player_has_los_bold(C,Y,X) \
-    ((((C)->current_floor_ptr->grid_array[Y][X].info & (CAVE_VIEW)) != 0) || (C)->phase_out)
-
-
-/*
  * Determine if a "feature" is "permanent wall"
  */
 #define permanent_wall(F) \
index c635d0d..f542b82 100644 (file)
@@ -1,4 +1,5 @@
 #include "floor/geometry.h"
+#include "floor/cave.h"
 #include "floor/floor.h"
 #include "game-option/text-display-options.h"
 #include "grid/feature.h"
index d7039f2..184f5ef 100644 (file)
@@ -28,6 +28,7 @@
 #include "core/window-redrawer.h"
 #include "effect/effect-characteristics.h"
 #include "effect/spells-effect-util.h"
+#include "floor/cave.h"
 #include "floor/floor.h"
 #include "game-option/disturbance-options.h"
 #include "game-option/input-options.h"
index 53b411c..3fc0de4 100644 (file)
@@ -7,7 +7,7 @@
 #include "monster-floor/monster-object.h"
 #include "flavor/flavor-describer.h"
 #include "floor/floor-object.h"
-#include "floor/floor.h"
+#include "floor/cave.h"
 #include "grid/grid.h"
 #include "monster-race/monster-race.h"
 #include "monster-race/race-flags-resistance.h"
index cd1f097..4e301ff 100644 (file)
@@ -7,6 +7,7 @@
 #include "monster-floor/monster-runaway.h"
 #include "core/disturbance.h"
 #include "dungeon/quest.h"
+#include "floor/cave.h"
 #include "floor/floor.h"
 #include "grid/grid.h"
 #include "monster-race/monster-race.h"
index b7f76c3..b14e417 100644 (file)
@@ -9,6 +9,7 @@
 #include "core/window-redrawer.h"
 #include "dungeon/dungeon-flag-types.h"
 #include "dungeon/dungeon.h"
+#include "floor/cave.h"
 #include "floor/floor.h"
 #include "game-option/birth-options.h"
 #include "game-option/play-record-options.h"
index c4901e2..bc0a114 100644 (file)
@@ -11,6 +11,7 @@
 #include "core/window-redrawer.h"
 #include "dungeon/dungeon-flag-types.h"
 #include "dungeon/dungeon.h"
+#include "floor/cave.h"
 #include "floor/floor.h"
 #include "game-option/birth-options.h"
 #include "game-option/disturbance-options.h"
index 2a32e04..cf8c356 100644 (file)
@@ -1,5 +1,5 @@
 #include "mspell-learn-checker.h"
-#include "floor/floor.h"
+#include "floor/cave.h"
 #include "grid/grid.h"
 #include "system/floor-type-definition.h"
 #include "world/world.h"
index 7d67afc..ed32818 100644 (file)
@@ -3,6 +3,7 @@
 #include "core/stuff-handler.h"
 #include "core/window-redrawer.h"
 #include "effect/effect-characteristics.h"
+#include "floor/cave.h"
 #include "floor/floor.h"
 #include "game-option/birth-options.h"
 #include "grid/grid.h"
index 794ea5b..38bc9e4 100644 (file)
@@ -4,6 +4,7 @@
 #include "core/player-redraw-types.h"
 #include "dungeon/dungeon.h"
 #include "dungeon/quest.h"
+#include "floor/cave.h"
 #include "floor/floor-save.h"
 #include "floor/floor-town.h"
 #include "floor/floor.h"