summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/travel.cc
diff options
context:
space:
mode:
authorRobert Vollmert <rvollmert@gmx.net>2009-10-15 22:00:14 +0200
committerRobert Vollmert <rvollmert@gmx.net>2009-10-15 22:18:12 +0200
commit6d503bc944f4d97d3417d815324fc16861305cb2 (patch)
treed603c3a8971e69d3ab052e936fc5da87070ed018 /crawl-ref/source/travel.cc
parent3b3743e4ef9626a9b5bf36e62d90d25f71bdacc4 (diff)
downloadcrawl-ref-6d503bc944f4d97d3417d815324fc16861305cb2.tar.gz
crawl-ref-6d503bc944f4d97d3417d815324fc16861305cb2.zip
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.
Diffstat (limited to 'crawl-ref/source/travel.cc')
-rw-r--r--crawl-ref/source/travel.cc12
1 files changed, 3 insertions, 9 deletions
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