summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-project.cc
diff options
context:
space:
mode:
authorPete Hurst <pete@streamuniverse.tv>2013-04-11 02:32:08 +0100
committerPete Hurst <pete@streamuniverse.tv>2013-04-11 02:32:45 +0100
commit463d1a4ce053929633f9c8a33c4dcd67802f8463 (patch)
tree3bd867614ade6919a62ac240d396460257b3739c /crawl-ref/source/mon-project.cc
parent0333ab8a14891c4819bf295e0b79c7cdeb73a952 (diff)
downloadcrawl-ref-463d1a4ce053929633f9c8a33c4dcd67802f8463.tar.gz
crawl-ref-463d1a4ce053929633f9c8a33c4dcd67802f8463.zip
Fix and clarify several cases of buggy boulder behaviour
Including #6900 - boulders reverting position after dispersal. Then there were several cases where code assumed mons_is_projectile checked rolling boulder beetles, but in fact it didn't. I added a monster::is_projectile() check which looks at both mons_is_projectile and mons_is_boulder, and called this from the relevant places. Several times mons_is_projectile is actually just required for an IOOD check. Also added support for catchup_move for boulders; previously they would be sat on the same square (not rolling) when you returned to a level no matter how long you'd been gone. This was omitted from the original implementation.
Diffstat (limited to 'crawl-ref/source/mon-project.cc')
-rw-r--r--crawl-ref/source/mon-project.cc24
1 files changed, 14 insertions, 10 deletions
diff --git a/crawl-ref/source/mon-project.cc b/crawl-ref/source/mon-project.cc
index cf8dcfe0d0..c8dbb0739b 100644
--- a/crawl-ref/source/mon-project.cc
+++ b/crawl-ref/source/mon-project.cc
@@ -605,21 +605,25 @@ static bool _iood_catchup_move(monster& mon)
void iood_catchup(monster* mons, int pturns)
{
monster& mon = *mons;
- ASSERT(mons_is_projectile(mon.type));
+ ASSERT(mon.is_projectile());
const int moves = pturns * mon.speed / BASELINE_DELAY;
- if (moves > 50)
+ // Handle some cases for IOOD only
+ if (mons_is_projectile(mons))
{
- _iood_stop(mon, false);
- return;
- }
+ if (moves > 50)
+ {
+ _iood_stop(mon, false);
+ return;
+ }
- if (mon.props["iood_kc"].get_byte() == KC_YOU)
- {
- // Left player's vision.
- _iood_stop(mon, false);
- return;
+ if (mon.props["iood_kc"].get_byte() == KC_YOU)
+ {
+ // Left player's vision.
+ _iood_stop(mon, false);
+ return;
+ }
}
for (int i = 0; i < moves; ++i)