OSDN Git Service

罠ピットの開門トラップが感知前に解除可能だったバグ修正。
authormogami <mogami@0568b783-4c39-0410-ac80-bf13821ea2a2>
Mon, 2 Sep 2002 12:37:28 +0000 (12:37 +0000)
committermogami <mogami@0568b783-4c39-0410-ac80-bf13821ea2a2>
Mon, 2 Sep 2002 12:37:28 +0000 (12:37 +0000)
src/cave.c
src/object2.c
src/spells1.c
src/spells2.c

index 94df874..2240ced 100644 (file)
@@ -58,7 +58,6 @@ bool is_trap(int feat)
 {
        switch (feat)
        {
-               case FEAT_INVIS:
                case FEAT_TRAP_TRAPDOOR:
                case FEAT_TRAP_PIT:
                case FEAT_TRAP_SPIKED_PIT:
index 170e7e6..3842ead 100644 (file)
@@ -6471,7 +6471,8 @@ bool process_frakir(int xx, int yy)
        else old_damage = old_damage/2;
 
        c_ptr = &cave[yy][xx];
-       if (((is_trap(c_ptr->feat) && !easy_disarm) || (c_ptr->info & CAVE_TRAP)) && !one_in_(13))
+       if (((!easy_disarm && (is_trap(c_ptr->feat) || c_ptr->feat == FEAT_INVIS))
+            || (c_ptr->info & CAVE_TRAP)) && !one_in_(13))
        {
                object_type *o_ptr = choose_warning_item();
 
index dcb065a..56588ea 100644 (file)
@@ -731,7 +731,8 @@ static bool project_f(int who, int r, int y, int x, int dam, int typ)
                        }
 
                        /* Destroy traps */
-                       if ((c_ptr->info & CAVE_TRAP) || is_trap(c_ptr->feat))
+                       if ((c_ptr->info & CAVE_TRAP) || is_trap(c_ptr->feat) ||
+                            c_ptr->feat == FEAT_INVIS)
                        {
                                /* Check line of sight */
                                if (known)
@@ -787,11 +788,12 @@ msg_print("
                {
                        /* Destroy all doors and traps */
                        if ((c_ptr->feat == FEAT_OPEN) ||
-                                (c_ptr->feat == FEAT_BROKEN) ||
-                                (c_ptr->info & CAVE_TRAP) ||
-                               (is_trap(c_ptr->feat)) ||
-                               ((c_ptr->feat >= FEAT_DOOR_HEAD) &&
-                                (c_ptr->feat <= FEAT_DOOR_TAIL)))
+                            (c_ptr->feat == FEAT_BROKEN) ||
+                            (c_ptr->info & CAVE_TRAP) ||
+                            is_trap(c_ptr->feat) ||
+                            (c_ptr->feat == FEAT_INVIS) ||
+                            ((c_ptr->feat >= FEAT_DOOR_HEAD) &&
+                             (c_ptr->feat <= FEAT_DOOR_TAIL)))
                        {
                                /* Check line of sight */
                                if (known)
index 1951543..da79c16 100644 (file)
@@ -3530,12 +3530,13 @@ bool detect_traps(int range, bool known)
                                pick_trap(y, x);
                        }
 
+                        /* Detect invisible open traps */
+                        if (c_ptr->feat == FEAT_INVIS)
+                                c_ptr->feat = FEAT_TRAP_OPEN;
+
                        /* Detect traps */
                        if (is_trap(c_ptr->feat))
                        {
-                                if (c_ptr->feat == FEAT_INVIS)
-                                        c_ptr->feat = FEAT_TRAP_OPEN;
-
                                /* Hack -- Memorize */
                                c_ptr->info |= (CAVE_MARK);