summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-04-27 07:01:38 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-04-27 07:01:38 +0000
commitf3ece5fe657885c0488a536404ba9164db4aeedf (patch)
tree7a3a241efc6bd90b54fb6ad5de0c77784fa20649 /crawl-ref/source
parentdd695c352f27764a0c4f1efee5ee1676678162c2 (diff)
downloadcrawl-ref-f3ece5fe657885c0488a536404ba9164db4aeedf.tar.gz
crawl-ref-f3ece5fe657885c0488a536404ba9164db4aeedf.zip
Fix 1708496, crash due to bug in ms_low_hitpoint_cast().
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1375 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/mon-util.cc9
-rw-r--r--crawl-ref/source/monstuff.cc2
2 files changed, 6 insertions, 5 deletions
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc
index aca5b3bf90..b92ead92b9 100644
--- a/crawl-ref/source/mon-util.cc
+++ b/crawl-ref/source/mon-util.cc
@@ -1892,6 +1892,9 @@ bool ms_low_hitpoint_cast( const monsters *mon, spell_type monspell )
ret = true;
break;
+ case SPELL_NO_SPELL:
+ ret = false;
+
default:
if (!targ_adj && (get_spell_flags(monspell) & SPTYP_SUMMONING))
ret = true;
@@ -1904,9 +1907,8 @@ bool ms_low_hitpoint_cast( const monsters *mon, spell_type monspell )
// Checks to see if a particular spell is worth casting in the first place.
bool ms_waste_of_time( const monsters *mon, spell_type monspell )
{
- bool ret = false;
+ bool ret = false;
int intel, est_magic_resist, power, diff;
- struct monsters *targ;
// Eventually, we'll probably want to be able to have monsters
// learn which of their elemental bolts were resisted and have those
@@ -1986,8 +1988,7 @@ bool ms_waste_of_time( const monsters *mon, spell_type monspell )
est_magic_resist = player_res_magic();
else
{
- targ = &menv[ mon->foe ];
- est_magic_resist = mons_resist_magic( targ );
+ est_magic_resist = mons_resist_magic(&menv[mon->foe]);
}
// now randomize (normal intels less accurate than high):
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index c4ea1066d6..fcbe7142bb 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -3035,7 +3035,7 @@ static bool handle_spell( monsters *monster, bolt & beem )
finalAnswer = true;
}
else if (hspell_pass[2] == SPELL_LESSER_HEALING
- && monster->hit_points < monster->max_hit_points)
+ && monster->hit_points < monster->max_hit_points)
{
// The player's out of sight!
// Quick, let's take a turn to heal ourselves. -- bwr