diff options
author | Adam Borowski <kilobyte@angband.pl> | 2012-07-18 17:41:54 +0200 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2012-07-18 17:52:32 +0200 |
commit | bb48e157ff74d67b79fee32054401bf2c47bbfb9 (patch) | |
tree | f1fe110d07b2a39f2bfa31e61b16218acf46f068 /crawl-ref/source/mon-project.cc | |
parent | 706b0ff974bb37940f02263a771d2856873f91d1 (diff) | |
download | crawl-ref-bb48e157ff74d67b79fee32054401bf2c47bbfb9.tar.gz crawl-ref-bb48e157ff74d67b79fee32054401bf2c47bbfb9.zip |
Fix the logic of boulder beetles stopping when rolling over stuff.
They'll continue iff the victim dies.
They used to fail to stop, resulting in teleporting through people. Their
internal idea of position was out of sync with reality, making them think
they were on the actor they hit, rather than the place before.
Diffstat (limited to 'crawl-ref/source/mon-project.cc')
-rw-r--r-- | crawl-ref/source/mon-project.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/crawl-ref/source/mon-project.cc b/crawl-ref/source/mon-project.cc index fadc618987..96f49afe92 100644 --- a/crawl-ref/source/mon-project.cc +++ b/crawl-ref/source/mon-project.cc @@ -202,7 +202,8 @@ static bool _iood_shielded(monster& mon, actor &victim) static bool _boulder_hit(monster& mon, const coord_def &pos) { - if (actor *victim = actor_at(pos)) + actor *victim = actor_at(pos); + if (victim) { simple_monster_message(&mon, (std::string(" smashes into ") + victim->name(DESC_THE) + "!").c_str()); @@ -215,7 +216,7 @@ static bool _boulder_hit(monster& mon, const coord_def &pos) } noisy(5, pos); - return true; + return victim && victim->alive(); } static bool _iood_hit(monster& mon, const coord_def &pos, bool big_boom = false) @@ -503,7 +504,7 @@ move_again: if (_iood_hit(mon, pos)) { - if (!iood && victim && victim->alive()) + if (!iood) _iood_stop(mon); return true; } |