OSDN Git Service

更新指示に関する変更.
[hengband/hengband.git] / src / cmd2.c
index 36e886e..da90f68 100644 (file)
@@ -1124,9 +1124,6 @@ static bool do_cmd_open_aux(int y, int x)
                        /* Open the door */
                        cave_alter_feat(y, x, FF_OPEN);
 
-                       /* Update some things */
-                       p_ptr->update |= (PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
-
                        /* Sound */
                        sound(SOUND_OPENDOOR);
 
@@ -1159,9 +1156,6 @@ static bool do_cmd_open_aux(int y, int x)
                /* Open the door */
                cave_alter_feat(y, x, FF_OPEN);
 
-               /* Update some things */
-               p_ptr->update |= (PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
-
                /* Sound */
                sound(SOUND_OPENDOOR);
        }
@@ -1321,8 +1315,11 @@ static bool do_cmd_close_aux(int y, int x)
        /* Open door */
        if (have_flag(f_info[old_feat].flags, FF_CLOSE))
        {
+               s16b closed_feat = feat_state(old_feat, FF_CLOSE);
+
                /* Hack -- object in the way */
-               if ((c_ptr->o_idx || (c_ptr->info & CAVE_OBJECT)) && (feat_state(old_feat, FF_CLOSE) != old_feat))
+               if ((c_ptr->o_idx || (c_ptr->info & CAVE_OBJECT)) &&
+                   (closed_feat != old_feat) && !have_flag(f_info[closed_feat].flags, FF_DROP))
                {
                        /* Message */
 #ifdef JP
@@ -1348,9 +1345,6 @@ static bool do_cmd_close_aux(int y, int x)
                        }
                        else
                        {
-                               /* Update some things */
-                               p_ptr->update |= (PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
-
                                /* Sound */
                                sound(SOUND_SHUTDOOR);
                        }
@@ -1482,7 +1476,7 @@ static bool do_cmd_tunnel_test(int y, int x)
        }
 
        /* Must be a wall/door/etc */
-       if (!have_flag(f_flags_grid(c_ptr), FF_TUNNEL))
+       if (!cave_have_flag_grid(c_ptr, FF_TUNNEL))
        {
                /* Message */
 #ifdef JP
@@ -1576,7 +1570,7 @@ static bool do_cmd_tunnel_aux(int y, int x)
                        cave_alter_feat(y, x, FF_TUNNEL);
 
                        /* Update some things */
-                       p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MONSTERS | PU_MON_LITE);
+                       p_ptr->update |= (PU_FLOW);
                }
                else
                {
@@ -1600,18 +1594,23 @@ static bool do_cmd_tunnel_aux(int y, int x)
                {
 #ifdef JP
                        if (tree) msg_format("%s¤òÀÚ¤êʧ¤Ã¤¿¡£", name);
-                       else msg_print("·ê¤ò·¡¤ê½ª¤¨¤¿¡£");
+                       else
+                       {
+                               msg_print("·ê¤ò·¡¤ê½ª¤¨¤¿¡£");
+                               p_ptr->update |= (PU_FLOW);
+                       }
 #else
                        if (tree) msg_format("You have cleared away the %s.", name);
-                       else msg_print("You have finished the tunnel.");
+                       else
+                       {
+                               msg_print("You have finished the tunnel.");
+                               p_ptr->update |= (PU_FLOW);
+                       }
 #endif
 
                        /* Remove the feature */
                        cave_alter_feat(y, x, FF_TUNNEL);
 
-                       /* Update some things */
-                       p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MONSTERS | PU_MON_LITE);
-
                        chg_virtue(V_DILIGENCE, 1);
                        chg_virtue(V_NATURE, -1);
                }
@@ -1823,13 +1822,9 @@ bool easy_open_door(int y, int x)
                        msg_print("You have picked the lock.");
 #endif
 
-
                        /* Open the door */
                        cave_alter_feat(y, x, FF_OPEN);
 
-                       /* Update some things */
-                       p_ptr->update |= (PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
-
                        /* Sound */
                        sound(SOUND_OPENDOOR);
 
@@ -1859,9 +1854,6 @@ bool easy_open_door(int y, int x)
                /* Open the door */
                cave_alter_feat(y, x, FF_OPEN);
 
-               /* Update some things */
-               p_ptr->update |= (PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
-
                /* Sound */
                sound(SOUND_OPENDOOR);
        }
@@ -2300,10 +2292,6 @@ static bool do_cmd_bash_aux(int y, int x, int dir)
 
                /* Hack -- Fall through the door */
                move_player(dir, FALSE, FALSE);
-
-               /* Update some things */
-               p_ptr->update |= (PU_VIEW | PU_LITE | PU_MON_LITE);
-               p_ptr->update |= (PU_DISTANCE);
        }
 
        /* Saving throw against stun */
@@ -2728,7 +2716,7 @@ void do_cmd_walk(bool pickup)
        }
 
        /* Hack again -- Is there a special encounter ??? */
-       if (p_ptr->wild_mode && !have_flag(f_flags_bold(py, px), FF_TOWN))
+       if (p_ptr->wild_mode && !cave_have_flag_bold(py, px, FF_TOWN))
        {
                int tmp = 120 + p_ptr->lev*10 - wilderness[py][px].level + 5;
                if (tmp < 1) 
@@ -2986,7 +2974,7 @@ static s16b tot_dam_aux_shot(object_type *o_ptr, int tdam, monster_type *m_ptr)
                        if ((have_flag(flgs, TR_SLAY_ANIMAL)) &&
                            (r_ptr->flags3 & RF3_ANIMAL))
                        {
-                               if (m_ptr->ml && is_original_ap(m_ptr))
+                               if (is_original_ap_and_seen(m_ptr))
                                {
                                        r_ptr->r_flags3 |= RF3_ANIMAL;
                                }
@@ -2998,7 +2986,7 @@ static s16b tot_dam_aux_shot(object_type *o_ptr, int tdam, monster_type *m_ptr)
                        if ((have_flag(flgs, TR_KILL_ANIMAL)) &&
                            (r_ptr->flags3 & RF3_ANIMAL))
                        {
-                               if (m_ptr->ml && is_original_ap(m_ptr))
+                               if (is_original_ap_and_seen(m_ptr))
                                {
                                        r_ptr->r_flags3 |= RF3_ANIMAL;
                                }
@@ -3010,7 +2998,7 @@ static s16b tot_dam_aux_shot(object_type *o_ptr, int tdam, monster_type *m_ptr)
                        if ((have_flag(flgs, TR_SLAY_EVIL)) &&
                            (r_ptr->flags3 & RF3_EVIL))
                        {
-                               if (m_ptr->ml && is_original_ap(m_ptr))
+                               if (is_original_ap_and_seen(m_ptr))
                                {
                                        r_ptr->r_flags3 |= RF3_EVIL;
                                }
@@ -3022,7 +3010,7 @@ static s16b tot_dam_aux_shot(object_type *o_ptr, int tdam, monster_type *m_ptr)
                        if ((have_flag(flgs, TR_KILL_EVIL)) &&
                            (r_ptr->flags3 & RF3_EVIL))
                        {
-                               if (m_ptr->ml && is_original_ap(m_ptr))
+                               if (is_original_ap_and_seen(m_ptr))
                                {
                                        r_ptr->r_flags3 |= RF3_EVIL;
                                }
@@ -3034,7 +3022,7 @@ static s16b tot_dam_aux_shot(object_type *o_ptr, int tdam, monster_type *m_ptr)
                        if ((have_flag(flgs, TR_SLAY_HUMAN)) &&
                            (r_ptr->flags2 & RF2_HUMAN))
                        {
-                               if (m_ptr->ml && is_original_ap(m_ptr))
+                               if (is_original_ap_and_seen(m_ptr))
                                {
                                        r_ptr->r_flags2 |= RF2_HUMAN;
                                }
@@ -3046,7 +3034,7 @@ static s16b tot_dam_aux_shot(object_type *o_ptr, int tdam, monster_type *m_ptr)
                        if ((have_flag(flgs, TR_KILL_HUMAN)) &&
                            (r_ptr->flags2 & RF2_HUMAN))
                        {
-                               if (m_ptr->ml && is_original_ap(m_ptr))
+                               if (is_original_ap_and_seen(m_ptr))
                                {
                                        r_ptr->r_flags2 |= RF2_HUMAN;
                                }
@@ -3058,7 +3046,7 @@ static s16b tot_dam_aux_shot(object_type *o_ptr, int tdam, monster_type *m_ptr)
                        if ((have_flag(flgs, TR_SLAY_UNDEAD)) &&
                            (r_ptr->flags3 & RF3_UNDEAD))
                        {
-                               if (m_ptr->ml && is_original_ap(m_ptr))
+                               if (is_original_ap_and_seen(m_ptr))
                                {
                                        r_ptr->r_flags3 |= RF3_UNDEAD;
                                }
@@ -3070,7 +3058,7 @@ static s16b tot_dam_aux_shot(object_type *o_ptr, int tdam, monster_type *m_ptr)
                        if ((have_flag(flgs, TR_KILL_UNDEAD)) &&
                            (r_ptr->flags3 & RF3_UNDEAD))
                        {
-                               if (m_ptr->ml && is_original_ap(m_ptr))
+                               if (is_original_ap_and_seen(m_ptr))
                                {
                                        r_ptr->r_flags3 |= RF3_UNDEAD;
                                }
@@ -3082,7 +3070,7 @@ static s16b tot_dam_aux_shot(object_type *o_ptr, int tdam, monster_type *m_ptr)
                        if ((have_flag(flgs, TR_SLAY_DEMON)) &&
                            (r_ptr->flags3 & RF3_DEMON))
                        {
-                               if (m_ptr->ml && is_original_ap(m_ptr))
+                               if (is_original_ap_and_seen(m_ptr))
                                {
                                        r_ptr->r_flags3 |= RF3_DEMON;
                                }
@@ -3094,7 +3082,7 @@ static s16b tot_dam_aux_shot(object_type *o_ptr, int tdam, monster_type *m_ptr)
                        if ((have_flag(flgs, TR_KILL_DEMON)) &&
                            (r_ptr->flags3 & RF3_DEMON))
                        {
-                               if (m_ptr->ml && is_original_ap(m_ptr))
+                               if (is_original_ap_and_seen(m_ptr))
                                {
                                        r_ptr->r_flags3 |= RF3_DEMON;
                                }
@@ -3106,7 +3094,7 @@ static s16b tot_dam_aux_shot(object_type *o_ptr, int tdam, monster_type *m_ptr)
                        if ((have_flag(flgs, TR_SLAY_ORC)) &&
                            (r_ptr->flags3 & RF3_ORC))
                        {
-                               if (m_ptr->ml && is_original_ap(m_ptr))
+                               if (is_original_ap_and_seen(m_ptr))
                                {
                                        r_ptr->r_flags3 |= RF3_ORC;
                                }
@@ -3118,7 +3106,7 @@ static s16b tot_dam_aux_shot(object_type *o_ptr, int tdam, monster_type *m_ptr)
                        if ((have_flag(flgs, TR_KILL_ORC)) &&
                            (r_ptr->flags3 & RF3_ORC))
                        {
-                               if (m_ptr->ml && is_original_ap(m_ptr))
+                               if (is_original_ap_and_seen(m_ptr))
                                {
                                        r_ptr->r_flags3 |= RF3_ORC;
                                }
@@ -3130,7 +3118,7 @@ static s16b tot_dam_aux_shot(object_type *o_ptr, int tdam, monster_type *m_ptr)
                        if ((have_flag(flgs, TR_SLAY_TROLL)) &&
                            (r_ptr->flags3 & RF3_TROLL))
                        {
-                               if (m_ptr->ml && is_original_ap(m_ptr))
+                               if (is_original_ap_and_seen(m_ptr))
                                {
                                        r_ptr->r_flags3 |= RF3_TROLL;
                                }
@@ -3142,7 +3130,7 @@ static s16b tot_dam_aux_shot(object_type *o_ptr, int tdam, monster_type *m_ptr)
                        if ((have_flag(flgs, TR_KILL_TROLL)) &&
                            (r_ptr->flags3 & RF3_TROLL))
                        {
-                               if (m_ptr->ml && is_original_ap(m_ptr))
+                               if (is_original_ap_and_seen(m_ptr))
                                {
                                        r_ptr->r_flags3 |= RF3_TROLL;
                                }
@@ -3154,7 +3142,7 @@ static s16b tot_dam_aux_shot(object_type *o_ptr, int tdam, monster_type *m_ptr)
                        if ((have_flag(flgs, TR_SLAY_GIANT)) &&
                            (r_ptr->flags3 & RF3_GIANT))
                        {
-                               if (m_ptr->ml && is_original_ap(m_ptr))
+                               if (is_original_ap_and_seen(m_ptr))
                                {
                                        r_ptr->r_flags3 |= RF3_GIANT;
                                }
@@ -3166,7 +3154,7 @@ static s16b tot_dam_aux_shot(object_type *o_ptr, int tdam, monster_type *m_ptr)
                        if ((have_flag(flgs, TR_KILL_GIANT)) &&
                            (r_ptr->flags3 & RF3_GIANT))
                        {
-                               if (m_ptr->ml && is_original_ap(m_ptr))
+                               if (is_original_ap_and_seen(m_ptr))
                                {
                                        r_ptr->r_flags3 |= RF3_GIANT;
                                }
@@ -3178,7 +3166,7 @@ static s16b tot_dam_aux_shot(object_type *o_ptr, int tdam, monster_type *m_ptr)
                        if ((have_flag(flgs, TR_SLAY_DRAGON)) &&
                            (r_ptr->flags3 & RF3_DRAGON))
                        {
-                               if (m_ptr->ml && is_original_ap(m_ptr))
+                               if (is_original_ap_and_seen(m_ptr))
                                {
                                        r_ptr->r_flags3 |= RF3_DRAGON;
                                }
@@ -3190,7 +3178,7 @@ static s16b tot_dam_aux_shot(object_type *o_ptr, int tdam, monster_type *m_ptr)
                        if ((have_flag(flgs, TR_KILL_DRAGON)) &&
                            (r_ptr->flags3 & RF3_DRAGON))
                        {
-                               if (m_ptr->ml && is_original_ap(m_ptr))
+                               if (is_original_ap_and_seen(m_ptr))
                                {
                                        r_ptr->r_flags3 |= RF3_DRAGON;
                                }
@@ -3209,7 +3197,7 @@ static s16b tot_dam_aux_shot(object_type *o_ptr, int tdam, monster_type *m_ptr)
                                /* Notice immunity */
                                if (r_ptr->flagsr & RFR_EFF_IM_ACID_MASK)
                                {
-                                       if (m_ptr->ml && is_original_ap(m_ptr))
+                                       if (is_original_ap_and_seen(m_ptr))
                                        {
                                                r_ptr->r_flagsr |= (r_ptr->flagsr & RFR_EFF_IM_ACID_MASK);
                                        }
@@ -3228,7 +3216,7 @@ static s16b tot_dam_aux_shot(object_type *o_ptr, int tdam, monster_type *m_ptr)
                                /* Notice immunity */
                                if (r_ptr->flagsr & RFR_EFF_IM_ELEC_MASK)
                                {
-                                       if (m_ptr->ml && is_original_ap(m_ptr))
+                                       if (is_original_ap_and_seen(m_ptr))
                                        {
                                                r_ptr->r_flagsr |= (r_ptr->flagsr & RFR_EFF_IM_ELEC_MASK);
                                        }
@@ -3247,7 +3235,7 @@ static s16b tot_dam_aux_shot(object_type *o_ptr, int tdam, monster_type *m_ptr)
                                /* Notice immunity */
                                if (r_ptr->flagsr & RFR_EFF_IM_FIRE_MASK)
                                {
-                                       if (m_ptr->ml && is_original_ap(m_ptr))
+                                       if (is_original_ap_and_seen(m_ptr))
                                        {
                                                r_ptr->r_flagsr |= (r_ptr->flagsr & RFR_EFF_IM_FIRE_MASK);
                                        }
@@ -3259,7 +3247,7 @@ static s16b tot_dam_aux_shot(object_type *o_ptr, int tdam, monster_type *m_ptr)
                                        if (r_ptr->flags3 & RF3_HURT_FIRE)
                                        {
                                                if (mult < 25) mult = 25;
-                                               if (m_ptr->ml && is_original_ap(m_ptr))
+                                               if (is_original_ap_and_seen(m_ptr))
                                                {
                                                        r_ptr->r_flags3 |= RF3_HURT_FIRE;
                                                }
@@ -3274,7 +3262,7 @@ static s16b tot_dam_aux_shot(object_type *o_ptr, int tdam, monster_type *m_ptr)
                                /* Notice immunity */
                                if (r_ptr->flagsr & RFR_EFF_IM_COLD_MASK)
                                {
-                                       if (m_ptr->ml && is_original_ap(m_ptr))
+                                       if (is_original_ap_and_seen(m_ptr))
                                        {
                                                r_ptr->r_flagsr |= (r_ptr->flagsr & RFR_EFF_IM_COLD_MASK);
                                        }
@@ -3285,7 +3273,7 @@ static s16b tot_dam_aux_shot(object_type *o_ptr, int tdam, monster_type *m_ptr)
                                        if (r_ptr->flags3 & RF3_HURT_COLD)
                                        {
                                                if (mult < 25) mult = 25;
-                                               if (m_ptr->ml && is_original_ap(m_ptr))
+                                               if (is_original_ap_and_seen(m_ptr))
                                                {
                                                        r_ptr->r_flags3 |= RF3_HURT_COLD;
                                                }
@@ -3300,7 +3288,7 @@ static s16b tot_dam_aux_shot(object_type *o_ptr, int tdam, monster_type *m_ptr)
                                /* Notice immunity */
                                if (r_ptr->flagsr & RFR_EFF_IM_POIS_MASK)
                                {
-                                       if (m_ptr->ml && is_original_ap(m_ptr))
+                                       if (is_original_ap_and_seen(m_ptr))
                                        {
                                                r_ptr->r_flagsr |= (r_ptr->flagsr & RFR_EFF_IM_POIS_MASK);
                                        }
@@ -3359,7 +3347,7 @@ static s16b tot_dam_aux_shot(object_type *o_ptr, int tdam, monster_type *m_ptr)
 void do_cmd_fire_aux(int item, object_type *j_ptr)
 {
        int dir;
-       int j, y, x, ny, nx, ty, tx;
+       int j, y, x, ny, nx, ty, tx, prev_y, prev_x;
        int tdam, tdis, thits, tmul;
        int bonus, chance;
        int cur_dis, visible;
@@ -3501,6 +3489,9 @@ void do_cmd_fire_aux(int item, object_type *j_ptr)
        /* Hack -- Handle stuff */
        handle_stuff();
 
+       /* Save the old location */
+       prev_y = y;
+       prev_x = x;
 
        /* Travel until stopped */
        for (cur_dis = 0; cur_dis <= tdis; )
@@ -3514,7 +3505,7 @@ void do_cmd_fire_aux(int item, object_type *j_ptr)
                mmove2(&ny, &nx, py, px, ty, tx);
 
                /* Stopped by walls/doors */
-               if (!have_flag(f_flags_bold(ny, nx), FF_PROJECT) && !cave[ny][nx].m_idx) break;
+               if (!cave_have_flag_bold(ny, nx, FF_PROJECT) && !cave[ny][nx].m_idx) break;
 
                /* Advance the distance */
                cur_dis++;
@@ -3542,6 +3533,10 @@ void do_cmd_fire_aux(int item, object_type *j_ptr)
                        Term_xtra(TERM_XTRA_DELAY, msec);
                }
 
+               /* Save the old location */
+               prev_y = y;
+               prev_x = x;
+
                /* Save the new location */
                x = nx;
                y = ny;
@@ -3720,27 +3715,27 @@ void do_cmd_fire_aux(int item, object_type *j_ptr)
        /* Chance of breakage (during attacks) */
        j = (hit_body ? breakage_chance(q_ptr) : 0);
 
-       if(stick_to)
+       if (stick_to)
        {
                int m_idx = cave[y][x].m_idx;
                monster_type *m_ptr = &m_list[m_idx];
                int o_idx = o_pop();
 
                if (!o_idx)
-                 {
+               {
 #ifdef JP
-                   msg_format("%s¤Ï¤É¤³¤«¤Ø¹Ô¤Ã¤¿¡£", o_name);
+                       msg_format("%s¤Ï¤É¤³¤«¤Ø¹Ô¤Ã¤¿¡£", o_name);
 #else
-                   msg_format("The %s have gone to somewhere.", o_name);
+                       msg_format("The %s have gone to somewhere.", o_name);
 #endif
-                   if (object_is_fixed_artifact(q_ptr))
-                     {
-                       a_info[j_ptr->name1].cur_num = 0;
-                     }
-                   return;
-                 }
-
-               o_ptr = &o_list[ o_idx ];
+                       if (object_is_fixed_artifact(q_ptr))
+                       {
+                               a_info[j_ptr->name1].cur_num = 0;
+                       }
+                       return;
+               }
+
+               o_ptr = &o_list[o_idx];
                object_copy(o_ptr, q_ptr);
 
                /* Forget mark */
@@ -3757,11 +3752,17 @@ void do_cmd_fire_aux(int item, object_type *j_ptr)
 
                /* Carry object */
                m_ptr->hold_o_idx = o_idx;
-
        }
-       else
+       else if (cave_have_flag_bold(y, x, FF_PROJECT))
+       {
                /* Drop (or break) near that location */
                (void)drop_near(q_ptr, j, y, x);
+       }
+       else
+       {
+               /* Drop (or break) near that location */
+               (void)drop_near(q_ptr, j, prev_y, prev_x);
+       }
 }
 
 
@@ -3847,7 +3848,7 @@ static bool item_tester_hook_boomerang(object_type *o_ptr)
 bool do_cmd_throw_aux(int mult, bool boomerang, int shuriken)
 {
        int dir, item;
-       int i, j, y, x, ty, tx;
+       int i, j, y, x, ty, tx, prev_y, prev_x;
        int ny[19], nx[19];
        int chance, tdam, tdis;
        int mul, div;
@@ -3884,7 +3885,7 @@ bool do_cmd_throw_aux(int mult, bool boomerang, int shuriken)
        }
        else if (boomerang)
        {
-               if (buki_motteruka(INVEN_LARM))
+               if (buki_motteruka(INVEN_RARM) && buki_motteruka(INVEN_LARM))
                {
                        item_tester_hook = item_tester_hook_boomerang;
 #ifdef JP
@@ -3901,10 +3902,8 @@ bool do_cmd_throw_aux(int mult, bool boomerang, int shuriken)
                                return FALSE;
                        }
                }
-               else
-               {
-                       item = INVEN_RARM;
-               }
+               else if (buki_motteruka(INVEN_LARM)) item = INVEN_LARM;
+               else item = INVEN_RARM;
        }
        else
        {
@@ -4075,6 +4074,10 @@ bool do_cmd_throw_aux(int mult, bool boomerang, int shuriken)
 
        if (shuriken) chance *= 2;
 
+       /* Save the old location */
+       prev_y = y;
+       prev_x = x;
+
        /* Travel until stopped */
        for (cur_dis = 0; cur_dis <= tdis; )
        {
@@ -4087,27 +4090,24 @@ bool do_cmd_throw_aux(int mult, bool boomerang, int shuriken)
                mmove2(&ny[cur_dis], &nx[cur_dis], py, px, ty, tx);
 
                /* Stopped by walls/doors */
-               if (!have_flag(f_flags_bold(ny[cur_dis], nx[cur_dis]), FF_PROJECT))
+               if (!cave_have_flag_bold(ny[cur_dis], nx[cur_dis], FF_PROJECT))
                {
                        hit_wall = TRUE;
-                       break;
+                       if ((q_ptr->tval == TV_FIGURINE) || object_is_potion(q_ptr) || !cave[ny[cur_dis]][nx[cur_dis]].m_idx) break;
                }
 
-               /* Advance the distance */
-               cur_dis++;
-
                /* The player can see the (on screen) missile */
-               if (panel_contains(ny[cur_dis-1], nx[cur_dis-1]) && player_can_see_bold(ny[cur_dis-1], nx[cur_dis-1]))
+               if (panel_contains(ny[cur_dis], nx[cur_dis]) && player_can_see_bold(ny[cur_dis], nx[cur_dis]))
                {
                        char c = object_char(q_ptr);
                        byte a = object_attr(q_ptr);
 
                        /* Draw, Hilite, Fresh, Pause, Erase */
-                       print_rel(c, a, ny[cur_dis-1], nx[cur_dis-1]);
-                       move_cursor_relative(ny[cur_dis-1], nx[cur_dis-1]);
+                       print_rel(c, a, ny[cur_dis], nx[cur_dis]);
+                       move_cursor_relative(ny[cur_dis], nx[cur_dis]);
                        Term_fresh();
                        Term_xtra(TERM_XTRA_DELAY, msec);
-                       lite_spot(ny[cur_dis-1], nx[cur_dis-1]);
+                       lite_spot(ny[cur_dis], nx[cur_dis]);
                        Term_fresh();
                }
 
@@ -4118,10 +4118,16 @@ bool do_cmd_throw_aux(int mult, bool boomerang, int shuriken)
                        Term_xtra(TERM_XTRA_DELAY, msec);
                }
 
+               /* Save the old location */
+               prev_y = y;
+               prev_x = x;
+
                /* Save the new location */
-               x = nx[cur_dis-1];
-               y = ny[cur_dis-1];
+               x = nx[cur_dis];
+               y = ny[cur_dis];
 
+               /* Advance the distance */
+               cur_dis++;
 
                /* Monster here, Try to hit it */
                if (cave[y][x].m_idx)
@@ -4348,7 +4354,7 @@ msg_print("
 
                if((back_chance > 30) && (!one_in_(100) || super_boomerang))
                {
-                       for (i = cur_dis-1;i>0;i--)
+                       for (i = cur_dis - 1; i > 0; i--)
                        {
                                if (panel_contains(ny[i], nx[i]) && player_can_see_bold(ny[i], nx[i]))
                                {
@@ -4451,7 +4457,19 @@ msg_print("
        }
 
        /* Drop (or break) near that location */
-       if (do_drop) (void)drop_near(q_ptr, j, y, x);
+       if (do_drop)
+       {
+               if (cave_have_flag_bold(y, x, FF_PROJECT))
+               {
+                       /* Drop (or break) near that location */
+                       (void)drop_near(q_ptr, j, y, x);
+               }
+               else
+               {
+                       /* Drop (or break) near that location */
+                       (void)drop_near(q_ptr, j, prev_y, prev_x);
+               }
+       }
 
        return TRUE;
 }