diff options
author | Charles Otto <ottochar@gmail.com> | 2009-11-17 21:57:04 -0500 |
---|---|---|
committer | Charles Otto <ottochar@gmail.com> | 2009-11-17 21:57:04 -0500 |
commit | ca49d65dbd3a24ba1e4a3fb2ba0ca7ebcc685f5d (patch) | |
tree | 1f03d3cd77166e741ea919bb42a2317b31b5bd37 /crawl-ref/source/directn.cc | |
parent | 60739d905fb591cbab819d6b56a5a510584d25ee (diff) | |
download | crawl-ref-ca49d65dbd3a24ba1e4a3fb2ba0ca7ebcc685f5d.tar.gz crawl-ref-ca49d65dbd3a24ba1e4a3fb2ba0ca7ebcc685f5d.zip |
Avoid triggering an assert when firing while standing on a plant
An assert in ray_blocker was being triggered off of a call to
_get_monster_desc when attempting to cast targeted spells while
standing on a plant (as a Fedhas worshiper).
find_ray returns false when the target square is equal to the source,
which triggers the assert in ray_blocker. I added a check for the
monster being on the same square as the player prior to the call to
_blocked_ray in _get_monster_desc, although this may not be the right
way to deal with the issue.
Diffstat (limited to 'crawl-ref/source/directn.cc')
-rw-r--r-- | crawl-ref/source/directn.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/crawl-ref/source/directn.cc b/crawl-ref/source/directn.cc index d30b1815cc..d95935dce4 100644 --- a/crawl-ref/source/directn.cc +++ b/crawl-ref/source/directn.cc @@ -3178,6 +3178,7 @@ static std::string _get_monster_desc(const monsters *mon) dungeon_feature_type blocking_feat; if (!crawl_state.arena_suspended + && mon->pos() != you.pos() && _blocked_ray(mon->pos(), &blocking_feat)) { text += "Your line of fire to " + mon->pronoun(PRONOUN_OBJECTIVE) |