summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/l_view.cc
diff options
context:
space:
mode:
authorRobert Vollmert <rvollmert@gmx.net>2009-11-17 17:15:00 +0100
committerRobert Vollmert <rvollmert@gmx.net>2009-11-17 17:33:49 +0100
commita387822ef4e74569e5a4df906efdefd739511f4a (patch)
treed5d802f0a58e5e6cde62bbc6e647ebd78df0e234 /crawl-ref/source/l_view.cc
parent272ec579399ed9a9442389ffe48101902fef9e81 (diff)
downloadcrawl-ref-a387822ef4e74569e5a4df906efdefd739511f4a.tar.gz
crawl-ref-a387822ef4e74569e5a4df906efdefd739511f4a.zip
Rewrite view.feature_at.
Now returns the feature name of the appearance of a feature in view.
Diffstat (limited to 'crawl-ref/source/l_view.cc')
-rw-r--r--crawl-ref/source/l_view.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/crawl-ref/source/l_view.cc b/crawl-ref/source/l_view.cc
index bb1b7bdbc0..93132914e3 100644
--- a/crawl-ref/source/l_view.cc
+++ b/crawl-ref/source/l_view.cc
@@ -11,6 +11,7 @@
#include "cluautil.h"
#include "env.h"
#include "player.h"
+#include "terrain.h"
coord_def player2show(const coord_def &s)
{
@@ -22,7 +23,10 @@ LUAFN(view_feature_at)
COORDSHOW(s, 1, 2)
const coord_def p = player2show(s);
if (env.show(p))
- lua_pushnumber(ls, env.grid(s + you.pos()));
+ {
+ dungeon_feature_type f = grid_appearance(s + you.pos());
+ lua_pushstring(ls, dungeon_feature_name(f));
+ }
return (1);
}