From ef78118cbd7e21e5d33bfcab515ada5f6dd0d538 Mon Sep 17 00:00:00 2001 From: Vsevolod Kozlov Date: Wed, 25 Nov 2009 20:31:41 +0300 Subject: Use actor::can_see in ball lightning's special ability. --- crawl-ref/source/mon-abil.cc | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'crawl-ref/source/mon-abil.cc') diff --git a/crawl-ref/source/mon-abil.cc b/crawl-ref/source/mon-abil.cc index 01127e3b18..23c873e10f 100644 --- a/crawl-ref/source/mon-abil.cc +++ b/crawl-ref/source/mon-abil.cc @@ -840,15 +840,7 @@ bool mon_special_ability(monsters *monster, bolt & beem) if (mons_atts_aligned(monster->attitude, targ->attitude)) continue; - // Faking LOS by checking the neighbouring square. - coord_def diff = targ->pos() - monster->pos(); - coord_def sg(sgn(diff.x), sgn(diff.y)); - coord_def t = monster->pos() + sg; - - if (!in_bounds(t)) - continue; - - if (!feat_is_solid(grd(t))) + if (monster->can_see(*targ) && !feat_is_solid(grd(targ->pos()))) { monster->hit_points = -1; used = true; -- cgit v1.2.3-54-g00ecf