Skip to content

Commit

Permalink
Limit cloud spells to caster's LOS.
Browse files Browse the repository at this point in the history
  • Loading branch information
kilobyte committed Dec 15, 2013
1 parent 3381686 commit 8ebc43e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion crawl-ref/source/spl-util.cc
Expand Up @@ -710,7 +710,7 @@ void apply_area_cloud(cloud_func func, const coord_def& where,
if (number <= 0)
return;

targetter_cloud place(0, 0, number, number);
targetter_cloud place(agent, GDM, number, number);
if (!place.set_aim(where))
return;
unsigned int dist = 0;
Expand Down
3 changes: 3 additions & 0 deletions crawl-ref/source/target.cc
Expand Up @@ -571,6 +571,9 @@ bool targetter_cloud::set_aim(coord_def a)
for (adjacent_iterator ai(c); ai; ++ai)
if (_cloudable(*ai) && !seen.count(*ai))
{
if (agent && !cell_see_cell(*ai, agent->pos(), LOS_NO_TRANS))
continue;

unsigned int d2 = d1 + ((*ai - c).abs() == 1 ? 5 : 7);
if (d2 >= queue.size())
queue.resize(d2 + 1);
Expand Down

0 comments on commit 8ebc43e

Please sign in to comment.