diff options
author | Charles Otto <ottochar@gmail.com> | 2009-11-20 18:52:03 -0500 |
---|---|---|
committer | Charles Otto <ottochar@gmail.com> | 2009-11-20 18:56:33 -0500 |
commit | fb4a4eb1906d6dd242464137566003742483f9b3 (patch) | |
tree | 01839f0fed1758cc735086e888aad6869f1ccfc8 | |
parent | 9adbeda686cbb09fea844d8638d13d64c49876ac (diff) | |
download | crawl-ref-fb4a4eb1906d6dd242464137566003742483f9b3.tar.gz crawl-ref-fb4a4eb1906d6dd242464137566003742483f9b3.zip |
Fix bugs 2900276 and 2901145, monster beams hitting their thrower
Switch to the YOU_KILL and MON_KILL macros for determining whether a
beam was fired by a monster or the player (used to decide whether a
beam can hit a monster or the player at its point of origin). This
fixes manticores not using their ability, and also stops electric eels
(and electric eel pallet swaps) from shooting themselves.
-rw-r--r-- | crawl-ref/source/beam.cc | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc index b1027781fe..7ae4688b32 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -2006,8 +2006,16 @@ void bolt::affect_cell(bool avoid_self) const coord_def old_pos = pos(); const bool was_solid = feat_is_solid(grd(pos())); - bool avoid_monster = (avoid_self && thrower == KILL_MON_MISSILE); - bool avoid_player = (avoid_self && thrower != KILL_MON_MISSILE); + bool avoid_monster = false; + bool avoid_player = false; + + if (avoid_self) + { + if (YOU_KILL(thrower)) + avoid_player = true; + else if (MON_KILL(thrower)) + avoid_monster = true; + } if (was_solid) { |