From f04f543b623b671c847bf9c04ae357a373c94597 Mon Sep 17 00:00:00 2001 From: zelgadis Date: Fri, 30 Jan 2009 10:47:49 +0000 Subject: Fixed bug #2544413: slashing off a hydra's last head with a branded weapon which wasn't the flaming brand would cause a crash. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8851 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/fight.cc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'crawl-ref/source/fight.cc') diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc index e00f2c89e4..01d0998523 100644 --- a/crawl-ref/source/fight.cc +++ b/crawl-ref/source/fight.cc @@ -1895,6 +1895,9 @@ bool melee_attack::player_monattk_hit_effects(bool mondied) // Returns true if a head was cut off *and* the wound was cauterized, // in which case the cauterization was the ego effect, so don't burn // the hydra some more. + // + // Also returns true if the hydra's last head was cut off, in which + // case nothing more should be done to the last hydra. if (decapitate_hydra(damage_done)) return (!defender->alive()); @@ -3094,6 +3097,8 @@ bool melee_attack::chop_hydra_head( int dam, defender_as_monster()->hit_points, true); defender->hurt(attacker, defender_as_monster()->hit_points); + + return (true); } else { -- cgit v1.2.3-54-g00ecf