summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/monstuff.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-07-24 09:02:38 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-07-24 09:02:38 +0000
commit5e887cdbaca92e5706d363c22fafbe10c0de669b (patch)
treeed48514caa5780a8ee5dcc2dcfd3ccfbaa4eeaba /crawl-ref/source/monstuff.cc
parent0ff119e29e26761c5c24b70dacbee90de6735323 (diff)
downloadcrawl-ref-5e887cdbaca92e5706d363c22fafbe10c0de669b.tar.gz
crawl-ref-5e887cdbaca92e5706d363c22fafbe10c0de669b.zip
[1749272] Fixed view update issues:
- Redraw view when entering a new level before allowing monsters on the level to act. - Monsters are redrawn on the view as and when they move, instead of postponing the view update to the end of turn. - Beam animations and monster redraws force a view update if the view is stale (such as when a beam is shown during travel and travel_delay = -1). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1925 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/monstuff.cc')
-rw-r--r--crawl-ref/source/monstuff.cc17
1 files changed, 14 insertions, 3 deletions
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index ff41163450..539bfe8198 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -842,9 +842,17 @@ void monster_die(monsters *monster, killer_type killer, int i, bool silent)
}
}
+ const coord_def mwhere = monster->pos();
if (!hard_reset)
monster_drop_ething(monster, YOU_KILL(killer) || pet_kill);
monster_cleanup(monster);
+
+ // Force redraw for monsters that die.
+ if (see_grid(mwhere))
+ {
+ view_update_at(mwhere);
+ update_screen();
+ }
} // end monster_die
void monster_cleanup(monsters *monster)
@@ -3556,7 +3564,7 @@ static void handle_monster_move(int i, monsters *monster)
monster->check_speed();
- while (monster->speed_increment >= 80)
+ while (monster->has_action_energy())
{ // The continues & breaks are WRT this.
if (!monster->alive())
break;
@@ -3580,7 +3588,7 @@ static void handle_monster_move(int i, monsters *monster)
}
}
- if (monster->type == MONS_TIAMAT && one_chance_in(3) )
+ if (monster->type == MONS_TIAMAT && one_chance_in(3))
{
int cols[] = { RED, WHITE, DARKGREY, GREEN, MAGENTA };
int newcol = cols[random2(sizeof(cols) / sizeof(cols[0]))];
@@ -4122,6 +4130,8 @@ static bool monster_swaps_places( monsters *mon, int mx, int my )
mgrd[cx][cy] = m2i;
immobile_monster[m2i] = true;
+ mon->check_redraw(coord_def(cx, cy));
+
mons_trap(mon);
mons_trap(m2);
@@ -4175,6 +4185,8 @@ static void do_move_monster(monsters *monster, int xi, int yi)
items (eg ammunition) identical to those it's carrying. */
mgrd[monster->x][monster->y] = monster_index(monster);
+ monster->check_redraw(monster->pos() - coord_def(xi, yi));
+
// monsters stepping on traps:
mons_trap(monster);
@@ -4576,7 +4588,6 @@ static void monster_move(monsters *monster)
}
}
-
// now, if a monster can't move in its intended direction, try
// either side. If they're both good, move in whichever dir
// gets it closer(farther for fleeing monsters) to its target.