• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revisioncc671828e26c0cb2d16d1b3526b3b77b6e8b3081 (tree)
Time2019-02-12 00:04:59
AuthorDeskull <deskull@user...>
CommiterDeskull

Log Message

[Refactor] #37353 cave_type 構造体を grid_type に改名。 / Rename cave_type structure to grid_type.

Change Summary

Incremental Difference

--- a/src/autopick.c
+++ b/src/autopick.c
@@ -1699,7 +1699,7 @@ void autopick_alter_item(INVENTORY_IDX item, bool destroy)
16991699 /*
17001700 * Automatically pickup/destroy items in this grid.
17011701 */
1702-void autopick_pickup_items(cave_type *c_ptr)
1702+void autopick_pickup_items(grid_type *c_ptr)
17031703 {
17041704 OBJECT_IDX this_o_idx, next_o_idx = 0;
17051705
--- a/src/cave.c
+++ b/src/cave.c
@@ -79,7 +79,7 @@ bool is_trap(FEAT_IDX feat)
7979 * @param c_ptr マス構造体の参照ポインタ
8080 * @return 看破済みの罠があるならTRUEを返す。
8181 */
82-bool is_known_trap(cave_type *c_ptr)
82+bool is_known_trap(grid_type *c_ptr)
8383 {
8484 if (!c_ptr->mimic && !cave_have_flag_grid(c_ptr, FF_SECRET) &&
8585 is_trap(c_ptr->feat)) return TRUE;
@@ -105,7 +105,7 @@ bool is_closed_door(FEAT_IDX feat)
105105 * @param c_ptr マス構造体の参照ポインタ
106106 * @return 隠されたドアがあるならTRUEを返す。
107107 */
108-bool is_hidden_door(cave_type *c_ptr)
108+bool is_hidden_door(grid_type *c_ptr)
109109 {
110110 if ((c_ptr->mimic || cave_have_flag_grid(c_ptr, FF_SECRET)) &&
111111 is_closed_door(c_ptr->feat))
@@ -569,7 +569,7 @@ void update_local_illumination(POSITION y, POSITION x)
569569 */
570570 bool player_can_see_bold(POSITION y, POSITION x)
571571 {
572- cave_type *c_ptr;
572+ grid_type *c_ptr;
573573
574574 /* Blind players see nothing */
575575 if (p_ptr->blind) return FALSE;
@@ -617,7 +617,7 @@ bool no_lite(void)
617617 */
618618 bool cave_valid_bold(POSITION y, POSITION x)
619619 {
620- cave_type *c_ptr = &cave[y][x];
620+ grid_type *c_ptr = &cave[y][x];
621621 OBJECT_IDX this_o_idx, next_o_idx = 0;
622622
623623 /* Forbid perma-grids */
@@ -944,7 +944,7 @@ void apply_default_feat_lighting(TERM_COLOR f_attr[F_LIT_MAX], SYMBOL_CODE f_cha
944944 void map_info(POSITION y, POSITION x, TERM_COLOR *ap, char *cp, TERM_COLOR *tap, SYMBOL_CODE *tcp)
945945 {
946946 /* Get the cave */
947- cave_type *c_ptr = &cave[y][x];
947+ grid_type *c_ptr = &cave[y][x];
948948
949949 OBJECT_IDX this_o_idx, next_o_idx = 0;
950950
@@ -1458,7 +1458,7 @@ void print_rel(SYMBOL_CODE c, TERM_COLOR a, TERM_LEN y, TERM_LEN x)
14581458 */
14591459 void note_spot(POSITION y, POSITION x)
14601460 {
1461- cave_type *c_ptr = &cave[y][x];
1461+ grid_type *c_ptr = &cave[y][x];
14621462 OBJECT_IDX this_o_idx, next_o_idx = 0;
14631463
14641464 /* Blind players see nothing */
@@ -1743,7 +1743,7 @@ void prt_path(POSITION y, POSITION x)
17431743 {
17441744 POSITION ny = GRID_Y(path_g[i]);
17451745 POSITION nx = GRID_X(path_g[i]);
1746- cave_type *c_ptr = &cave[ny][nx];
1746+ grid_type *c_ptr = &cave[ny][nx];
17471747
17481748 if (panel_contains(ny, nx))
17491749 {
@@ -2557,7 +2557,7 @@ void update_lite(void)
25572557 {
25582558 int i, x, y, min_x, max_x, min_y, max_y;
25592559 int p = p_ptr->cur_lite;
2560- cave_type *c_ptr;
2560+ grid_type *c_ptr;
25612561
25622562 /*** Special case ***/
25632563
@@ -2781,7 +2781,7 @@ static POSITION mon_fy, mon_fx;
27812781 */
27822782 static void mon_lite_hack(POSITION y, POSITION x)
27832783 {
2784- cave_type *c_ptr;
2784+ grid_type *c_ptr;
27852785 int dpf, d;
27862786 POSITION midpoint;
27872787
@@ -2868,7 +2868,7 @@ static void mon_lite_hack(POSITION y, POSITION x)
28682868 */
28692869 static void mon_dark_hack(POSITION y, POSITION x)
28702870 {
2871- cave_type *c_ptr;
2871+ grid_type *c_ptr;
28722872 int midpoint, dpf, d;
28732873
28742874 /* We trust this grid is in bounds */
@@ -2951,7 +2951,7 @@ static void mon_dark_hack(POSITION y, POSITION x)
29512951 void update_mon_lite(void)
29522952 {
29532953 int i, rad;
2954- cave_type *c_ptr;
2954+ grid_type *c_ptr;
29552955
29562956 POSITION fx, fy;
29572957 void (*add_mon_lite)(POSITION, POSITION);
@@ -3269,7 +3269,7 @@ void update_mon_lite(void)
32693269 void clear_mon_lite(void)
32703270 {
32713271 int i;
3272- cave_type *c_ptr;
3272+ grid_type *c_ptr;
32733273
32743274 /* Clear all monster lit squares */
32753275 for (i = 0; i < mon_lite_n; i++)
@@ -3294,7 +3294,7 @@ void forget_view(void)
32943294 {
32953295 int i;
32963296
3297- cave_type *c_ptr;
3297+ grid_type *c_ptr;
32983298
32993299 /* None to forget */
33003300 if (!view_n) return;
@@ -3359,10 +3359,10 @@ static bool update_view_aux(POSITION y, POSITION x, POSITION y1, POSITION x1, PO
33593359 {
33603360 bool f1, f2, v1, v2, z1, z2, wall;
33613361
3362- cave_type *c_ptr;
3362+ grid_type *c_ptr;
33633363
3364- cave_type *g1_c_ptr;
3365- cave_type *g2_c_ptr;
3364+ grid_type *g1_c_ptr;
3365+ grid_type *g2_c_ptr;
33663366
33673367 /* Access the grids */
33683368 g1_c_ptr = &cave[y1][x1];
@@ -3551,7 +3551,7 @@ void update_view(void)
35513551 POSITION y_max = cur_hgt - 1;
35523552 POSITION x_max = cur_wid - 1;
35533553
3554- cave_type *c_ptr;
3554+ grid_type *c_ptr;
35553555
35563556 /*** Initialize ***/
35573557
@@ -3996,7 +3996,7 @@ void update_view(void)
39963996 void delayed_visual_update(void)
39973997 {
39983998 int i, y, x;
3999- cave_type *c_ptr;
3999+ grid_type *c_ptr;
40004000
40014001 /* Update needed grids */
40024002 for (i = 0; i < redraw_n; i++)
@@ -4121,7 +4121,7 @@ void update_flow(void)
41214121 int old_head = flow_head;
41224122 byte_hack m = cave[ty][tx].cost + 1;
41234123 byte_hack n = cave[ty][tx].dist + 1;
4124- cave_type *c_ptr;
4124+ grid_type *c_ptr;
41254125
41264126 /* Child location */
41274127 y = ty + ddy_ddd[d];
@@ -4217,7 +4217,7 @@ void update_smell(void)
42174217 {
42184218 for (j = 0; j < 5; j++)
42194219 {
4220- cave_type *c_ptr;
4220+ grid_type *c_ptr;
42214221
42224222 /* Translate table to map grids */
42234223 y = i + p_ptr->y - 2;
@@ -4251,7 +4251,7 @@ void map_area(POSITION range)
42514251 {
42524252 int i;
42534253 POSITION x, y;
4254- cave_type *c_ptr;
4254+ grid_type *c_ptr;
42554255 FEAT_IDX feat;
42564256 feature_type *f_ptr;
42574257
@@ -4354,7 +4354,7 @@ void wiz_lite(bool ninja)
43544354 /* Scan all normal grids */
43554355 for (x = 1; x < cur_wid - 1; x++)
43564356 {
4357- cave_type *c_ptr = &cave[y][x];
4357+ grid_type *c_ptr = &cave[y][x];
43584358
43594359 /* Memorize terrain of the grid */
43604360 c_ptr->info |= (CAVE_KNOWN);
@@ -4430,7 +4430,7 @@ void wiz_dark(void)
44304430 {
44314431 for (x = 1; x < cur_wid - 1; x++)
44324432 {
4433- cave_type *c_ptr = &cave[y][x];
4433+ grid_type *c_ptr = &cave[y][x];
44344434
44354435 /* Process the grid */
44364436 c_ptr->info &= ~(CAVE_MARK | CAVE_IN_DETECT | CAVE_KNOWN);
@@ -4482,7 +4482,7 @@ void wiz_dark(void)
44824482 */
44834483 void cave_set_feat(POSITION y, POSITION x, FEAT_IDX feat)
44844484 {
4485- cave_type *c_ptr = &cave[y][x];
4485+ grid_type *c_ptr = &cave[y][x];
44864486 feature_type *f_ptr = &f_info[feat];
44874487 bool old_los, old_mirror;
44884488
@@ -4559,7 +4559,7 @@ void cave_set_feat(POSITION y, POSITION x, FEAT_IDX feat)
45594559 {
45604560 DIRECTION i;
45614561 POSITION yy, xx;
4562- cave_type *cc_ptr;
4562+ grid_type *cc_ptr;
45634563
45644564 for (i = 0; i < 9; i++)
45654565 {
@@ -4701,7 +4701,7 @@ void cave_alter_feat(POSITION y, POSITION x, int action)
47014701 /* Remove a mirror */
47024702 void remove_mirror(POSITION y, POSITION x)
47034703 {
4704- cave_type *c_ptr = &cave[y][x];
4704+ grid_type *c_ptr = &cave[y][x];
47054705
47064706 /* Remove the mirror */
47074707 c_ptr->info &= ~(CAVE_OBJECT);
@@ -4725,7 +4725,7 @@ void remove_mirror(POSITION y, POSITION x)
47254725 /*
47264726 * Return TRUE if there is a mirror on the grid.
47274727 */
4728-bool is_mirror_grid(cave_type *c_ptr)
4728+bool is_mirror_grid(grid_type *c_ptr)
47294729 {
47304730 if ((c_ptr->info & CAVE_OBJECT) && have_flag(f_info[c_ptr->mimic].flags, FF_MIRROR))
47314731 return TRUE;
@@ -4737,7 +4737,7 @@ bool is_mirror_grid(cave_type *c_ptr)
47374737 /*
47384738 * Return TRUE if there is a mirror on the grid.
47394739 */
4740-bool is_glyph_grid(cave_type *c_ptr)
4740+bool is_glyph_grid(grid_type *c_ptr)
47414741 {
47424742 if ((c_ptr->info & CAVE_OBJECT) && have_flag(f_info[c_ptr->mimic].flags, FF_GLYPH))
47434743 return TRUE;
@@ -4749,7 +4749,7 @@ bool is_glyph_grid(cave_type *c_ptr)
47494749 /*
47504750 * Return TRUE if there is a mirror on the grid.
47514751 */
4752-bool is_explosive_rune_grid(cave_type *c_ptr)
4752+bool is_explosive_rune_grid(grid_type *c_ptr)
47534753 {
47544754 if ((c_ptr->info & CAVE_OBJECT) && have_flag(f_info[c_ptr->mimic].flags, FF_MINOR_GLYPH))
47554755 return TRUE;
@@ -5013,7 +5013,7 @@ void glow_deep_lava_and_bldg(void)
50135013 {
50145014 POSITION y, x, yy, xx;
50155015 DIRECTION i;
5016- cave_type *c_ptr;
5016+ grid_type *c_ptr;
50175017
50185018 /* Not in the darkness dungeon */
50195019 if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) return;
@@ -5056,7 +5056,7 @@ void glow_deep_lava_and_bldg(void)
50565056 bool cave_monster_teleportable_bold(MONSTER_IDX m_idx, POSITION y, POSITION x, BIT_FLAGS mode)
50575057 {
50585058 monster_type *m_ptr = &m_list[m_idx];
5059- cave_type *c_ptr = &cave[y][x];
5059+ grid_type *c_ptr = &cave[y][x];
50605060 feature_type *f_ptr = &f_info[c_ptr->feat];
50615061
50625062 /* Require "teleportable" space */
@@ -5086,7 +5086,7 @@ bool cave_monster_teleportable_bold(MONSTER_IDX m_idx, POSITION y, POSITION x, B
50865086 */
50875087 bool cave_player_teleportable_bold(POSITION y, POSITION x, BIT_FLAGS mode)
50885088 {
5089- cave_type *c_ptr = &cave[y][x];
5089+ grid_type *c_ptr = &cave[y][x];
50905090 feature_type *f_ptr = &f_info[c_ptr->feat];
50915091
50925092 /* Require "teleportable" space */
--- a/src/cmd-pet.c
+++ b/src/cmd-pet.c
@@ -9,7 +9,7 @@
99 * @param now_riding TRUEなら下馬処理、FALSEならば騎乗処理
1010 * @return 可能ならばTRUEを返す
1111 */
12-bool player_can_ride_aux(cave_type *c_ptr, bool now_riding)
12+bool player_can_ride_aux(grid_type *c_ptr, bool now_riding)
1313 {
1414 bool p_can_enter;
1515 bool old_character_xtra = character_xtra;
@@ -308,7 +308,7 @@ bool do_riding(bool force)
308308 {
309309 POSITION x, y;
310310 DIRECTION dir = 0;
311- cave_type *c_ptr;
311+ grid_type *c_ptr;
312312 monster_type *m_ptr;
313313
314314 if (!get_direction(&dir, FALSE, FALSE)) return FALSE;
@@ -876,7 +876,7 @@ void do_cmd_pet(void)
876876 if (!target_set(TARGET_KILL)) pet_t_m_idx = 0;
877877 else
878878 {
879- cave_type *c_ptr = &cave[target_row][target_col];
879+ grid_type *c_ptr = &cave[target_row][target_col];
880880 if (c_ptr->m_idx && (m_list[c_ptr->m_idx].ml))
881881 {
882882 pet_t_m_idx = cave[target_row][target_col].m_idx;
@@ -1086,7 +1086,7 @@ bool rakuba(HIT_POINT dam, bool force)
10861086 /* Check around the player */
10871087 for (i = 0; i < 8; i++)
10881088 {
1089- cave_type *c_ptr;
1089+ grid_type *c_ptr;
10901090
10911091 /* Access the location */
10921092 y = p_ptr->y + ddy_ddd[i];
--- a/src/cmd-pet.h
+++ b/src/cmd-pet.h
@@ -3,7 +3,7 @@ extern void check_pets_num_and_align(monster_type *m_ptr, bool inc);
33 extern int calculate_upkeep(void);
44 extern void do_cmd_pet_dismiss(void);
55 extern void do_cmd_pet(void);
6-extern bool player_can_ride_aux(cave_type *c_ptr, bool now_riding);
6+extern bool player_can_ride_aux(grid_type *c_ptr, bool now_riding);
77 extern bool rakuba(HIT_POINT dam, bool force);
88
99
--- a/src/cmd2.c
+++ b/src/cmd2.c
@@ -136,7 +136,7 @@ void do_cmd_go_up(void)
136136 bool go_up = FALSE;
137137
138138 /* Player grid */
139- cave_type *c_ptr = &cave[p_ptr->y][p_ptr->x];
139+ grid_type *c_ptr = &cave[p_ptr->y][p_ptr->x];
140140 feature_type *f_ptr = &f_info[c_ptr->feat];
141141
142142 int up_num = 0;
@@ -280,7 +280,7 @@ void do_cmd_go_up(void)
280280 void do_cmd_go_down(void)
281281 {
282282 /* Player grid */
283- cave_type *c_ptr = &cave[p_ptr->y][p_ptr->x];
283+ grid_type *c_ptr = &cave[p_ptr->y][p_ptr->x];
284284 feature_type *f_ptr = &f_info[c_ptr->feat];
285285
286286 bool fall_trap = FALSE;
@@ -477,7 +477,7 @@ void do_cmd_search(void)
477477 */
478478 static OBJECT_IDX chest_check(POSITION y, POSITION x, bool trapped)
479479 {
480- cave_type *c_ptr = &cave[y][x];
480+ grid_type *c_ptr = &cave[y][x];
481481 OBJECT_IDX this_o_idx, next_o_idx = 0;
482482
483483 /* Scan all objects in the grid */
@@ -592,7 +592,7 @@ static int count_dt(POSITION *y, POSITION *x, bool (*test)(IDX feat), bool under
592592 /* Check around (and under) the character */
593593 for (d = 0; d < 9; d++)
594594 {
595- cave_type *c_ptr;
595+ grid_type *c_ptr;
596596 FEAT_IDX feat;
597597
598598 /* if not searching under player continue */
@@ -717,7 +717,7 @@ static bool do_cmd_open_aux(POSITION y, POSITION x)
717717 int i, j;
718718
719719 /* Get requested grid */
720- cave_type *c_ptr = &cave[y][x];
720+ grid_type *c_ptr = &cave[y][x];
721721 feature_type *f_ptr = &f_info[c_ptr->feat];
722722 bool more = FALSE;
723723
@@ -846,7 +846,7 @@ void do_cmd_open(void)
846846 if (get_rep_dir(&dir, TRUE))
847847 {
848848 FEAT_IDX feat;
849- cave_type *c_ptr;
849+ grid_type *c_ptr;
850850
851851 /* Get requested location */
852852 y = p_ptr->y + ddy[dir];
@@ -909,7 +909,7 @@ void do_cmd_open(void)
909909 */
910910 static bool do_cmd_close_aux(POSITION y, POSITION x)
911911 {
912- cave_type *c_ptr = &cave[y][x];
912+ grid_type *c_ptr = &cave[y][x];
913913 FEAT_IDX old_feat = c_ptr->feat;
914914 bool more = FALSE;
915915
@@ -993,7 +993,7 @@ void do_cmd_close(void)
993993 /* Get a "repeated" direction */
994994 if (get_rep_dir(&dir, FALSE))
995995 {
996- cave_type *c_ptr;
996+ grid_type *c_ptr;
997997 FEAT_IDX feat;
998998
999999 y = p_ptr->y + ddy[dir];
@@ -1042,7 +1042,7 @@ void do_cmd_close(void)
10421042 */
10431043 static bool do_cmd_tunnel_test(POSITION y, POSITION x)
10441044 {
1045- cave_type *c_ptr = &cave[y][x];
1045+ grid_type *c_ptr = &cave[y][x];
10461046
10471047 /* Must have knowledge */
10481048 if (!(c_ptr->info & CAVE_MARK))
@@ -1077,7 +1077,7 @@ static bool do_cmd_tunnel_test(POSITION y, POSITION x)
10771077 */
10781078 static bool do_cmd_tunnel_aux(POSITION y, POSITION x)
10791079 {
1080- cave_type *c_ptr;
1080+ grid_type *c_ptr;
10811081 feature_type *f_ptr, *mimic_f_ptr;
10821082 int power;
10831083 concptr name;
@@ -1207,7 +1207,7 @@ void do_cmd_tunnel(void)
12071207 {
12081208 int y, x, dir;
12091209
1210- cave_type *c_ptr;
1210+ grid_type *c_ptr;
12111211 FEAT_IDX feat;
12121212
12131213 bool more = FALSE;
@@ -1295,7 +1295,7 @@ bool easy_open_door(POSITION y, POSITION x)
12951295 {
12961296 int i, j;
12971297
1298- cave_type *c_ptr = &cave[y][x];
1298+ grid_type *c_ptr = &cave[y][x];
12991299 feature_type *f_ptr = &f_info[c_ptr->feat];
13001300
13011301 /* Must be a closed door */
@@ -1466,7 +1466,7 @@ static bool do_cmd_disarm_chest(POSITION y, POSITION x, OBJECT_IDX o_idx)
14661466
14671467 bool do_cmd_disarm_aux(POSITION y, POSITION x, DIRECTION dir)
14681468 {
1469- cave_type *c_ptr = &cave[y][x];
1469+ grid_type *c_ptr = &cave[y][x];
14701470
14711471 /* Get feature */
14721472 feature_type *f_ptr = &f_info[c_ptr->feat];
@@ -1586,7 +1586,7 @@ void do_cmd_disarm(void)
15861586 /* Get a direction (or abort) */
15871587 if (get_rep_dir(&dir,TRUE))
15881588 {
1589- cave_type *c_ptr;
1589+ grid_type *c_ptr;
15901590 FEAT_IDX feat;
15911591
15921592 y = p_ptr->y + ddy[dir];
@@ -1649,7 +1649,7 @@ void do_cmd_disarm(void)
16491649 static bool do_cmd_bash_aux(POSITION y, POSITION x, DIRECTION dir)
16501650 {
16511651 /* Get grid */
1652- cave_type *c_ptr = &cave[y][x];
1652+ grid_type *c_ptr = &cave[y][x];
16531653
16541654 /* Get feature */
16551655 feature_type *f_ptr = &f_info[c_ptr->feat];
@@ -1743,7 +1743,7 @@ static bool do_cmd_bash_aux(POSITION y, POSITION x, DIRECTION dir)
17431743 void do_cmd_bash(void)
17441744 {
17451745 int y, x, dir;
1746- cave_type *c_ptr;
1746+ grid_type *c_ptr;
17471747 bool more = FALSE;
17481748
17491749 if (p_ptr->wild_mode) return;
@@ -1828,7 +1828,7 @@ void do_cmd_alter(void)
18281828 {
18291829 POSITION y, x;
18301830 DIRECTION dir;
1831- cave_type *c_ptr;
1831+ grid_type *c_ptr;
18321832 bool more = FALSE;
18331833
18341834 if (p_ptr->special_defense & KATA_MUSOU)
@@ -1974,7 +1974,7 @@ void do_cmd_spike(void)
19741974 {
19751975 POSITION y, x;
19761976 INVENTORY_IDX item;
1977- cave_type *c_ptr;
1977+ grid_type *c_ptr;
19781978 FEAT_IDX feat;
19791979
19801980 y = p_ptr->y + ddy[dir];
@@ -2600,7 +2600,7 @@ bool do_cmd_throw(int mult, bool boomerang, OBJECT_IDX shuriken)
26002600 /* Monster here, Try to hit it */
26012601 if (cave[y][x].m_idx)
26022602 {
2603- cave_type *c_ptr = &cave[y][x];
2603+ grid_type *c_ptr = &cave[y][x];
26042604 monster_type *m_ptr = &m_list[c_ptr->m_idx];
26052605
26062606 /* Check the visibility */
@@ -2942,7 +2942,7 @@ static int travel_flow_cost(POSITION y, POSITION x)
29422942 */
29432943 static void travel_flow_aux(POSITION y, POSITION x, int n, bool wall)
29442944 {
2945- cave_type *c_ptr = &cave[y][x];
2945+ grid_type *c_ptr = &cave[y][x];
29462946 feature_type *f_ptr = &f_info[c_ptr->feat];
29472947 int old_head = flow_head;
29482948 int add_cost = 1;
--- a/src/cmd4.c
+++ b/src/cmd4.c
@@ -5273,7 +5273,7 @@ static void do_cmd_knowledge_artifacts(void)
52735273 {
52745274 for (x = 0; x < cur_wid; x++)
52755275 {
5276- cave_type *c_ptr = &cave[y][x];
5276+ grid_type *c_ptr = &cave[y][x];
52775277
52785278 OBJECT_IDX this_o_idx, next_o_idx = 0;
52795279
--- a/src/dungeon.c
+++ b/src/dungeon.c
@@ -3405,7 +3405,7 @@ static void process_world(void)
34053405 for (i2 = 0; i2 < cur_wid; ++i2)
34063406 for (j2 = 0; j2 < cur_hgt; j2++)
34073407 {
3408- cave_type *c_ptr = &cave[j2][i2];
3408+ grid_type *c_ptr = &cave[j2][i2];
34093409
34103410 if ((c_ptr->m_idx > 0) && (c_ptr->m_idx != p_ptr->riding))
34113411 {
--- a/src/externs.h
+++ b/src/externs.h
@@ -264,7 +264,7 @@ extern const char angband_term_name[8][16];
264264 extern byte angband_color_table[256][4];
265265 extern const concptr angband_sound_name[SOUND_MAX];
266266 extern const concptr angband_music_basic_name[MUSIC_BASIC_MAX];
267-extern cave_type *cave[MAX_HGT];
267+extern grid_type *cave[MAX_HGT];
268268 extern saved_floor_type saved_floors[MAX_SAVED_FLOORS];
269269 extern FLOOR_IDX max_floor_id;
270270 extern u32b saved_floor_file_sign;
@@ -454,7 +454,7 @@ extern concptr autopick_line_from_entry(autopick_type *entry);
454454 extern int is_autopick(object_type *o_ptr);
455455 extern void autopick_alter_item(INVENTORY_IDX item, bool destroy);
456456 extern void autopick_delayed_alter(void);
457-extern void autopick_pickup_items(cave_type *c_ptr);
457+extern void autopick_pickup_items(grid_type *c_ptr);
458458 extern bool autopick_autoregister(object_type *o_ptr);
459459 extern void do_cmd_edit_autopick(void);
460460
@@ -469,9 +469,9 @@ extern void dump_yourself(FILE *fff);
469469 /* cave.c */
470470 extern POSITION distance(POSITION y1, POSITION x1, POSITION y2, POSITION x2);
471471 extern bool is_trap(IDX feat);
472-extern bool is_known_trap(cave_type *c_ptr);
472+extern bool is_known_trap(grid_type *c_ptr);
473473 extern bool is_closed_door(IDX feat);
474-extern bool is_hidden_door(cave_type *c_ptr);
474+extern bool is_hidden_door(grid_type *c_ptr);
475475 extern bool los(POSITION y1, POSITION x1, POSITION y2, POSITION x2);
476476 extern void update_local_illumination(POSITION y, POSITION x);
477477 extern bool player_can_see_bold(POSITION y, POSITION x);
@@ -506,9 +506,9 @@ extern FEAT_IDX conv_dungeon_feat(FEAT_IDX newfeat);
506506 extern FEAT_IDX feat_state(IDX feat, int action);
507507 extern void cave_alter_feat(POSITION y, POSITION x, int action);
508508 extern void remove_mirror(POSITION y, POSITION x);
509-extern bool is_mirror_grid(cave_type *c_ptr);
510-extern bool is_glyph_grid(cave_type *c_ptr);
511-extern bool is_explosive_rune_grid(cave_type *c_ptr);
509+extern bool is_mirror_grid(grid_type *c_ptr);
510+extern bool is_glyph_grid(grid_type *c_ptr);
511+extern bool is_explosive_rune_grid(grid_type *c_ptr);
512512 extern void mmove2(POSITION *y, POSITION *x, POSITION y1, POSITION x1, POSITION y2, POSITION x2);
513513 extern bool projectable(POSITION y1, POSITION x1, POSITION y2, POSITION x2);
514514 extern void scatter(POSITION *yp, POSITION *xp, POSITION y, POSITION x, POSITION d, BIT_FLAGS mode);
--- a/src/floor-events.c
+++ b/src/floor-events.c
@@ -13,7 +13,7 @@ void day_break()
1313 for (x = 0; x < cur_wid; x++)
1414 {
1515 /* Get the cave grid */
16- cave_type *c_ptr = &cave[y][x];
16+ grid_type *c_ptr = &cave[y][x];
1717
1818 /* Assume lit */
1919 c_ptr->info |= (CAVE_GLOW);
@@ -51,7 +51,7 @@ void night_falls(void)
5151 for (x = 0; x < cur_wid; x++)
5252 {
5353 /* Get the cave grid */
54- cave_type *c_ptr = &cave[y][x];
54+ grid_type *c_ptr = &cave[y][x];
5555
5656 /* Feature code (applying "mimic" field) */
5757 feature_type *f_ptr = &f_info[get_feat_mimic(c_ptr)];
--- a/src/floor-generate.c
+++ b/src/floor-generate.c
@@ -147,7 +147,7 @@ static int next_to_walls(POSITION y, POSITION x)
147147 */
148148 static bool alloc_stairs_aux(POSITION y, POSITION x, int walls)
149149 {
150- cave_type *c_ptr = &cave[y][x];
150+ grid_type *c_ptr = &cave[y][x];
151151
152152 /* Require "naked" floor grid */
153153 if (!is_floor_grid(c_ptr)) return FALSE;
@@ -214,7 +214,7 @@ static bool alloc_stairs(IDX feat, int num, int walls)
214214 while (TRUE)
215215 {
216216 POSITION y, x = 0;
217- cave_type *c_ptr;
217+ grid_type *c_ptr;
218218
219219 int candidates = 0;
220220 int pick;
@@ -290,7 +290,7 @@ static void alloc_object(int set, EFFECT_ID typ, int num)
290290 POSITION y = 0, x = 0;
291291 int k;
292292 int dummy = 0;
293- cave_type *c_ptr;
293+ grid_type *c_ptr;
294294
295295 /* A small level has few objects. */
296296 num = num * cur_hgt * cur_wid / (MAX_HGT*MAX_WID) +1;
@@ -420,7 +420,7 @@ bool place_quest_monsters(void)
420420 /* Find an empty grid */
421421 for (l = SAFE_MAX_ATTEMPTS; l > 0; l--)
422422 {
423- cave_type *c_ptr;
423+ grid_type *c_ptr;
424424 feature_type *f_ptr;
425425
426426 y = randint0(cur_hgt);
@@ -466,7 +466,7 @@ bool place_quest_monsters(void)
466466 * @param c_ptr 永久壁を廃止したいマス構造体の参照ポインタ
467467 * @return なし
468468 */
469-static void set_bound_perm_wall(cave_type *c_ptr)
469+static void set_bound_perm_wall(grid_type *c_ptr)
470470 {
471471 if (bound_walls_perm)
472472 {
@@ -810,7 +810,7 @@ static bool cave_gen(void)
810810 /* Turn the tunnel into corridor */
811811 for (j = 0; j < dun->tunn_n; j++)
812812 {
813- cave_type *c_ptr;
813+ grid_type *c_ptr;
814814 feature_type *f_ptr;
815815 y = dun->tunn[j].y;
816816 x = dun->tunn[j].x;
@@ -830,7 +830,7 @@ static bool cave_gen(void)
830830 /* Apply the piercings that we found */
831831 for (j = 0; j < dun->wall_n; j++)
832832 {
833- cave_type *c_ptr;
833+ grid_type *c_ptr;
834834 y = dun->wall[j].y;
835835 x = dun->wall[j].x;
836836 c_ptr = &cave[y][x];
@@ -1364,7 +1364,7 @@ void clear_cave(void)
13641364 {
13651365 for (x = 0; x < MAX_WID; x++)
13661366 {
1367- cave_type *c_ptr = &cave[y][x];
1367+ grid_type *c_ptr = &cave[y][x];
13681368 c_ptr->info = 0;
13691369 c_ptr->feat = 0;
13701370 c_ptr->o_idx = 0;
@@ -1523,7 +1523,7 @@ bool build_tunnel(POSITION row1, POSITION col1, POSITION row2, POSITION col2)
15231523
15241524 bool door_flag = FALSE;
15251525
1526- cave_type *c_ptr;
1526+ grid_type *c_ptr;
15271527
15281528 /* Save the starting location */
15291529 start_row = row1;
@@ -1713,7 +1713,7 @@ static bool set_tunnel(POSITION *x, POSITION *y, bool affectwall)
17131713 {
17141714 int i, j, dx, dy;
17151715
1716- cave_type *c_ptr = &cave[*y][*x];
1716+ grid_type *c_ptr = &cave[*y][*x];
17171717
17181718 if (!in_bounds(*y, *x)) return TRUE;
17191719
@@ -2007,7 +2007,7 @@ bool build_tunnel2(POSITION x1, POSITION y1, POSITION x2, POSITION y2, int type,
20072007 int length;
20082008 int i;
20092009 bool retval, firstsuccede;
2010- cave_type *c_ptr;
2010+ grid_type *c_ptr;
20112011
20122012 length = distance(x1, y1, x2, y2);
20132013
--- a/src/floor-save.c
+++ b/src/floor-save.c
@@ -758,7 +758,7 @@ static void locate_connected_stairs(saved_floor_type *sf_ptr)
758758 {
759759 for (x = 0; x < cur_wid; x++)
760760 {
761- cave_type *c_ptr = &cave[y][x];
761+ grid_type *c_ptr = &cave[y][x];
762762 feature_type *f_ptr = &f_info[c_ptr->feat];
763763 bool ok = FALSE;
764764
@@ -845,7 +845,7 @@ static void locate_connected_stairs(saved_floor_type *sf_ptr)
845845 */
846846 void leave_floor(void)
847847 {
848- cave_type *c_ptr = NULL;
848+ grid_type *c_ptr = NULL;
849849 feature_type *f_ptr;
850850 saved_floor_type *sf_ptr;
851851 MONRACE_IDX quest_r_idx = 0;
@@ -1133,7 +1133,7 @@ void change_floor(void)
11331133 /* Forbid return stairs */
11341134 if (change_floor_mode & CFM_NO_RETURN)
11351135 {
1136- cave_type *c_ptr = &cave[p_ptr->y][p_ptr->x];
1136+ grid_type *c_ptr = &cave[p_ptr->y][p_ptr->x];
11371137
11381138 if (!feat_uses_special(c_ptr->feat))
11391139 {
@@ -1310,7 +1310,7 @@ void change_floor(void)
13101310 if (!(change_floor_mode & CFM_NO_RETURN))
13111311 {
13121312 /* Extract stair position */
1313- cave_type *c_ptr = &cave[p_ptr->y][p_ptr->x];
1313+ grid_type *c_ptr = &cave[p_ptr->y][p_ptr->x];
13141314
13151315 /*** Create connected stairs ***/
13161316
@@ -1475,7 +1475,7 @@ void stair_creation(void)
14751475 {
14761476 for (x = 0; x < cur_wid; x++)
14771477 {
1478- cave_type *c_ptr = &cave[y][x];
1478+ grid_type *c_ptr = &cave[y][x];
14791479
14801480 if (!c_ptr->special) continue;
14811481 if (feat_uses_special(c_ptr->feat)) continue;
--- a/src/floor-streams.c
+++ b/src/floor-streams.c
@@ -39,7 +39,7 @@ static void recursive_river(POSITION x1, POSITION y1, POSITION x2, POSITION y2,
3939 POSITION changex, changey;
4040 POSITION ty, tx;
4141 bool done;
42- cave_type *c_ptr;
42+ grid_type *c_ptr;
4343
4444 length = distance(x1, y1, x2, y2);
4545
@@ -232,7 +232,7 @@ void build_streamer(IDX feat, int chance)
232232 int y, x, dir;
233233 int dummy = 0;
234234
235- cave_type *c_ptr;
235+ grid_type *c_ptr;
236236 feature_type *f_ptr;
237237
238238 feature_type *streamer_ptr = &f_info[feat];
@@ -382,7 +382,7 @@ void build_streamer(IDX feat, int chance)
382382 void place_trees(POSITION x, POSITION y)
383383 {
384384 int i, j;
385- cave_type *c_ptr;
385+ grid_type *c_ptr;
386386
387387 /* place trees/ rubble in ovalish distribution */
388388 for (i = x - 3; i < x + 4; i++)
--- a/src/grid.c
+++ b/src/grid.c
@@ -30,7 +30,7 @@ bool new_player_spot(void)
3030 POSITION y = 0, x = 0;
3131 int max_attempts = 10000;
3232
33- cave_type *c_ptr;
33+ grid_type *c_ptr;
3434 feature_type *f_ptr;
3535
3636 /* Place the player */
@@ -92,7 +92,7 @@ void place_random_stairs(POSITION y, POSITION x)
9292 {
9393 bool up_stairs = TRUE;
9494 bool down_stairs = TRUE;
95- cave_type *c_ptr;
95+ grid_type *c_ptr;
9696
9797 /* Paranoia */
9898 c_ptr = &cave[y][x];
@@ -134,7 +134,7 @@ void place_random_door(POSITION y, POSITION x, bool room)
134134 {
135135 int tmp, type;
136136 FEAT_IDX feat = feat_none;
137- cave_type *c_ptr = &cave[y][x];
137+ grid_type *c_ptr = &cave[y][x];
138138
139139 /* Initialize mimic info */
140140 c_ptr->mimic = 0;
@@ -298,7 +298,7 @@ void place_secret_door(POSITION y, POSITION x, int type)
298298 }
299299 else
300300 {
301- cave_type *c_ptr = &cave[y][x];
301+ grid_type *c_ptr = &cave[y][x];
302302
303303 if (type == DOOR_DEFAULT)
304304 {
@@ -399,7 +399,7 @@ static int next_to_corr(POSITION y1, POSITION x1)
399399 int i, k = 0;
400400 POSITION y, x;
401401
402- cave_type *c_ptr;
402+ grid_type *c_ptr;
403403
404404 /* Scan adjacent grids */
405405 for (i = 0; i < 4; i++)
@@ -556,7 +556,7 @@ void vault_objects(POSITION y, POSITION x, int num)
556556 int dummy = 0;
557557 int i = 0, j = y, k = x;
558558
559- cave_type *c_ptr;
559+ grid_type *c_ptr;
560560
561561
562562 /* Attempt to place 'num' objects */
@@ -614,7 +614,7 @@ void vault_trap_aux(POSITION y, POSITION x, POSITION yd, POSITION xd)
614614 int count = 0, y1 = y, x1 = x;
615615 int dummy = 0;
616616
617- cave_type *c_ptr;
617+ grid_type *c_ptr;
618618
619619 /* Place traps */
620620 for (count = 0; count <= 5; count++)
@@ -679,7 +679,7 @@ void vault_monsters(POSITION y1, POSITION x1, int num)
679679 {
680680 int k, i;
681681 POSITION y, x;
682- cave_type *c_ptr;
682+ grid_type *c_ptr;
683683
684684 /* Try to summon "num" monsters "near" the given location */
685685 for (k = 0; k < num; k++)
--- a/src/init1.c
+++ b/src/init1.c
@@ -3900,7 +3900,7 @@ static errr parse_line_building(char *buf)
39003900 */
39013901 static void drop_here(object_type *j_ptr, POSITION y, POSITION x)
39023902 {
3903- cave_type *c_ptr = &cave[y][x];
3903+ grid_type *c_ptr = &cave[y][x];
39043904 object_type *o_ptr;
39053905
39063906 OBJECT_IDX o_idx = o_pop();
@@ -3984,7 +3984,7 @@ static errr process_dungeon_file_aux(char *buf, int ymin, int xmin, int ymax, in
39843984
39853985 for (*x = xmin, i = 0; ((*x < xmax) && (i < len)); (*x)++, s++, i++)
39863986 {
3987- cave_type *c_ptr = &cave[*y][*x];
3987+ grid_type *c_ptr = &cave[*y][*x];
39883988
39893989 int idx = s[0];
39903990
--- a/src/init2.c
+++ b/src/init2.c
@@ -1238,7 +1238,7 @@ static errr init_other(void)
12381238 for (i = 0; i < MAX_HGT; i++)
12391239 {
12401240 /* Allocate one row of the cave */
1241- C_MAKE(cave[i], MAX_WID, cave_type);
1241+ C_MAKE(cave[i], MAX_WID, grid_type);
12421242 }
12431243
12441244
--- a/src/load.c
+++ b/src/load.c
@@ -2549,7 +2549,7 @@ static errr rd_dungeon_old(void)
25492549 byte tmp8u;
25502550 s16b tmp16s;
25512551 u16b limit;
2552- cave_type *c_ptr;
2552+ grid_type *c_ptr;
25532553
25542554
25552555 /*** Basic info ***/
@@ -2962,7 +2962,7 @@ static errr rd_dungeon_old(void)
29622962 * この関数は、セーブデータの互換性を保つために多くのデータ改変処理を備えている。
29632963 * 現在確認している処理は以下の通り、
29642964 * <ul>
2965- * <li>1.7.0.2で8bitだったcave_typeのfeat,mimicのID値を16bitに拡張する処理。</li>
2965+ * <li>1.7.0.2で8bitだったgrid_typeのfeat,mimicのID値を16bitに拡張する処理。</li>
29662966 * <li>1.7.0.8までに廃止、IDなどを差し替えたクエスト番号を置換する処理。</li>
29672967 * </ul>
29682968 * The monsters/objects must be loaded in the same order
@@ -3047,7 +3047,7 @@ static errr rd_saved_floor(saved_floor_type *sf_ptr)
30473047
30483048
30493049
3050- /*** Read template for cave_type ***/
3050+ /*** Read template for grid_type ***/
30513051
30523052 /* Read the template count */
30533053 rd_u16b(&limit);
@@ -3104,7 +3104,7 @@ static errr rd_saved_floor(saved_floor_type *sf_ptr)
31043104 for (i = count; i > 0; i--)
31053105 {
31063106 /* Access the cave */
3107- cave_type *c_ptr = &cave[y][x];
3107+ grid_type *c_ptr = &cave[y][x];
31083108
31093109 /* Extract cave data */
31103110 c_ptr->info = templates[id].info;
@@ -3130,7 +3130,7 @@ static errr rd_saved_floor(saved_floor_type *sf_ptr)
31303130 for (y = 0; y < ymax; y++) for (x = 0; x < xmax; x++)
31313131 {
31323132 /* Access the cave */
3133- cave_type *c_ptr = &cave[y][x];
3133+ grid_type *c_ptr = &cave[y][x];
31343134
31353135 if ((c_ptr->special == OLD_QUEST_WATER_CAVE) && !dun_level)
31363136 {
@@ -3204,7 +3204,7 @@ static errr rd_saved_floor(saved_floor_type *sf_ptr)
32043204 else
32053205 {
32063206 /* Access the item location */
3207- cave_type *c_ptr = &cave[o_ptr->iy][o_ptr->ix];
3207+ grid_type *c_ptr = &cave[o_ptr->iy][o_ptr->ix];
32083208
32093209 /* Build a stack */
32103210 o_ptr->next_o_idx = c_ptr->o_idx;
@@ -3226,7 +3226,7 @@ static errr rd_saved_floor(saved_floor_type *sf_ptr)
32263226 /* Read the monsters */
32273227 for (i = 1; i < limit; i++)
32283228 {
3229- cave_type *c_ptr;
3229+ grid_type *c_ptr;
32303230 MONSTER_IDX m_idx;
32313231 monster_type *m_ptr;
32323232
--- a/src/melee1.c
+++ b/src/melee1.c
@@ -434,7 +434,7 @@ static void py_attack_aux(POSITION y, POSITION x, bool *fear, bool *mdeath, s16b
434434 int num = 0, bonus, chance, vir;
435435 HIT_POINT k;
436436
437- cave_type *c_ptr = &cave[y][x];
437+ grid_type *c_ptr = &cave[y][x];
438438
439439 monster_type *m_ptr = &m_list[c_ptr->m_idx];
440440 monster_race *r_ptr = &r_info[m_ptr->r_idx];
@@ -1324,7 +1324,7 @@ bool py_attack(POSITION y, POSITION x, BIT_FLAGS mode)
13241324 bool mdeath = FALSE;
13251325 bool stormbringer = FALSE;
13261326
1327- cave_type *c_ptr = &cave[y][x];
1327+ grid_type *c_ptr = &cave[y][x];
13281328 monster_type *m_ptr = &m_list[c_ptr->m_idx];
13291329 monster_race *r_ptr = &r_info[m_ptr->r_idx];
13301330 GAME_TEXT m_name[MAX_NLEN];
--- a/src/mind.c
+++ b/src/mind.c
@@ -1644,7 +1644,7 @@ static bool cast_ninja_spell(int spell)
16441644 {
16451645 POSITION ny = GRID_Y(path_g[i]);
16461646 POSITION nx = GRID_X(path_g[i]);
1647- cave_type *c_ptr = &cave[ny][nx];
1647+ grid_type *c_ptr = &cave[ny][nx];
16481648
16491649 if (in_bounds(ny, nx) && cave_empty_bold(ny, nx) &&
16501650 !(c_ptr->info & CAVE_OBJECT) &&
--- a/src/monster-process.c
+++ b/src/monster-process.c
@@ -472,7 +472,7 @@ static bool get_moves_aux2(MONSTER_IDX m_idx, POSITION *yp, POSITION *xp)
472472 int i, best = 999;
473473 POSITION y, x, y1, x1;
474474
475- cave_type *c_ptr;
475+ grid_type *c_ptr;
476476 bool can_open_door = FALSE;
477477 int now_cost;
478478
@@ -577,7 +577,7 @@ static bool get_moves_aux(MONSTER_IDX m_idx, POSITION *yp, POSITION *xp, bool no
577577 int i, best;
578578 POSITION y, x, y1, x1;
579579
580- cave_type *c_ptr;
580+ grid_type *c_ptr;
581581 bool use_scent = FALSE;
582582
583583 monster_type *m_ptr = &m_list[m_idx];
@@ -895,7 +895,7 @@ static bool find_safety(MONSTER_IDX m_idx, POSITION *yp, POSITION *xp)
895895 POSITION *y_offsets;
896896 POSITION *x_offsets;
897897
898- cave_type *c_ptr;
898+ grid_type *c_ptr;
899899
900900 /* Start with adjacent locations, spread further */
901901 for (d = 1; d < 10; d++)
@@ -1060,7 +1060,7 @@ static bool get_moves(MONSTER_IDX m_idx, DIRECTION *mm)
10601060 POSITION x2 = p_ptr->x;
10611061 bool done = FALSE;
10621062 bool will_run = mon_will_run(m_idx);
1063- cave_type *c_ptr;
1063+ grid_type *c_ptr;
10641064 bool no_flow = ((m_ptr->mflag2 & MFLAG2_NOFLOW) && (cave[m_ptr->fy][m_ptr->fx].cost > 2));
10651065 bool can_pass_wall = ((r_ptr->flags2 & RF2_PASS_WALL) && ((m_idx != p_ptr->riding) || p_ptr->pass_wall));
10661066
@@ -2084,7 +2084,7 @@ void process_monster(MONSTER_IDX m_idx)
20842084
20852085 DIRECTION mm[8];
20862086
2087- cave_type *c_ptr;
2087+ grid_type *c_ptr;
20882088 feature_type *f_ptr;
20892089
20902090 monster_type *y_ptr;
--- a/src/monster1.c
+++ b/src/monster1.c
@@ -2370,7 +2370,7 @@ bool monster_can_cross_terrain(FEAT_IDX feat, monster_race *r_ptr, BIT_FLAGS16 m
23702370 */
23712371 bool monster_can_enter(POSITION y, POSITION x, monster_race *r_ptr, BIT_FLAGS16 mode)
23722372 {
2373- cave_type *c_ptr = &cave[y][x];
2373+ grid_type *c_ptr = &cave[y][x];
23742374
23752375 /* Player or other monster */
23762376 if (player_bold(y, x)) return FALSE;
--- a/src/monster2.c
+++ b/src/monster2.c
@@ -311,7 +311,7 @@ void delete_monster_idx(MONSTER_IDX i)
311311 */
312312 void delete_monster(POSITION y, POSITION x)
313313 {
314- cave_type *c_ptr;
314+ grid_type *c_ptr;
315315
316316 /* Paranoia */
317317 if (!in_bounds(y, x)) return;
@@ -334,7 +334,7 @@ static void compact_monsters_aux(IDX i1, IDX i2)
334334 {
335335 POSITION y, x;
336336 int i;
337- cave_type *c_ptr;
337+ grid_type *c_ptr;
338338 monster_type *m_ptr;
339339 OBJECT_IDX this_o_idx, next_o_idx = 0;
340340
@@ -2940,7 +2940,7 @@ byte get_mspeed(monster_race *r_ptr)
29402940 static bool place_monster_one(MONSTER_IDX who, POSITION y, POSITION x, MONRACE_IDX r_idx, BIT_FLAGS mode)
29412941 {
29422942 /* Access the location */
2943- cave_type *c_ptr = &cave[y][x];
2943+ grid_type *c_ptr = &cave[y][x];
29442944 monster_type *m_ptr;
29452945 monster_race *r_ptr = &r_info[r_idx];
29462946 concptr name = (r_name + r_ptr->name);
--- a/src/mspells1.c
+++ b/src/mspells1.c
@@ -404,7 +404,7 @@ bool raise_possible(monster_type *m_ptr)
404404 POSITION y = m_ptr->fy;
405405 POSITION x = m_ptr->fx;
406406 OBJECT_IDX this_o_idx, next_o_idx = 0;
407- cave_type *c_ptr;
407+ grid_type *c_ptr;
408408
409409 for (xx = x - 5; xx <= x + 5; xx++)
410410 {
@@ -1257,7 +1257,7 @@ static bool adjacent_grid_check(monster_type *m_ptr, POSITION *yp, POSITION *xp,
12571257 {
12581258 int next_x = *xp + tonari_x[tonari][i];
12591259 int next_y = *yp + tonari_y[tonari][i];
1260- cave_type *c_ptr;
1260+ grid_type *c_ptr;
12611261
12621262 /* Access the next grid */
12631263 c_ptr = &cave[next_y][next_x];
--- a/src/mutation.c
+++ b/src/mutation.c
@@ -2281,7 +2281,7 @@ bool mutation_power_aux(int power)
22812281 case MUT1_BANISH:
22822282 {
22832283 POSITION x, y;
2284- cave_type *c_ptr;
2284+ grid_type *c_ptr;
22852285 monster_type *m_ptr;
22862286 monster_race *r_ptr;
22872287 if (!get_direction(&dir, FALSE, FALSE)) return FALSE;
@@ -2328,7 +2328,7 @@ bool mutation_power_aux(int power)
23282328 case MUT1_COLD_TOUCH:
23292329 {
23302330 POSITION x, y;
2331- cave_type *c_ptr;
2331+ grid_type *c_ptr;
23322332 if (!get_direction(&dir, FALSE, FALSE)) return FALSE;
23332333 y = p_ptr->y + ddy[dir];
23342334 x = p_ptr->x + ddx[dir];
--- a/src/object1.c
+++ b/src/object1.c
@@ -4368,7 +4368,7 @@ bool get_item_floor(COMMAND_CODE *cp, concptr pmt, concptr str, BIT_FLAGS mode)
43684368 {
43694369 int i;
43704370 OBJECT_IDX o_idx;
4371- cave_type *c_ptr = &cave[p_ptr->y][p_ptr->x];
4371+ grid_type *c_ptr = &cave[p_ptr->y][p_ptr->x];
43724372
43734373 if (command_wrk != (USE_FLOOR)) break;
43744374
--- a/src/object2.c
+++ b/src/object2.c
@@ -123,7 +123,7 @@ void excise_object_idx(OBJECT_IDX o_idx)
123123 /* Dungeon */
124124 else
125125 {
126- cave_type *c_ptr;
126+ grid_type *c_ptr;
127127
128128 POSITION y = j_ptr->iy;
129129 POSITION x = j_ptr->ix;
@@ -217,7 +217,7 @@ void delete_object_idx(OBJECT_IDX o_idx)
217217 */
218218 void delete_object(POSITION y, POSITION x)
219219 {
220- cave_type *c_ptr;
220+ grid_type *c_ptr;
221221 OBJECT_IDX this_o_idx, next_o_idx = 0;
222222
223223 /* Refuse "illegal" locations */
@@ -257,7 +257,7 @@ void delete_object(POSITION y, POSITION x)
257257 static void compact_objects_aux(OBJECT_IDX i1, OBJECT_IDX i2)
258258 {
259259 OBJECT_IDX i;
260- cave_type *c_ptr;
260+ grid_type *c_ptr;
261261 object_type *o_ptr;
262262
263263 /* Do nothing */
@@ -487,7 +487,7 @@ void wipe_o_list(void)
487487 /* Dungeon */
488488 else
489489 {
490- cave_type *c_ptr;
490+ grid_type *c_ptr;
491491
492492 /* Access location */
493493 POSITION y = o_ptr->iy;
@@ -4868,7 +4868,7 @@ void place_object(POSITION y, POSITION x, BIT_FLAGS mode)
48684868 OBJECT_IDX o_idx;
48694869
48704870 /* Acquire grid */
4871- cave_type *c_ptr = &cave[y][x];
4871+ grid_type *c_ptr = &cave[y][x];
48724872
48734873 object_type forge;
48744874 object_type *q_ptr;
@@ -4982,7 +4982,7 @@ void place_gold(POSITION y, POSITION x)
49824982 OBJECT_IDX o_idx;
49834983
49844984 /* Acquire grid */
4985- cave_type *c_ptr = &cave[y][x];
4985+ grid_type *c_ptr = &cave[y][x];
49864986
49874987 object_type forge;
49884988 object_type *q_ptr;
@@ -5066,7 +5066,7 @@ OBJECT_IDX drop_near(object_type *j_ptr, PERCENTAGE chance, POSITION y, POSITION
50665066 OBJECT_IDX o_idx = 0;
50675067 OBJECT_IDX this_o_idx, next_o_idx = 0;
50685068
5069- cave_type *c_ptr;
5069+ grid_type *c_ptr;
50705070
50715071 GAME_TEXT o_name[MAX_NLEN];
50725072
@@ -6699,7 +6699,7 @@ static int blow_damcalc(monster_type *m_ptr, monster_blow *blow_ptr)
66996699 bool process_warning(POSITION xx, POSITION yy)
67006700 {
67016701 POSITION mx, my;
6702- cave_type *c_ptr;
6702+ grid_type *c_ptr;
67036703 GAME_TEXT o_name[MAX_NLEN];
67046704
67056705 #define WARNING_AWARE_RANGE 12
--- a/src/player-move.c
+++ b/src/player-move.c
@@ -360,7 +360,7 @@ HIT_POINT tot_dam_aux(object_type *o_ptr, HIT_POINT tdam, monster_type *m_ptr, B
360360 static void discover_hidden_things(POSITION y, POSITION x)
361361 {
362362 OBJECT_IDX this_o_idx, next_o_idx = 0;
363- cave_type *c_ptr;
363+ grid_type *c_ptr;
364364 c_ptr = &cave[y][x];
365365
366366 /* Invisible trap */
@@ -545,7 +545,7 @@ void py_pickup_aux(OBJECT_IDX o_idx)
545545 */
546546 void carry(bool pickup)
547547 {
548- cave_type *c_ptr = &cave[p_ptr->y][p_ptr->x];
548+ grid_type *c_ptr = &cave[p_ptr->y][p_ptr->x];
549549
550550 OBJECT_IDX this_o_idx, next_o_idx = 0;
551551
@@ -825,8 +825,8 @@ bool move_player_effect(POSITION ny, POSITION nx, BIT_FLAGS mpe_mode)
825825 {
826826 POSITION oy = p_ptr->y;
827827 POSITION ox = p_ptr->x;
828- cave_type *c_ptr = &cave[ny][nx];
829- cave_type *oc_ptr = &cave[oy][ox];
828+ grid_type *c_ptr = &cave[ny][nx];
829+ grid_type *oc_ptr = &cave[oy][ox];
830830 feature_type *f_ptr = &f_info[c_ptr->feat];
831831 feature_type *of_ptr = &f_info[oc_ptr->feat];
832832
@@ -1104,7 +1104,7 @@ void move_player(DIRECTION dir, bool do_pickup, bool break_trap)
11041104 POSITION x = p_ptr->x + ddx[dir];
11051105
11061106 /* Examine the destination */
1107- cave_type *c_ptr = &cave[y][x];
1107+ grid_type *c_ptr = &cave[y][x];
11081108
11091109 feature_type *f_ptr = &f_info[c_ptr->feat];
11101110
@@ -1518,7 +1518,7 @@ static bool ignore_avoid_run;
15181518 */
15191519 static bool see_wall(DIRECTION dir, POSITION y, POSITION x)
15201520 {
1521- cave_type *c_ptr;
1521+ grid_type *c_ptr;
15221522
15231523 /* Get the new location */
15241524 y += ddy[dir];
@@ -1733,7 +1733,7 @@ static bool run_test(void)
17331733 int row, col;
17341734 int i, max, inv;
17351735 int option = 0, option2 = 0;
1736- cave_type *c_ptr;
1736+ grid_type *c_ptr;
17371737 FEAT_IDX feat;
17381738 feature_type *f_ptr;
17391739
@@ -2127,7 +2127,7 @@ static DIRECTION travel_test(DIRECTION prev_dir)
21272127 {
21282128 DIRECTION new_dir = 0;
21292129 int i, max;
2130- const cave_type *c_ptr;
2130+ const grid_type *c_ptr;
21312131 int cost;
21322132
21332133 /* Cannot travel when blind */
--- a/src/realm-hissatsu.c
+++ b/src/realm-hissatsu.c
@@ -512,7 +512,7 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
512512 {
513513 POSITION y = 0, x = 0;
514514
515- cave_type *c_ptr;
515+ grid_type *c_ptr;
516516 monster_type *m_ptr;
517517
518518 if (p_ptr->cut < 300)
@@ -634,7 +634,7 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
634634 POSITION y, x;
635635 POSITION ny, nx;
636636 MONSTER_IDX m_idx;
637- cave_type *c_ptr;
637+ grid_type *c_ptr;
638638 monster_type *m_ptr;
639639
640640 y = p_ptr->y + ddy[dir];
--- a/src/rooms-normal.c
+++ b/src/rooms-normal.c
@@ -16,7 +16,7 @@ bool build_type1(void)
1616
1717 bool light;
1818
19- cave_type *c_ptr;
19+ grid_type *c_ptr;
2020
2121 bool curtain = (d_info[p_ptr->dungeon_idx].flags1 & DF1_CURTAIN) &&
2222 one_in_((d_info[p_ptr->dungeon_idx].flags1 & DF1_NO_CAVE) ? 48 : 512);
@@ -210,7 +210,7 @@ bool build_type2(void)
210210 POSITION y1a, x1a, y2a, x2a;
211211 POSITION y1b, x1b, y2b, x2b;
212212 bool light;
213- cave_type *c_ptr;
213+ grid_type *c_ptr;
214214
215215 /* Find and reserve some space in the dungeon. Get center of room. */
216216 if (!find_space(&yval, &xval, 11, 25)) return FALSE;
@@ -333,7 +333,7 @@ bool build_type3(void)
333333 POSITION y1b, x1b, y2b, x2b;
334334 POSITION yval, xval;
335335 bool light;
336- cave_type *c_ptr;
336+ grid_type *c_ptr;
337337
338338
339339 /* Find and reserve some space in the dungeon. Get center of room. */
@@ -588,7 +588,7 @@ bool build_type4(void)
588588 POSITION y, x, y1, x1;
589589 POSITION y2, x2, tmp, yval, xval;
590590 bool light;
591- cave_type *c_ptr;
591+ grid_type *c_ptr;
592592
593593
594594 /* Find and reserve some space in the dungeon. Get center of room. */
--- a/src/rooms-pitnest.c
+++ b/src/rooms-pitnest.c
@@ -284,7 +284,7 @@ bool build_type5(void)
284284
285285 monster_type align;
286286
287- cave_type *c_ptr;
287+ grid_type *c_ptr;
288288
289289 int cur_nest_type = pick_vault_type(nest_types, d_info[p_ptr->dungeon_idx].nest);
290290 vault_aux_type *n_ptr;
@@ -495,7 +495,7 @@ bool build_type6(void)
495495
496496 monster_type align;
497497
498- cave_type *c_ptr;
498+ grid_type *c_ptr;
499499
500500 int cur_pit_type = pick_vault_type(pit_types, d_info[p_ptr->dungeon_idx].pit);
501501 vault_aux_type *n_ptr;
@@ -800,7 +800,7 @@ bool build_type13(void)
800800
801801 monster_type align;
802802
803- cave_type *c_ptr;
803+ grid_type *c_ptr;
804804
805805 int cur_pit_type = pick_vault_type(pit_types, d_info[p_ptr->dungeon_idx].pit);
806806 vault_aux_type *n_ptr;
--- a/src/rooms-special.c
+++ b/src/rooms-special.c
@@ -17,7 +17,7 @@ bool build_type15(void)
1717 POSITION y1, x1, xsize, ysize;
1818 bool light;
1919
20- cave_type *c_ptr;
20+ grid_type *c_ptr;
2121
2222 /* Pick a room size */
2323 xsize = rand_range(9, 13);
--- a/src/rooms-trap.c
+++ b/src/rooms-trap.c
@@ -17,7 +17,7 @@ bool build_type14(void)
1717
1818 bool light;
1919
20- cave_type *c_ptr;
20+ grid_type *c_ptr;
2121 s16b trap;
2222
2323 /* Pick a room size */
--- a/src/rooms-vault.c
+++ b/src/rooms-vault.c
@@ -309,7 +309,7 @@ static void build_vault(POSITION yval, POSITION xval, POSITION ymax, POSITION xm
309309 {
310310 POSITION dx, dy, x, y, i, j;
311311 concptr t;
312- cave_type *c_ptr;
312+ grid_type *c_ptr;
313313
314314 /* Place dungeon features and objects */
315315 for (t = data, dy = 0; dy < ymax; dy++)
@@ -1066,7 +1066,7 @@ static void build_mini_c_vault(POSITION x0, POSITION y0, POSITION xsize, POSITIO
10661066 {
10671067 for (x = x1 - 1; x <= x2 + 1; x++)
10681068 {
1069- cave_type *c_ptr = &cave[y][x];
1069+ grid_type *c_ptr = &cave[y][x];
10701070
10711071 c_ptr->info |= (CAVE_ROOM | CAVE_ICKY);
10721072
--- a/src/rooms.c
+++ b/src/rooms.c
@@ -1692,7 +1692,7 @@ void build_maze_vault(POSITION x0, POSITION y0, POSITION xsize, POSITION ysize,
16921692 POSITION y1, x1, y2, x2;
16931693 int m, n, num_vertices, *visited;
16941694 bool light;
1695- cave_type *c_ptr;
1695+ grid_type *c_ptr;
16961696
16971697 msg_print_wizard(CHEAT_DUNGEON, _("迷路ランダムVaultを生成しました。", "Maze Vault."));
16981698
@@ -1963,7 +1963,7 @@ void build_recursive_room(POSITION x1, POSITION y1, POSITION x2, POSITION y2, in
19631963 */
19641964 void add_outer_wall(POSITION x, POSITION y, int light, POSITION x1, POSITION y1, POSITION x2, POSITION y2)
19651965 {
1966- cave_type *c_ptr;
1966+ grid_type *c_ptr;
19671967 feature_type *f_ptr;
19681968 int i, j;
19691969
@@ -2042,7 +2042,7 @@ void generate_room_floor(POSITION y1, POSITION x1, POSITION y2, POSITION x2, int
20422042 {
20432043 POSITION y, x;
20442044
2045- cave_type *c_ptr;
2045+ grid_type *c_ptr;
20462046
20472047 for (y = y1; y <= y2; y++)
20482048 {
--- a/src/save.c
+++ b/src/save.c
@@ -949,7 +949,7 @@ static void wr_saved_floor(saved_floor_type *sf_ptr)
949949
950950
951951
952- /*********** Make template for cave_type **********/
952+ /*********** Make template for grid_type **********/
953953
954954 /*
955955 * Usually number of templates are fewer than 255. Even if
@@ -973,7 +973,7 @@ static void wr_saved_floor(saved_floor_type *sf_ptr)
973973 {
974974 for (x = 0; x < cur_wid; x++)
975975 {
976- cave_type *c_ptr = &cave[y][x];
976+ grid_type *c_ptr = &cave[y][x];
977977
978978 for (i = 0; i < num_temp; i++)
979979 {
@@ -1053,7 +1053,7 @@ static void wr_saved_floor(saved_floor_type *sf_ptr)
10531053 {
10541054 for (x = 0; x < cur_wid; x++)
10551055 {
1056- cave_type *c_ptr = &cave[y][x];
1056+ grid_type *c_ptr = &cave[y][x];
10571057
10581058 for (i = 0; i < num_temp; i++)
10591059 {
--- a/src/shoot.c
+++ b/src/shoot.c
@@ -506,7 +506,7 @@ void exe_fire(INVENTORY_IDX item, object_type *j_ptr)
506506 /* Travel until stopped */
507507 for (cur_dis = 0; cur_dis <= tdis; )
508508 {
509- cave_type *c_ptr;
509+ grid_type *c_ptr;
510510
511511 /* Hack -- Stop at the target */
512512 if ((y == ty) && (x == tx)) break;
@@ -597,7 +597,7 @@ void exe_fire(INVENTORY_IDX item, object_type *j_ptr)
597597 /* Monster here, Try to hit it */
598598 if (cave[y][x].m_idx)
599599 {
600- cave_type *c_mon_ptr = &cave[y][x];
600+ grid_type *c_mon_ptr = &cave[y][x];
601601
602602 monster_type *m_ptr = &m_list[c_mon_ptr->m_idx];
603603 monster_race *r_ptr = &r_info[m_ptr->r_idx];
--- a/src/spells-object.c
+++ b/src/spells-object.c
@@ -107,7 +107,7 @@ bool create_ammo(void)
107107 {
108108 POSITION x, y;
109109 DIRECTION dir;
110- cave_type *c_ptr;
110+ grid_type *c_ptr;
111111
112112 if (!get_rep_dir(&dir, FALSE)) return FALSE;
113113 y = p_ptr->y + ddy[dir];
--- a/src/spells1.c
+++ b/src/spells1.c
@@ -304,7 +304,7 @@ static POSITION monster_target_y; /*!< モンスターの攻撃目標Y座標 */
304304 */
305305 static bool project_f(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID typ)
306306 {
307- cave_type *c_ptr = &cave[y][x];
307+ grid_type *c_ptr = &cave[y][x];
308308 feature_type *f_ptr = &f_info[c_ptr->feat];
309309
310310 bool obvious = FALSE;
@@ -648,7 +648,7 @@ static bool project_f(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P
648648
649649 if (in_bounds2(by, bx))
650650 {
651- cave_type *cc_ptr = &cave[by][bx];
651+ grid_type *cc_ptr = &cave[by][bx];
652652
653653 if (have_flag(f_info[get_feat_mimic(cc_ptr)].flags, FF_GLOW))
654654 {
@@ -797,7 +797,7 @@ static bool project_f(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P
797797 */
798798 static bool project_o(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID typ)
799799 {
800- cave_type *c_ptr = &cave[y][x];
800+ grid_type *c_ptr = &cave[y][x];
801801
802802 OBJECT_IDX this_o_idx, next_o_idx = 0;
803803
@@ -1177,7 +1177,7 @@ static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P
11771177 {
11781178 int tmp;
11791179
1180- cave_type *c_ptr = &cave[y][x];
1180+ grid_type *c_ptr = &cave[y][x];
11811181
11821182 monster_type *m_ptr = &m_list[c_ptr->m_idx];
11831183 monster_type *caster_ptr = (who > 0) ? &m_list[who] : NULL;
--- a/src/spells2.c
+++ b/src/spells2.c
@@ -38,7 +38,7 @@ static bool detect_feat_flag(POSITION range, int flag, bool known)
3838 {
3939 POSITION x, y;
4040 bool detect = FALSE;
41- cave_type *c_ptr;
41+ grid_type *c_ptr;
4242
4343 if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
4444
@@ -1394,7 +1394,7 @@ bool destroy_area(POSITION y1, POSITION x1, POSITION r, bool in_generate)
13941394 {
13951395 POSITION y, x;
13961396 int k, t;
1397- cave_type *c_ptr;
1397+ grid_type *c_ptr;
13981398 bool flag = FALSE;
13991399
14001400 /* Prevent destruction of quest levels and town */
@@ -1597,7 +1597,7 @@ bool destroy_area(POSITION y1, POSITION x1, POSITION r, bool in_generate)
15971597 {
15981598 DIRECTION i;
15991599 POSITION yy, xx;
1600- cave_type *cc_ptr;
1600+ grid_type *cc_ptr;
16011601
16021602 for (i = 0; i < 9; i++)
16031603 {
@@ -1682,7 +1682,7 @@ bool earthquake_aux(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
16821682 int sn = 0;
16831683 POSITION sy = 0, sx = 0;
16841684 bool hurt = FALSE;
1685- cave_type *c_ptr;
1685+ grid_type *c_ptr;
16861686 bool map[32][32];
16871687
16881688 /* Prevent destruction of quest levels and town */
@@ -2067,7 +2067,7 @@ bool earthquake_aux(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
20672067 {
20682068 DIRECTION ii;
20692069 POSITION yyy, xxx;
2070- cave_type *cc_ptr;
2070+ grid_type *cc_ptr;
20712071
20722072 for (ii = 0; ii < 9; ii++)
20732073 {
@@ -2196,7 +2196,7 @@ static void cave_temp_room_lite(void)
21962196 POSITION y = temp_y[i];
21972197 POSITION x = temp_x[i];
21982198
2199- cave_type *c_ptr = &cave[y][x];
2199+ grid_type *c_ptr = &cave[y][x];
22002200
22012201 /* No longer in the array */
22022202 c_ptr->info &= ~(CAVE_TEMP);
@@ -2271,7 +2271,7 @@ static void cave_temp_room_unlite(void)
22712271 POSITION x = temp_x[i];
22722272 int j;
22732273
2274- cave_type *c_ptr = &cave[y][x];
2274+ grid_type *c_ptr = &cave[y][x];
22752275 bool do_dark = !is_mirror_grid(c_ptr);
22762276
22772277 /* No longer in the array */
@@ -2289,7 +2289,7 @@ static void cave_temp_room_unlite(void)
22892289
22902290 if (in_bounds2(by, bx))
22912291 {
2292- cave_type *cc_ptr = &cave[by][bx];
2292+ grid_type *cc_ptr = &cave[by][bx];
22932293
22942294 if (have_flag(f_info[get_feat_mimic(cc_ptr)].flags, FF_GLOW))
22952295 {
@@ -2402,7 +2402,7 @@ static int next_to_walls_adj(POSITION cy, POSITION cx, bool (*pass_bold)(POSITIO
24022402 */
24032403 static void cave_temp_room_aux(POSITION y, POSITION x, bool only_room, bool (*pass_bold)(POSITION, POSITION))
24042404 {
2405- cave_type *c_ptr;
2405+ grid_type *c_ptr;
24062406
24072407 /* Get the grid */
24082408 c_ptr = &cave[y][x];
@@ -2891,7 +2891,7 @@ bool fire_blast(EFFECT_ID typ, DIRECTION dir, DICE_NUMBER dd, DICE_SID ds, int n
28912891 bool teleport_swap(DIRECTION dir)
28922892 {
28932893 POSITION tx, ty;
2894- cave_type* c_ptr;
2894+ grid_type* c_ptr;
28952895 monster_type* m_ptr;
28962896 monster_race* r_ptr;
28972897
@@ -4607,7 +4607,7 @@ bool_hack vampirism(void)
46074607 DIRECTION dir;
46084608 POSITION x, y;
46094609 int dummy;
4610- cave_type *c_ptr;
4610+ grid_type *c_ptr;
46114611
46124612 if (d_info[p_ptr->dungeon_idx].flags1 & DF1_NO_MELEE)
46134613 {
@@ -4969,7 +4969,7 @@ void hayagake(player_type *creature_ptr)
49694969 }
49704970 else
49714971 {
4972- cave_type *c_ptr = &cave[creature_ptr->y][creature_ptr->x];
4972+ grid_type *c_ptr = &cave[creature_ptr->y][creature_ptr->x];
49734973 feature_type *f_ptr = &f_info[c_ptr->feat];
49744974
49754975 if (!have_flag(f_ptr->flags, FF_PROJECT) ||
@@ -5098,7 +5098,7 @@ bool sword_dancing(player_type *creature_ptr)
50985098 DIRECTION dir;
50995099 POSITION y = 0, x = 0;
51005100 int i;
5101- cave_type *c_ptr;
5101+ grid_type *c_ptr;
51025102
51035103 for (i = 0; i < 6; i++)
51045104 {
--- a/src/spells3.c
+++ b/src/spells3.c
@@ -1377,7 +1377,7 @@ void brand_weapon(int brand_type)
13771377 static bool vanish_dungeon(void)
13781378 {
13791379 POSITION y, x;
1380- cave_type *c_ptr;
1380+ grid_type *c_ptr;
13811381 feature_type *f_ptr;
13821382 monster_type *m_ptr;
13831383 GAME_TEXT m_name[MAX_NLEN];
@@ -1505,7 +1505,7 @@ static bool vanish_dungeon(void)
15051505 void call_the_(void)
15061506 {
15071507 int i;
1508- cave_type *c_ptr;
1508+ grid_type *c_ptr;
15091509 bool do_call = TRUE;
15101510
15111511 for (i = 0; i < 9; i++)
@@ -1588,7 +1588,7 @@ void fetch(DIRECTION dir, WEIGHT wgt, bool require_los)
15881588 {
15891589 POSITION ty, tx;
15901590 OBJECT_IDX i;
1591- cave_type *c_ptr;
1591+ grid_type *c_ptr;
15921592 object_type *o_ptr;
15931593 GAME_TEXT o_name[MAX_NLEN];
15941594
@@ -4141,7 +4141,7 @@ static MONRACE_IDX poly_r_idx(MONRACE_IDX r_idx)
41414141 */
41424142 bool polymorph_monster(POSITION y, POSITION x)
41434143 {
4144- cave_type *c_ptr = &cave[y][x];
4144+ grid_type *c_ptr = &cave[y][x];
41454145 monster_type *m_ptr = &m_list[c_ptr->m_idx];
41464146 bool polymorphed = FALSE;
41474147 MONRACE_IDX new_r_idx;
@@ -4579,7 +4579,7 @@ bool eat_magic(int power)
45794579 void massacre(void)
45804580 {
45814581 POSITION x, y;
4582- cave_type *c_ptr;
4582+ grid_type *c_ptr;
45834583 monster_type *m_ptr;
45844584 DIRECTION dir;
45854585
@@ -4599,7 +4599,7 @@ void massacre(void)
45994599 bool eat_lock(void)
46004600 {
46014601 POSITION x, y;
4602- cave_type *c_ptr;
4602+ grid_type *c_ptr;
46034603 feature_type *f_ptr, *mimic_f_ptr;
46044604 DIRECTION dir;
46054605
--- a/src/store.c
+++ b/src/store.c
@@ -5749,7 +5749,7 @@ void do_cmd_store(void)
57495749 int which;
57505750 int maintain_num;
57515751 int i;
5752- cave_type *c_ptr;
5752+ grid_type *c_ptr;
57535753 bool need_redraw_store_inv; /* To redraw missiles damage and prices in store */
57545754 TERM_LEN w, h;
57555755
--- a/src/trap.c
+++ b/src/trap.c
@@ -82,7 +82,7 @@ FEAT_IDX choose_random_trap(void)
8282 */
8383 void disclose_grid(POSITION y, POSITION x)
8484 {
85- cave_type *c_ptr = &cave[y][x];
85+ grid_type *c_ptr = &cave[y][x];
8686
8787 if (cave_have_flag_grid(c_ptr, FF_SECRET))
8888 {
@@ -111,7 +111,7 @@ void disclose_grid(POSITION y, POSITION x)
111111 */
112112 void place_trap(POSITION y, POSITION x)
113113 {
114- cave_type *c_ptr = &cave[y][x];
114+ grid_type *c_ptr = &cave[y][x];
115115
116116 /* Paranoia -- verify location */
117117 if (!in_bounds(y, x)) return;
@@ -303,7 +303,7 @@ void hit_trap(bool break_trap)
303303 POSITION x = p_ptr->x, y = p_ptr->y;
304304
305305 /* Get the cave grid */
306- cave_type *c_ptr = &cave[y][x];
306+ grid_type *c_ptr = &cave[y][x];
307307 feature_type *f_ptr = &f_info[c_ptr->feat];
308308 int trap_feat_type = have_flag(f_ptr->flags, FF_TRAP) ? f_ptr->subtype : NOT_TRAP;
309309 concptr name = _("トラップ", "a trap");
--- a/src/types.h
+++ b/src/types.h
@@ -37,7 +37,7 @@
3737 *
3838 * Certain data is saved in multiple places for efficient access, currently,
3939 * this includes the tval/sval/weight fields in "object_type", various fields
40- * in "header_type", and the "m_idx" and "o_idx" fields in "cave_type". All
40+ * in "header_type", and the "m_idx" and "o_idx" fields in "grid_type". All
4141 * of these could be removed, but this would, in general, slow down the game
4242 * and increase the complexity of the code.
4343 * </pre>
@@ -450,9 +450,9 @@ struct skill_table
450450 * Note the special fields for the "MONSTER_FLOW" code.
451451 */
452452
453-typedef struct cave_type cave_type;
453+typedef struct grid_type grid_type;
454454
455-struct cave_type
455+struct grid_type
456456 {
457457 BIT_FLAGS info; /* Hack -- cave flags */
458458
--- a/src/variable.c
+++ b/src/variable.c
@@ -465,7 +465,7 @@ const concptr angband_music_basic_name[MUSIC_BASIC_MAX] =
465465 * Not completely allocated, that would be inefficient
466466 * Not completely hardcoded, that would overflow memory
467467 */
468-cave_type *cave[MAX_HGT];
468+grid_type *cave[MAX_HGT];
469469
470470
471471 /*
--- a/src/view-mainwindow.c
+++ b/src/view-mainwindow.c
@@ -1695,7 +1695,7 @@ void print_monster_list(TERM_LEN x, TERM_LEN y, TERM_LEN max_lines){
16951695 int i;
16961696
16971697 for(i=0;i<temp_n;i++){
1698- cave_type* c_ptr = &cave[temp_y[i]][temp_x[i]];
1698+ grid_type* c_ptr = &cave[temp_y[i]][temp_x[i]];
16991699 if(!c_ptr->m_idx || !m_list[c_ptr->m_idx].ml)continue;//no mons or cannot look
17001700 m_ptr = &m_list[c_ptr->m_idx];
17011701 if(is_pet(m_ptr))continue;//pet
--- a/src/wild.c
+++ b/src/wild.c
@@ -449,7 +449,7 @@ static border_type border;
449449 void wilderness_gen(void)
450450 {
451451 int i, y, x, lim;
452- cave_type *c_ptr;
452+ grid_type *c_ptr;
453453 feature_type *f_ptr;
454454
455455 /* Big town */
--- a/src/wizard2.c
+++ b/src/wizard2.c
@@ -1573,7 +1573,7 @@ static void do_cmd_wiz_create_feature(void)
15731573 {
15741574 static int prev_feat = 0;
15751575 static int prev_mimic = 0;
1576- cave_type *c_ptr;
1576+ grid_type *c_ptr;
15771577 feature_type *f_ptr;
15781578 char tmp_val[160];
15791579 IDX tmp_feat, tmp_mimic;
--- a/src/xtra2.c
+++ b/src/xtra2.c
@@ -590,8 +590,8 @@ static bool ang_sort_comp_importance(vptr u, vptr v, int a, int b)
590590 {
591591 POSITION *x = (POSITION*)(u);
592592 POSITION *y = (POSITION*)(v);
593- cave_type *ca_ptr = &cave[y[a]][x[a]];
594- cave_type *cb_ptr = &cave[y[b]][x[b]];
593+ grid_type *ca_ptr = &cave[y[a]][x[a]];
594+ grid_type *cb_ptr = &cave[y[b]][x[b]];
595595 monster_type *ma_ptr = &m_list[ca_ptr->m_idx];
596596 monster_type *mb_ptr = &m_list[cb_ptr->m_idx];
597597 monster_race *ap_ra_ptr, *ap_rb_ptr;
@@ -728,7 +728,7 @@ static POSITION_IDX target_pick(POSITION y1, POSITION x1, POSITION dy, POSITION
728728 */
729729 static bool target_set_accept(POSITION y, POSITION x)
730730 {
731- cave_type *c_ptr;
731+ grid_type *c_ptr;
732732 OBJECT_IDX this_o_idx, next_o_idx = 0;
733733
734734 /* Bounds */
@@ -814,7 +814,7 @@ static void target_set_prepare(BIT_FLAGS mode)
814814 {
815815 for (x = min_wid; x <= max_wid; x++)
816816 {
817- cave_type *c_ptr;
817+ grid_type *c_ptr;
818818
819819 /* Require "interesting" contents */
820820 if (!target_set_accept(y, x)) continue;
@@ -948,7 +948,7 @@ bool show_gold_on_floor = FALSE;
948948 */
949949 static char target_set_aux(POSITION y, POSITION x, BIT_FLAGS mode, concptr info)
950950 {
951- cave_type *c_ptr = &cave[y][x];
951+ grid_type *c_ptr = &cave[y][x];
952952 OBJECT_IDX this_o_idx, next_o_idx = 0;
953953 concptr s1 = "", s2 = "", s3 = "", x_info = "";
954954 bool boring = TRUE;
@@ -1493,7 +1493,7 @@ bool target_set(BIT_FLAGS mode)
14931493 char query;
14941494 char info[80];
14951495 char same_key;
1496- cave_type *c_ptr;
1496+ grid_type *c_ptr;
14971497 TERM_LEN wid, hgt;
14981498
14991499 get_screen_size(&wid, &hgt);
@@ -2366,7 +2366,7 @@ bool get_rep_dir(DIRECTION *dp, bool under)
23662366 */
23672367 static bool tgt_pt_accept(POSITION y, POSITION x)
23682368 {
2369- cave_type *c_ptr;
2369+ grid_type *c_ptr;
23702370
23712371 /* Bounds */
23722372 if (!(in_bounds(y, x))) return (FALSE);
@@ -2494,7 +2494,7 @@ bool tgt_pt(POSITION *x_ptr, POSITION *y_ptr)
24942494 /* Skip stairs which have defferent distance */
24952495 for (; n < temp_n; ++ n)
24962496 {
2497- cave_type *c_ptr = &cave[temp_y[n]][temp_x[n]];
2497+ grid_type *c_ptr = &cave[temp_y[n]][temp_x[n]];
24982498
24992499 if (cave_have_flag_grid(c_ptr, FF_STAIRS) &&
25002500 cave_have_flag_grid(c_ptr, ch == '>' ? FF_MORE : FF_LESS))
Show on old repository browser