From ca49d65dbd3a24ba1e4a3fb2ba0ca7ebcc685f5d Mon Sep 17 00:00:00 2001 From: Charles Otto Date: Tue, 17 Nov 2009 21:57:04 -0500 Subject: 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. --- crawl-ref/source/directn.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'crawl-ref/source/directn.cc') 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) -- cgit v1.2.3-54-g00ecf