summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/directn.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-06-01 15:07:05 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-06-01 15:07:05 +0000
commit11a4b4ecd53ec83ab4c92c4896566aeebe06ccc1 (patch)
tree46471b69282557785dc0490998c5bdf7c3c31030 /crawl-ref/source/directn.cc
parentdf2252332c751342de283f3cc32ff5c34d3b8a53 (diff)
downloadcrawl-ref-11a4b4ecd53ec83ab4c92c4896566aeebe06ccc1.tar.gz
crawl-ref-11a4b4ecd53ec83ab4c92c4896566aeebe06ccc1.zip
* Fix bad item (and crash) resulting from the tile inventory not being
uptodate directly after butchery or during multipickup. * More tutorial tweaks, mostly calling screen updates before displaying certain messages. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.5@9873 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/directn.cc')
-rw-r--r--crawl-ref/source/directn.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/crawl-ref/source/directn.cc b/crawl-ref/source/directn.cc
index 165aae3fec..e24ddacbb8 100644
--- a/crawl-ref/source/directn.cc
+++ b/crawl-ref/source/directn.cc
@@ -1733,8 +1733,9 @@ void direction(dist& moves, targeting_type restricts,
std::string get_terse_square_desc(const coord_def &gc)
{
- std::string desc;
+ std::string desc = "";
const char *unseen_desc = "[unseen terrain]";
+
if (gc == you.pos())
desc = you.your_name;
else if (!map_bounds(gc))
@@ -1763,7 +1764,10 @@ std::string get_terse_square_desc(const coord_def &gc)
desc = mons.full_name(DESC_PLAIN, true);
}
else if (igrd(gc) != NON_ITEM)
- desc = mitm[igrd(gc)].name(DESC_PLAIN);
+ {
+ if (is_valid_item(mitm[igrd(gc)]))
+ desc = mitm[igrd(gc)].name(DESC_PLAIN);
+ }
else
desc = feature_description(gc, false, DESC_PLAIN, false);
@@ -1812,7 +1816,8 @@ void get_square_desc(const coord_def &c, describe_info &inf,
{
// Second priority: objects.
// If examine_mons is true, use terse descriptions.
- get_item_desc(mitm[oid], inf, examine_mons);
+ if (is_valid_item(mitm[oid]))
+ get_item_desc(mitm[oid], inf, examine_mons);
}
else
{