From 03588849963bb625e961f4f256ed5f4fa0ed6cb3 Mon Sep 17 00:00:00 2001 From: Haran Pilpel Date: Fri, 15 Jan 2010 11:08:31 +0200 Subject: Merge Firing and Aim lines, per dcss:messagespam. --- crawl-ref/source/mon-stuff.cc | 32 ++++++++------------------------ 1 file changed, 8 insertions(+), 24 deletions(-) (limited to 'crawl-ref/source/mon-stuff.cc') diff --git a/crawl-ref/source/mon-stuff.cc b/crawl-ref/source/mon-stuff.cc index 21a7f8dde9..2ade004e24 100644 --- a/crawl-ref/source/mon-stuff.cc +++ b/crawl-ref/source/mon-stuff.cc @@ -3522,32 +3522,16 @@ bool monster_descriptor(int which_class, mon_desc_type which_descriptor) return (false); } -bool message_current_target() +monsters *get_current_target() { - if (crawl_state.is_replaying_keys()) - { - if (you.prev_targ == MHITNOT || you.prev_targ == MHITYOU) - return (false); - - return (you.can_see(&menv[you.prev_targ])); - } - - if (you.prev_targ != MHITNOT && you.prev_targ != MHITYOU) - { - const monsters *montarget = &menv[you.prev_targ]; - - if (you.can_see(montarget)) - { - mprf(MSGCH_PROMPT, "Current target: %s " - "(use p or f to fire at it again.)", - montarget->name(DESC_PLAIN).c_str()); - return (true); - } + if (invalid_monster_index(you.prev_targ)) + return NULL; - mpr("You have no current target."); - } - - return (false); + monsters* mon = &menv[you.prev_targ]; + if (mon->alive() && you.can_see(mon)) + return mon; + else + return NULL; } void seen_monster(monsters *monster) -- cgit v1.2.3-54-g00ecf