From d4189cb0308511fc5d7e12790993f6844974e0c7 Mon Sep 17 00:00:00 2001 From: Robert Vollmert Date: Fri, 13 Nov 2009 14:54:20 +0100 Subject: Hack player LOS routines for arena. Player now sees everything in the arena. --- crawl-ref/source/actor-los.cc | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'crawl-ref/source/actor-los.cc') diff --git a/crawl-ref/source/actor-los.cc b/crawl-ref/source/actor-los.cc index 06eb063a13..bc7f1c4868 100644 --- a/crawl-ref/source/actor-los.cc +++ b/crawl-ref/source/actor-los.cc @@ -4,10 +4,12 @@ #include "player.h" #include "monster.h" #include "state.h" +#include "viewgeom.h" bool actor::observable() const { - return (crawl_state.arena || this == &you || you.can_see(this)); + return (crawl_state.arena && this != &you + || this == &you || you.can_see(this)); } bool actor::see_cell(const coord_def &p) const @@ -52,3 +54,20 @@ void player::update_los() actor::update_los(); } +// Player LOS overrides for arena. + +bool player::see_cell(const coord_def &c) const +{ + if (crawl_state.arena) + return (crawl_view.in_grid_los(c)); + else + return (actor::see_cell(c)); +} + +bool player::can_see(const actor* a) const +{ + if (crawl_state.arena) + return (see_cell(a->pos())); + else + return (actor::can_see(a)); +} -- cgit v1.2.3-54-g00ecf