dominus icon

Untitled

dominus | PRO | 02/22/22 07:25:20 PM UTC | 0 ⭐ | 14512 👁️ | Never ⏰ | []
Diff |

800 B

|

None

|

0 👍

/

0 👎

iff --git a/combat.cc b/combat.cc
index 55c5fff2..89889696 100644
--- a/combat.cc
+++ b/combat.cc
@@ -821,6 +821,15 @@ void Combat_schedule::start_strike(
 ) {
    Game_object *opponent = npc->get_target();
    bool check_lof = !no_blocking;
+
+   // don't attack but open unlocked doors and containers
+   const Shape_info &op_info = opponent->get_info();
+   const Shape_info::Shape_class op_cls = op_info.get_shape_class();
+   if ((op_info.is_door() && opponent->get_framenum() % 4 < 2) || // unlocked door
+           (op_cls == Shape_info::container && !op_info.is_container_locked())) { // unlocked container
+       opponent->activate();
+       return;}
+
    // Get difference in lift.
    const Weapon_info *winf = weapon_shape >= 0 ?
                        ShapeID::get_info(weapon_shape).get_weapon_info() : nullptr;

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎