From 6d503bc944f4d97d3417d815324fc16861305cb2 Mon Sep 17 00:00:00 2001 From: Robert Vollmert Date: Thu, 15 Oct 2009 22:00:14 +0200 Subject: Update all exclusions' LOS from travel_init_new_level(). This fixes a bug related to BR 2849608: If you created an exclusion on a level, left that level, saved and restored off-level, and returned to the level, the exclusion filled the complete LOS radius. I'm not sure why it was even restricted to LOS radius, though, and didn't fill an entire ENV_SHOW_OFFSET-size square. --- crawl-ref/source/travel.cc | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'crawl-ref/source/travel.cc') diff --git a/crawl-ref/source/travel.cc b/crawl-ref/source/travel.cc index ca7f5bd946..339e5fb298 100644 --- a/crawl-ref/source/travel.cc +++ b/crawl-ref/source/travel.cc @@ -353,10 +353,10 @@ void _mark_excludes_non_updated(const coord_def &p) (curr_excludes[i].pos - p).abs() <= curr_excludes[i].radius_sq(); } -void _update_exclusion_los() +void _update_exclusion_los(bool all=false) { for (unsigned int i = 0; i < curr_excludes.size(); i++) - if (!curr_excludes[i].uptodate) + if (all || !curr_excludes[i].uptodate) curr_excludes[i].set_exclude_show(); } @@ -3387,13 +3387,7 @@ std::string stair_info::describe() const void LevelInfo::set_level_excludes() { curr_excludes = excludes; -/* - for (unsigned int i = 0; i < curr_excludes.size(); i++) - { - curr_excludes[i] = travel_exclude(curr_excludes[i].pos, - curr_excludes[i].radius); - } -*/ + _update_exclusion_los(true); } bool LevelInfo::empty() const -- cgit v1.2.3-54-g00ecf