diff options
author | Robert Vollmert <rvollmert@gmx.net> | 2009-10-15 18:00:27 +0200 |
---|---|---|
committer | Robert Vollmert <rvollmert@gmx.net> | 2009-10-15 18:06:07 +0200 |
commit | 85cb24e611061807818fbb6be250f9f770d3433b (patch) | |
tree | 03cd65e7b2441aea77ba49ac70108fcd7c9a13de /crawl-ref/source/acr.cc | |
parent | 42edbf7d41749125122c9b2cfe8d7bcd0357641f (diff) | |
download | crawl-ref-85cb24e611061807818fbb6be250f9f770d3433b.tar.gz crawl-ref-85cb24e611061807818fbb6be250f9f770d3433b.zip |
Rewrite part of the exclusion code.
* Exclusion radius 0 no longer encodes "no exclusion".
* toggle_exclusion split into set_exclusion and del_exclusion: It was
never used as a toggle.
* Exclusion updates for changed cells unified in
void update_exclusion_los(std::vector coord_def changed). Now doesn't
leave invalidly non-uptodate exclusions laying around.
Still need to find out why off-level exclusions aren't updated after
restore.
Diffstat (limited to 'crawl-ref/source/acr.cc')
-rw-r--r-- | crawl-ref/source/acr.cc | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc index bc615905ce..9654654652 100644 --- a/crawl-ref/source/acr.cc +++ b/crawl-ref/source/acr.cc @@ -3245,12 +3245,7 @@ static void _open_door(coord_def move, bool check_confused) excludes.push_back(dc); } - if (!excludes.empty()) - { - mark_all_excludes_non_updated(); - for (unsigned int i = 0; i < excludes.size(); ++i) - update_exclusion_los(excludes[i]); - } + update_exclusion_los(excludes); you.turn_is_over = true; } @@ -3407,12 +3402,9 @@ static void _close_door(coord_def move) if (is_excluded(dc)) excludes.push_back(dc); } - if (!excludes.empty()) - { - mark_all_excludes_non_updated(); - for (unsigned int i = 0; i < excludes.size(); ++i) - update_exclusion_los(excludes[i]); - } + + update_exclusion_los(excludes); + you.turn_is_over = true; } else if (you.confused()) |