From 3f52702c6ffd30ddbce3b6205bb131bffe57dc2d Mon Sep 17 00:00:00 2001 From: Robert Vollmert Date: Thu, 22 Oct 2009 23:46:06 +0200 Subject: Also remove monster::visible. --- crawl-ref/source/actor.cc | 2 +- crawl-ref/source/actor.h | 2 +- crawl-ref/source/mon-util.cc | 7 +------ crawl-ref/source/monster.h | 1 - 4 files changed, 3 insertions(+), 9 deletions(-) (limited to 'crawl-ref/source') diff --git a/crawl-ref/source/actor.cc b/crawl-ref/source/actor.cc index 880fb7a93f..009da3ba7f 100644 --- a/crawl-ref/source/actor.cc +++ b/crawl-ref/source/actor.cc @@ -4,7 +4,7 @@ #include "player.h" #include "state.h" -bool actor::observable() +bool actor::observable() const { return (crawl_state.arena || this == &you || you.can_see(this)); } diff --git a/crawl-ref/source/actor.h b/crawl-ref/source/actor.h index e5cf5e6277..e3dde04ff3 100644 --- a/crawl-ref/source/actor.h +++ b/crawl-ref/source/actor.h @@ -113,7 +113,7 @@ public: // Visibility as required by messaging. In usual play: // Does the player know what's happening to the actor? - virtual bool observable(); + virtual bool observable() const; virtual bool is_icy() const = 0; virtual bool is_fiery() const = 0; diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc index 6ba4f7612b..8729dcbca3 100644 --- a/crawl-ref/source/mon-util.cc +++ b/crawl-ref/source/mon-util.cc @@ -5366,7 +5366,7 @@ bool monsters::pickup_item(item_def &item, int near, bool force) bool monsters::need_message(int &near) const { return (near != -1 ? near - : (near = visible())); + : (near = observable())); } void monsters::swap_weapons(int near) @@ -5934,11 +5934,6 @@ bool monsters::has_damage_type(int dam_type) return (false); } -bool monsters::visible() const -{ - return (mons_near(this) && visible_to(&you)); -} - bool monsters::confused() const { return (mons_is_confused(this)); diff --git a/crawl-ref/source/monster.h b/crawl-ref/source/monster.h index 860cf1ae0c..b4a06b9e2b 100644 --- a/crawl-ref/source/monster.h +++ b/crawl-ref/source/monster.h @@ -278,7 +278,6 @@ public: bool mutate(); void banish(const std::string &who = ""); void expose_to_element(beam_type element, int strength = 0); - bool visible() const; int mons_species() const; -- cgit v1.2.3-54-g00ecf