|
From: <dsh...@us...> - 2007-04-01 22:37:50
|
Revision: 1181
http://svn.sourceforge.net/crawl-ref/?rev=1181&view=rev
Author: dshaligram
Date: 2007-04-01 15:37:48 -0700 (Sun, 01 Apr 2007)
Log Message:
-----------
Fixed (I think) evil poisoned-monster-crash.
Modified Paths:
--------------
trunk/crawl-ref/source/mon-util.cc
trunk/crawl-ref/source/monstuff.cc
Modified: trunk/crawl-ref/source/mon-util.cc
===================================================================
--- trunk/crawl-ref/source/mon-util.cc 2007-04-01 22:13:21 UTC (rev 1180)
+++ trunk/crawl-ref/source/mon-util.cc 2007-04-01 22:37:48 UTC (rev 1181)
@@ -3573,6 +3573,10 @@
{
mon_enchant_list::iterator cur = i++;
apply_enchantment(*cur, spd);
+
+ // If the monster died, the iterator will be invalid!
+ if (!alive())
+ break;
}
}
Modified: trunk/crawl-ref/source/monstuff.cc
===================================================================
--- trunk/crawl-ref/source/monstuff.cc 2007-04-01 22:13:21 UTC (rev 1180)
+++ trunk/crawl-ref/source/monstuff.cc 2007-04-01 22:37:48 UTC (rev 1181)
@@ -3367,7 +3367,8 @@
mons_in_cloud( monster );
}
- handle_enchantment( monster );
+ if (handle_enchantment( monster ))
+ return;
}
// memory is decremented here for a reason -- we only want it
@@ -3395,7 +3396,7 @@
while (monster->speed_increment >= 80)
{ // The continues & breaks are WRT this.
- if (monster->type != -1 && monster->hit_points < 1)
+ if (!monster->alive())
break;
monster->speed_increment -= 10;
@@ -3425,7 +3426,7 @@
}
if (handle_enchantment(monster))
- continue;
+ break;
monster_regenerate(monster);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|