summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
diff options
context:
space:
mode:
authorMatthew Cline <zelgadis@sourceforge.net>2009-12-02 05:43:30 -0800
committerMatthew Cline <zelgadis@sourceforge.net>2009-12-02 05:44:17 -0800
commita2c9f19f6f64a781722ca602c393731d456cf3b3 (patch)
treef53b33daecd00017e3355fde0cc564c21aa282f4 /crawl-ref/source
parent9a0d6db186259aae900f30afb26322640487e97d (diff)
downloadcrawl-ref-a2c9f19f6f64a781722ca602c393731d456cf3b3.tar.gz
crawl-ref-a2c9f19f6f64a781722ca602c393731d456cf3b3.zip
Fix mesmerisation being broken too soon
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/behold.cc2
-rw-r--r--crawl-ref/source/main.cc6
2 files changed, 7 insertions, 1 deletions
diff --git a/crawl-ref/source/behold.cc b/crawl-ref/source/behold.cc
index e38b80607c..d76997a7d3 100644
--- a/crawl-ref/source/behold.cc
+++ b/crawl-ref/source/behold.cc
@@ -132,7 +132,7 @@ void player::update_beholder(const monsters *mon)
if (_possible_beholder(mon))
return;
for (unsigned int i = 0; i < beholders.size(); i++)
- if (beholders[i] = mon->mindex())
+ if (beholders[i] == mon->mindex())
{
beholders.erase(beholders.begin() + i);
_removed_beholder();
diff --git a/crawl-ref/source/main.cc b/crawl-ref/source/main.cc
index 09dc7b5f41..805cd2b9a3 100644
--- a/crawl-ref/source/main.cc
+++ b/crawl-ref/source/main.cc
@@ -3776,6 +3776,12 @@ static bool _initialise(void)
newc ? LOAD_START_GAME : LOAD_RESTART_GAME,
NUM_LEVEL_AREA_TYPES, -1, you.where_are_you);
+ // Make sure monsters have a valid LOS before the first turn starts.
+ // This prevents mesmerization from being broken when a game is
+ // restored.
+ for (monster_iterator mi; mi; ++mi)
+ mi->update_los();
+
if (newc && you.char_direction == GDT_GAME_START)
{
// Randomise colours properly for the Abyss.