OSDN Git Service

更新指示に関する変更.
authornothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Tue, 23 Dec 2003 15:29:35 +0000 (15:29 +0000)
committernothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Tue, 23 Dec 2003 15:29:35 +0000 (15:29 +0000)
* cave_set_feat()内でLOSフラグの変化を判定し, 必要に応じて視界/光源/
  モンスターの更新指示を発行する仕様に変更. 関連して, cave_set_feat()
  で発行されたものと重複する更新指示を削除. 考え方はUnAngbandから.
* 地震や落馬でのPU_DISTANCEはmove_player_effect()が呼ばれた場合のみに
  使えばいいので, PU_MONSTERSに置き換えた.
* ペットを解放する際はdelete_monster_idx()でPU_MON_LITEが呼ばれてお
  り,do_cmd_pet_dismiss()の最後のPU_MON_LITEは不要なので削除.

12 files changed:
src/cave.c
src/cmd1.c
src/cmd2.c
src/cmd5.c
src/hissatsu.c
src/melee2.c
src/racial.c
src/spells1.c
src/spells2.c
src/wizard2.c
src/xtra1.c
src/xtra2.c

index 412b788..a832632 100644 (file)
@@ -4519,6 +4519,7 @@ void cave_set_feat(int y, int x, int feat)
 {
        cave_type *c_ptr = &cave[y][x];
        feature_type *f_ptr = &f_info[feat];
+       bool old_los = cave_have_flag_bold(y, x, FF_LOS);
 
        /* Clear mimic type */
        c_ptr->mimic = 0;
@@ -4550,6 +4551,13 @@ void cave_set_feat(int y, int x, int feat)
 
                /* Redraw */
                lite_spot(y, x);
+
+               /* Check if los has changed */
+               if (old_los ^ have_flag(f_ptr->flags, FF_LOS))
+               {
+                       /* Update the visuals */
+                       p_ptr->update |= (PU_VIEW | PU_LITE | PU_MON_LITE | PU_MONSTERS);
+               }
        }
 
        /* Hack -- glow the deep lava */
index f01eedd..3fdfec3 100644 (file)
@@ -3498,10 +3498,7 @@ bool move_player_effect(int ny, int nx, u32b mpe_mode)
                verify_panel();
 
                /* Update stuff */
-               p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE);
-
-               /* Update the monsters */
-               p_ptr->update |= (PU_DISTANCE);
+               p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE | PU_DISTANCE);
 
                /* Window stuff */
                p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
@@ -4183,7 +4180,7 @@ void move_player(int dir, bool do_pickup, bool break_trap)
                        cave_alter_feat(y, x, FF_HURT_DISI);
 
                        /* Update some things -- similar to GF_KILL_WALL */
-                       p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MONSTERS | PU_MON_LITE);
+                       p_ptr->update |= (PU_FLOW);
                }
 
                /* Sound */
index 2336b37..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);
        }
@@ -1351,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);
                        }
@@ -1579,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
                {
@@ -1603,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);
                }
@@ -1826,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);
 
@@ -1862,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);
        }
@@ -2303,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 */
index a0d661c..a74e48e 100644 (file)
@@ -5425,8 +5425,6 @@ void do_cmd_pet_dismiss(void)
 #else
                msg_print("'U'nnamed means all your pets except named pets and your mount.");
 #endif
-
-       p_ptr->update |= (PU_MON_LITE);
 }
 
 static bool player_can_ride_aux(cave_type *c_ptr, bool now_riding)
@@ -5581,10 +5579,7 @@ msg_format("%s
        p_ptr->update |= (PU_BONUS);
 
        /* Update stuff */
-       p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE);
-
-       /* Update the monsters */
-       p_ptr->update |= (PU_DISTANCE);
+       p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE | PU_MONSTERS);
 
        /* Window stuff */
        p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
index 92e2514..fdc5c91 100644 (file)
@@ -638,7 +638,7 @@ static bool cast_hissatsu_spell(int spell)
                cave_alter_feat(y, x, FF_HURT_ROCK);
 
                /* Update some things */
-               p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MONSTERS | PU_MON_LITE);
+               p_ptr->update |= (PU_FLOW);
 
                break;
        }
index 5fc71c2..e2c7ebb 100644 (file)
@@ -3019,7 +3019,7 @@ msg_format("%^s%s", m_name, monmessage);
                                }
 
                                /* Handle viewable doors */
-                               if (player_has_los_bold(ny, nx)) do_view = TRUE;
+                               do_view = TRUE;
                        }
                }
 
@@ -3260,7 +3260,7 @@ msg_format("%^s%s", m_name, monmessage);
                                cave_alter_feat(ny, nx, FF_HURT_DISI);
 
                                /* Note changes to viewable region */
-                               if (player_has_los_bold(ny, nx)) do_view = TRUE;
+                               do_view = TRUE;
                        }
                        else if (have_flag(f_ptr->flags, FF_TREE))
                        {
@@ -3493,7 +3493,7 @@ msg_format("%^s%s", m_name, monmessage);
        if (do_view)
        {
                /* Update some things */
-               p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MONSTERS | PU_MON_LITE);
+               p_ptr->update |= (PU_FLOW);
 
                /* Window stuff */
                p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
index b172166..c4cdfed 100644 (file)
@@ -157,8 +157,7 @@ static bool do_cmd_archer(void)
                        /* Destroy the wall */
                        cave_alter_feat(y, x, FF_HURT_ROCK);
 
-                       p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MONSTERS | PU_MON_LITE);
-                       p_ptr->window |= (PW_OVERHEAD);
+                       p_ptr->update |= (PU_FLOW);
                }
        }
        /**********Create arrows*********/
index e55b150..9486dfa 100644 (file)
@@ -675,9 +675,6 @@ static bool project_f(int who, int r, int y, int x, int dam, int typ)
 
                        /* Observe */
                        if (c_ptr->info & (CAVE_MARK)) obvious = TRUE;
-
-                       /* Update some things */
-                       p_ptr->update |= (PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
                }
        }
 
@@ -808,13 +805,6 @@ static bool project_f(int who, int r, int y, int x, int dam, int typ)
                                        obvious = TRUE;
                                }
 
-                               /* Visibility change */
-                               if (have_flag(f_ptr->flags, FF_DOOR))
-                               {
-                                       /* Update some things */
-                                       p_ptr->update |= (PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
-                               }
-
                                /* Destroy the feature */
                                cave_alter_feat(y, x, FF_TUNNEL);
                        }
@@ -887,7 +877,7 @@ static bool project_f(int who, int r, int y, int x, int dam, int typ)
                                cave_alter_feat(y, x, FF_HURT_ROCK);
 
                                /* Update some things */
-                               p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MONSTERS | PU_MON_LITE);
+                               p_ptr->update |= (PU_FLOW);
                        }
 
                        break;
@@ -908,9 +898,6 @@ static bool project_f(int who, int r, int y, int x, int dam, int typ)
                        /* Observe */
                        if (c_ptr->info & (CAVE_MARK)) obvious = TRUE;
 
-                       /* Update some things */
-                       p_ptr->update |= (PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
-
                        break;
                }
 
@@ -938,8 +925,6 @@ static bool project_f(int who, int r, int y, int x, int dam, int typ)
                        /* Observe */
                        if (c_ptr->info & (CAVE_MARK)) obvious = TRUE;
 
-                       /* Update some things */
-                       p_ptr->update |= (PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
 
                        break;
                }
@@ -973,9 +958,6 @@ static bool project_f(int who, int r, int y, int x, int dam, int typ)
                        /* Place a wall */
                        cave_set_feat(y, x, FEAT_WALL);
 
-                       /* Update some things */
-                       p_ptr->update |= (PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
-
                        break;
                }
 
@@ -1159,7 +1141,7 @@ static bool project_f(int who, int r, int y, int x, int dam, int typ)
                                cave_alter_feat(y, x, FF_HURT_DISI);
 
                                /* Update some things -- similar to GF_KILL_WALL */
-                               p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MONSTERS | PU_MON_LITE);
+                               p_ptr->update |= (PU_FLOW);
                        }
                        break;
                }
index 15f86bf..cd7da5a 100644 (file)
@@ -5483,10 +5483,7 @@ bool destroy_area(int y1, int x1, int r, bool in_generate)
                p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE);
 
                /* Update stuff */
-               p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE);
-
-               /* Update the monsters */
-               p_ptr->update |= (PU_MONSTERS);
+               p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE | PU_MONSTERS);
 
                /* Redraw map */
                p_ptr->redraw |= (PR_MAP);
@@ -5984,10 +5981,7 @@ msg_format("%^s
        p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE);
 
        /* Update stuff */
-       p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE);
-
-       /* Update the monsters */
-       p_ptr->update |= (PU_DISTANCE);
+       p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE | PU_MONSTERS);
 
        /* Update the health bar */
        p_ptr->redraw |= (PR_HEALTH | PR_UHEALTH);
@@ -7022,17 +7016,11 @@ bool wall_stone(void)
        bool dummy = (project(0, 1, py, px, 0, GF_STONE_WALL, flg, -1));
 
        /* Update stuff */
-       p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE);
-
-       /* Update the monsters */
-       p_ptr->update |= (PU_MONSTERS);
+       p_ptr->update |= (PU_FLOW);
 
        /* Redraw map */
        p_ptr->redraw |= (PR_MAP);
 
-       /* Window stuff */
-       p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
-
        return dummy;
 }
 
index 20f83a5..47d3109 100644 (file)
@@ -1738,7 +1738,7 @@ static void do_cmd_wiz_create_feature(void)
        lite_spot(y, x);
 
        /* Update some things */
-       p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MONSTERS | PU_MON_LITE);
+       p_ptr->update |= (PU_FLOW);
 
        prev_feat = tmp_feat;
        prev_mimic = tmp_mimic;
index 3514950..f57eff8 100644 (file)
@@ -2878,12 +2878,9 @@ static void calc_torch(void)
        /* Notice changes in the "lite radius" */
        if (p_ptr->old_lite != p_ptr->cur_lite)
        {
-               /* Update the lite */
+               /* Update stuff */
                /* Hack -- PU_MON_LITE for monsters' darkness */
-               p_ptr->update |= (PU_LITE | PU_MON_LITE);
-
-               /* Update the monsters */
-               p_ptr->update |= (PU_MONSTERS);
+               p_ptr->update |= (PU_LITE | PU_MON_LITE | PU_MONSTERS);
 
                /* Remember the old lite */
                p_ptr->old_lite = p_ptr->cur_lite;
index da16ac2..d2625b4 100644 (file)
@@ -607,7 +607,7 @@ msg_print("
                cave_set_feat(y, x, FEAT_MORE);
 
                /* Remember to update everything */
-               p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MONSTERS | PU_MON_LITE);
+               p_ptr->update |= (PU_FLOW);
        }
 
        /*