diff options
author | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-01-07 13:17:41 +0000 |
---|---|---|
committer | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-01-07 13:17:41 +0000 |
commit | 06c0cabf87ec2434fa409c58dcac621153d0f0e7 (patch) | |
tree | 5f3bf33a76c6a956344ac1d8964289faf7065797 /crawl-ref/source/spells2.cc | |
parent | 37f8faa9ae67dd2555ada835021c1bf86c56de61 (diff) | |
download | crawl-ref-06c0cabf87ec2434fa409c58dcac621153d0f0e7.tar.gz crawl-ref-06c0cabf87ec2434fa409c58dcac621153d0f0e7.zip |
Fix [2483184]: submerged and invisible monsters caused bad messaging
for Oz's Refrigeration.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8305 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/spells2.cc')
-rw-r--r-- | crawl-ref/source/spells2.cc | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/crawl-ref/source/spells2.cc b/crawl-ref/source/spells2.cc index 6cfd7643c8..99d473f0d3 100644 --- a/crawl-ref/source/spells2.cc +++ b/crawl-ref/source/spells2.cc @@ -560,10 +560,8 @@ static std::string _describe_monsters(const counted_monster_list &list) // Poisonous light passes right through invisible players // and monsters, and so, they are unaffected by this spell -- // assumes only you can cast this spell (or would want to). -void cast_toxic_radiance(void) +void cast_toxic_radiance() { - struct monsters *monster; - mpr("You radiate a sickly green light!"); you.flash_colour = GREEN; @@ -584,12 +582,11 @@ void cast_toxic_radiance(void) counted_monster_list affected_monsters; // determine which monsters are hit by the radiance: {dlb} - for (int toxy = 0; toxy < MAX_MONSTERS; toxy++) + for (int i = 0; i < MAX_MONSTERS; ++i) { - monster = &menv[toxy]; + monsters* const monster = &menv[i]; - if (monster->type != -1 && mons_near(monster) - && !monster->submerged()) + if (monster->alive() && mons_near(monster) && !monster->submerged()) { // Monsters affected by corona are still invisible in that // radiation passes through them without affecting them. Therefore, @@ -663,7 +660,7 @@ void cast_refrigeration(int pow) for (int i = 0; i < MAX_MONSTERS; i++) { const monsters* const monster = &menv[i]; - if (monster->alive() && mons_near(monster)) + if (monster->alive() && you.can_see(monster)) _record_monster_by_name(affected_monsters, monster); } |