OSDN Git Service

サーペントに乗馬できる複合バグ(1)+(2)+(3)修正。
authormogami <mogami@0568b783-4c39-0410-ac80-bf13821ea2a2>
Sat, 1 Feb 2003 09:37:42 +0000 (09:37 +0000)
committermogami <mogami@0568b783-4c39-0410-ac80-bf13821ea2a2>
Sat, 1 Feb 2003 09:37:42 +0000 (09:37 +0000)
(1) レベルテレポートで繋った階を結ぶ階段を捜して、その階段の上にモンス
ターを誘いこみ、レベルテレポで先回りして階段の反対側から元のフロアに戻
ると、その階段の上にいるモンスターに重なる事ができるバグ。
(2) 騎兵の荒馬馴らしで乗馬した直後に落馬する場合、まわりが敵で埋まって
いてしかも元自分が居た場所もバグ(1)によって埋まっていたとき、落馬が失
敗して荒馬馴らしの対象の敵にp_ptr->ridingが設定されたままになるバグ。
(3) 階を移動してペットが付いてくる時、p_ptr->ridingが設定されていれば
ペットフラグが無くても付いてくる上、ペットフラグが無いときに強制的に付
けていたバグ。

src/cmd5.c
src/floors.c
src/racial.c

index 9e21eeb..ce1377e 100644 (file)
@@ -5675,7 +5675,7 @@ msg_print("
 #ifdef JP
 msg_print("¤½¤Î¥â¥ó¥¹¥¿¡¼¤Ï¥Ú¥Ã¥È¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£");
 #else
-                       msg_print("That monster is no a pet.");
+                       msg_print("That monster is not a pet.");
 #endif
 
                        return FALSE;
index fcb349d..3b5a7a1 100644 (file)
@@ -455,7 +455,10 @@ static void place_pet(void)
                        m_ptr->fx = cx;
                        m_ptr->ml = TRUE;
                        m_ptr->csleep = 0;
-                       set_pet(m_ptr);
+
+                       /* Paranoia */
+                       m_ptr->hold_o_idx = 0;
+                       m_ptr->target_y = 0;
 
                        if ((r_ptr->flags1 & RF1_FORCE_SLEEP) && !ironman_nightmare)
                        {
@@ -547,6 +550,77 @@ static void update_unique_artifact(s16b cur_floor_id)
 
 
 /*
+ * When a monster is at a place where player will return,
+ * Get out of the my way!
+ */
+static void get_out_monster()
+{
+       int tries = 0;
+       int dis = 1;
+       int oy = py;
+       int ox = px;
+       int m_idx = cave[oy][ox].m_idx;
+
+       /* Nothing to do if no monster */
+       if (!m_idx) return;
+
+       /* Look until done */
+       while (TRUE)
+       {
+               monster_type *m_ptr;
+
+               /* Pick a (possibly illegal) location */
+               int ny = rand_spread(oy, dis);
+               int nx = rand_spread(ox, dis);
+
+               tries++;
+
+               /* Stop after 1000 tries */
+               if (tries > 10000) return;
+
+               /*
+                * Increase distance after doing enough tries
+                * compared to area of possible space
+                */
+               if (tries > 20 * dis * dis) dis++;
+
+               /* Ignore illegal locations */
+               if (!in_bounds(ny, nx)) continue;
+
+               /* Require "empty" floor space */
+               if (!cave_empty_bold(ny, nx)) continue;
+
+               /* Hack -- no teleport onto glyph of warding */
+               if (is_glyph_grid(&cave[ny][nx])) continue;
+               if (is_explosive_rune_grid(&cave[ny][nx])) continue;
+
+               /* ...nor onto the Pattern */
+               if ((cave[ny][nx].feat >= FEAT_PATTERN_START) &&
+                   (cave[ny][nx].feat <= FEAT_PATTERN_XTRA2)) continue;
+
+               /*** It's a good place ***/
+
+               m_ptr = &m_list[m_idx];
+
+               /* Update the new location */
+               cave[ny][nx].m_idx = m_idx;
+
+               /* Update the old location */
+               cave[oy][ox].m_idx = 0;
+
+               /* Move the monster */
+               m_ptr->fy = ny;
+               m_ptr->fx = nx; 
+
+               /* No need to do update_mon() */
+
+               /* Success */
+               return;
+       }
+}
+
+
+/*
  * Maintain quest monsters, mark next floor_id at stairs, save current
  * floor, and prepare to enter next floor.
  */
@@ -817,6 +891,9 @@ void leave_floor(void)
        /* If you can return, you need to save previous floor */
        if (!(change_floor_mode & (CFM_NO_RETURN | CFM_CLEAR_ALL)))
        {
+               /* Get out of the my way! */
+               get_out_monster();
+
                /* Record the last visit turn of current floor */
                sf_ptr->last_visit = turn;
 
index d3d84cf..15c0751 100644 (file)
@@ -1344,6 +1344,10 @@ msg_print("
                                        msg_format("You have thrown off by %s.",m_name);
 #endif
                                        rakuba(1,TRUE);
+
+                                       /* Paranoia */
+                                       /* ÍîÇϽèÍý¤Ë¼ºÇÔ¤·¤Æ¤â¤È¤Ë¤«¤¯¾èÇϲò½ü */
+                                       p_ptr->riding = 0;
                                }
                        }
                        break;