From a2c9f19f6f64a781722ca602c393731d456cf3b3 Mon Sep 17 00:00:00 2001 From: Matthew Cline Date: Wed, 2 Dec 2009 05:43:30 -0800 Subject: Fix mesmerisation being broken too soon --- crawl-ref/source/behold.cc | 2 +- crawl-ref/source/main.cc | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'crawl-ref') 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. -- cgit v1.2.3-54-g00ecf