diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-05-13 14:02:06 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-05-13 14:02:06 +0000 |
commit | 6c4dcd25f5125e1cbb768ba1d61fa1dc0f16d42f (patch) | |
tree | 97817e8bec0207bc8409e38769f7adf56c11c135 /crawl-ref/source/beam.cc | |
parent | dcbe0071af1ecd30b45043f353d786b8af6a929f (diff) | |
download | crawl-ref-6c4dcd25f5125e1cbb768ba1d61fa1dc0f16d42f.tar.gz crawl-ref-6c4dcd25f5125e1cbb768ba1d61fa1dc0f16d42f.zip |
Apply mesilliac's patch in [1962846], slightly tweaked, to make
friendlies react to projectile attacks on other non-attacking monsters.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5019 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/beam.cc')
-rw-r--r-- | crawl-ref/source/beam.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc index e809256ec9..db1074e5a4 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -1566,6 +1566,14 @@ void fire_beam( bolt &pbolt, item_def *item, bool drop_item ) xom_is_stimulated(128); else if (pbolt.foe_helped > 0 && pbolt.fr_helped == 0) xom_is_stimulated(128); + + // allow friendlies to react to projectiles. + const monsters *mon = &menv[pbolt.beam_source]; + if (pbolt.foe_hurt > 0 && !mons_wont_attack(mon) + && you.pet_target == MHITNOT) + { + you.pet_target = pbolt.beam_source; + } } // that's it! |