From 9c8871bc3e50d51e3898ff5594b9d4f73f15c55b Mon Sep 17 00:00:00 2001 From: zelgadis Date: Tue, 20 Jan 2009 10:41:45 +0000 Subject: Make extra-sure that a monster won't be announced to have come into view, only to immediately move out of view, by introducing the notion of the currently acting monster to crawl_state, and only flushing out the "comes into view" message in mpr() for the currently acting monster. Not sure if it's worth it just for the sake of avoiding doing a "has this monster just now come into view" check in every place that a monster might issue a message, but at least this way we won't miss any places such a check should be placed. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8623 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/monstuff.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'crawl-ref/source/monstuff.cc') diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc index f59f53f4ce..088619dde6 100644 --- a/crawl-ref/source/monstuff.cc +++ b/crawl-ref/source/monstuff.cc @@ -1030,6 +1030,8 @@ int monster_die(monsters *monster, killer_type killer, if (!silent && _monster_avoided_death(monster, killer, killer_index)) return (-1); + crawl_state.inc_mon_acting(monster); + mons_clear_trapping_net(monster); // Update list of monsters beholding player. @@ -1662,6 +1664,7 @@ int monster_die(monsters *monster, killer_type killer, // don't clutter up mitm[] monster->destroy_inventory(); + crawl_state.dec_mon_acting(monster); monster_cleanup(monster); // Force redraw for monsters that die. @@ -1676,6 +1679,8 @@ int monster_die(monsters *monster, killer_type killer, void monster_cleanup(monsters *monster) { + crawl_state.mon_gone(monster); + unsigned int monster_killed = monster_index(monster); monster->reset(); @@ -6739,6 +6744,8 @@ static void _handle_monster_move(int i, monsters *monster) return; } + mon_acting mact(monster); + _monster_add_energy(monster); // Handle clouds on nonmoving monsters. -- cgit v1.2.3-54-g00ecf