From 196d110e84738a7e6b6fc8026c27278cbbf53af5 Mon Sep 17 00:00:00 2001 From: dshaligram Date: Sun, 24 Aug 2008 14:27:16 +0000 Subject: Trunk->0.4 r6859: Fix crash when tracer hits monster with negative AC (Ekaterin). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.4@6860 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/beam.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc index 72d91b921b..6bb3fadd40 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -4564,7 +4564,7 @@ static int _affect_monster(bolt &beam, monsters *mon, item_def *item) hurt_final = hurt; if (beam.is_tracer) - hurt_final -= mon->ac / 2; + hurt_final -= std::max(mon->ac / 2, 0); else hurt_final -= random2(1 + mon->ac); @@ -4618,7 +4618,7 @@ static int _affect_monster(bolt &beam, monsters *mon, item_def *item) } // Check only if actual damage. - if (hurt_final > 0) + if (hurt_final > 0 && hurt > 0) { // Monster could be hurt somewhat, but only apply the // monster's power based on how badly it is affected. @@ -5600,7 +5600,7 @@ static void _explosion_map( bolt &beam, int x, int y, // Check count. if (count > 10*r) return; - + const coord_def loc(beam.target_x + x, beam.target_y + y); // Make sure we haven't run off the map. -- cgit v1.2.3-54-g00ecf