summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-stuff.cc
diff options
context:
space:
mode:
authorHaran Pilpel <haranp@users.sourceforge.net>2010-01-15 11:08:31 +0200
committerHaran Pilpel <haranp@users.sourceforge.net>2010-01-15 11:08:31 +0200
commit03588849963bb625e961f4f256ed5f4fa0ed6cb3 (patch)
treec4372d8a4f2619f87a0a4d8ce1ff68372610641c /crawl-ref/source/mon-stuff.cc
parent317d05294c07c9ccca0f3682c39269cb8f8de938 (diff)
downloadcrawl-ref-03588849963bb625e961f4f256ed5f4fa0ed6cb3.tar.gz
crawl-ref-03588849963bb625e961f4f256ed5f4fa0ed6cb3.zip
Merge Firing and Aim lines, per dcss:messagespam.
Diffstat (limited to 'crawl-ref/source/mon-stuff.cc')
-rw-r--r--crawl-ref/source/mon-stuff.cc32
1 files changed, 8 insertions, 24 deletions
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)