diff options
author | Robert Vollmert <rvollmert@gmx.net> | 2009-12-17 16:43:39 +0100 |
---|---|---|
committer | Robert Vollmert <rvollmert@gmx.net> | 2009-12-17 16:43:39 +0100 |
commit | e673127cb481843178c9d047413baf88844e438b (patch) | |
tree | 7188cc5d2429bc7e610d126ca705f013c1a610eb /crawl-ref/source/beam.cc | |
parent | bbe853ff8b4b1fdd70055dae83148b717413c127 (diff) | |
download | crawl-ref-e673127cb481843178c9d047413baf88844e438b.tar.gz crawl-ref-e673127cb481843178c9d047413baf88844e438b.zip |
Allow beams to bounce on the map border.
Diffstat (limited to 'crawl-ref/source/beam.cc')
-rw-r--r-- | crawl-ref/source/beam.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc index 64857c6078..affd03ce5a 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -1963,7 +1963,7 @@ bool bolt::hit_wall() // Press trigger/switch/button in wall if hit by something solid // or solid-ish. - if (!is_explosion && !is_tracer && !monster_at(pos()) + if (in_bounds(pos()) && !is_explosion && !is_tracer && !monster_at(pos()) && (flavour == BEAM_MISSILE || flavour == BEAM_MMISSILE)) { dgn_event event(DET_WALL_HIT, pos());; @@ -1972,7 +1972,7 @@ bool bolt::hit_wall() dungeon_events.fire_vetoable_position_event(event, target); } - if (affects_wall(feat)) + if (in_bounds(pos()) && affects_wall(feat)) affect_wall(); else if (is_bouncy(feat) && !in_explosion_phase) bounce(); @@ -2186,7 +2186,7 @@ void bolt::do_fire() oldValue = set_buffering(false); #endif - while (in_bounds(pos())) + while (map_bounds(pos())) { path_taken.push_back(pos()); @@ -3668,7 +3668,7 @@ void bolt::reflect() // If it bounced off a wall before being reflected then head back towards // the wall. - if (bounces > 0 && in_bounds(bounce_pos)) + if (bounces > 0 && map_bounds(bounce_pos)) target = bounce_pos; else target = source; |