diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-09-26 18:51:42 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-09-26 18:51:42 +0000 |
commit | 3e311887170766337720976ec335043a5251828d (patch) | |
tree | abe1dd78affde44dbb678385f3448a144b929c8a /crawl-ref | |
parent | 70df4be59a6a94c0e819c1056ddbc5f824305619 (diff) | |
download | crawl-ref-3e311887170766337720976ec335043a5251828d.tar.gz crawl-ref-3e311887170766337720976ec335043a5251828d.zip |
And scan the level properly for Yred servants, using the same method as
in bless_follower().
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7018 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r-- | crawl-ref/source/religion.cc | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index 472a1969cf..4ce9c80e79 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -4564,8 +4564,21 @@ static bool _yred_slaves_abandon_you() for (; how_many > 0; --how_many) { - monsters *slave = choose_random_monster_on_level(0, is_yred_slave, true, - true); + // Choose a random slave in LOS. + monsters *slave = choose_random_nearby_monster(0, is_yred_slave); + + if (!slave) + { + // Try again, without the LOS restriction. + slave = choose_random_nearby_monster(0, is_yred_slave, false); + } + + if (!slave) + { + // Try *again*, on the entire level. + slave = choose_random_monster_on_level(0, is_yred_slave, false); + } + if (slave) { slave->attitude = ATT_HOSTILE; |