From 725cb5b4d5a3ade5c5e7b04a6210cedc839c2bdd Mon Sep 17 00:00:00 2001 From: zelgadis Date: Wed, 19 Sep 2007 01:19:56 +0000 Subject: Added new commands "re-do previous command" (bound to `) and "repeat next command" (bound to 0). Though this is just an interface change, it changes code in the core input processing function (input() in acr.cc), and also messes around with the input buffer, so it could probably do with more testing before merging it into the 0.3 branch. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2137 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/monstuff.cc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'crawl-ref/source/monstuff.cc') diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc index db65a5a960..47ecdc7e8d 100644 --- a/crawl-ref/source/monstuff.cc +++ b/crawl-ref/source/monstuff.cc @@ -58,6 +58,7 @@ #include "spl-util.h" #include "spells2.h" #include "spells4.h" +#include "state.h" #include "stuff.h" #include "terrain.h" #include "traps.h" @@ -464,7 +465,13 @@ void monster_die(monsters *monster, killer_type killer, int i, bool silent) } if (you.prev_targ == monster_killed) + { you.prev_targ = MHITNOT; + crawl_state.cancel_cmd_repeat(); + } + + if (killer == KILL_YOU) + crawl_state.cancel_cmd_repeat(); const bool pet_kill = is_pet_kill(killer, i); @@ -5313,6 +5320,17 @@ bool monster_descriptor(int which_class, unsigned char which_descriptor) bool message_current_target() { + + if (crawl_state.is_replaying_keys()) + { + if (you.prev_targ == MHITNOT || you.prev_targ == MHITYOU) + return false; + + const monsters *montarget = &menv[you.prev_targ]; + return (you.prev_targ != MHITNOT && you.prev_targ != MHITYOU + && mons_near(montarget) && player_monster_visible(montarget)); + } + if (you.prev_targ != MHITNOT && you.prev_targ != MHITYOU) { const monsters *montarget = &menv[you.prev_targ]; -- cgit v1.2.3-54-g00ecf