From: nothere Date: Wed, 15 Oct 2003 14:39:37 +0000 (+0000) Subject: cave_empty_bold2()内での比較と同じことを2重に比較する部分の削除. X-Git-Tag: v2.1.2~1006 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=8dce94ddbd1ea4c0cdc23bdd7528af4ecd50f3fa;p=hengbandforosx%2Fhengbandosx.git cave_empty_bold2()内での比較と同じことを2重に比較する部分の削除. --- diff --git a/src/cmd5.c b/src/cmd5.c index 432791a1a..8290af803 100644 --- a/src/cmd5.c +++ b/src/cmd5.c @@ -5582,7 +5582,7 @@ bool do_riding(bool force) if (p_ptr->riding) { /* Skip non-empty grids */ - if (!cave_empty_bold2(y, x) || c_ptr->m_idx) + if (!cave_empty_bold2(y, x)) { #ifdef JP msg_print("¤½¤Á¤é¤Ë¤Ï¹ß¤ê¤é¤ì¤Þ¤»¤ó¡£"); diff --git a/src/monster2.c b/src/monster2.c index a57cd0da4..989c3f26c 100644 --- a/src/monster2.c +++ b/src/monster2.c @@ -2917,7 +2917,8 @@ byte get_mspeed(monster_race *r_ptr) */ static bool place_monster_one(int who, int y, int x, int r_idx, u32b mode) { - cave_type *c_ptr; + /* Access the location */ + cave_type *c_ptr = &cave[y][x]; monster_type *m_ptr; @@ -2932,10 +2933,10 @@ static bool place_monster_one(int who, int y, int x, int r_idx, u32b mode) if (!in_bounds(y, x)) return (FALSE); /* Require empty space (if not ghostly) */ - if (!(!dun_level && (cave[y][x].feat == FEAT_MOUNTAIN) && ((r_ptr->flags8 & RF8_WILD_MOUNTAIN) || (r_ptr->flags7 & RF7_CAN_FLY))) && + if (!(!dun_level && (c_ptr->feat == FEAT_MOUNTAIN) && ((r_ptr->flags8 & RF8_WILD_MOUNTAIN) || (r_ptr->flags7 & RF7_CAN_FLY))) && !(cave_empty_bold2(y, x) || (mode & PM_IGNORE_TERRAIN)) && !((r_ptr->flags2 & RF2_PASS_WALL) && - !(cave_perma_bold(y, x) || cave[y][x].m_idx || + !(cave_perma_bold(y, x) || c_ptr->m_idx || player_bold(y, x)))) return (FALSE); /* Paranoia */ @@ -2945,12 +2946,12 @@ static bool place_monster_one(int who, int y, int x, int r_idx, u32b mode) if (!r_ptr->name) return (FALSE); /* Nor on the Pattern */ - if ((cave[y][x].feat >= FEAT_PATTERN_START) - && (cave[y][x].feat <= FEAT_PATTERN_XTRA2)) + if ((c_ptr->feat >= FEAT_PATTERN_START) + && (c_ptr->feat <= FEAT_PATTERN_XTRA2)) return (FALSE); if (!(mode & PM_IGNORE_TERRAIN) && - !monster_can_cross_terrain(cave[y][x].feat, r_ptr)) + !monster_can_cross_terrain(c_ptr->feat, r_ptr)) { return FALSE; } @@ -3009,9 +3010,6 @@ static bool place_monster_one(int who, int y, int x, int r_idx, u32b mode) } } - /* Access the location */ - c_ptr = &cave[y][x]; - if (is_glyph_grid(c_ptr)) { if (randint1(BREAK_GLYPH) < (r_ptr->level+20)) @@ -3422,8 +3420,6 @@ static bool mon_scatter(int *yp, int *xp, int y, int x, int max_dist) /* Walls and Monsters block flow */ if (!cave_empty_bold2(ny, nx)) continue; - if (cave[ny][nx].m_idx) continue; - if (player_bold(ny, nx)) continue; /* ... nor on the Pattern */ if ((cave[ny][nx].feat >= FEAT_PATTERN_START) &&