From 645e79be66446b7fc6622ee4abbcc84f88dab94b Mon Sep 17 00:00:00 2001 From: Enne Walker Date: Sun, 29 Nov 2009 14:02:32 -0500 Subject: Add missing NON_ITEM check for tiles. --- crawl-ref/source/show.cc | 11 +++++++---- crawl-ref/source/tilepick.cc | 4 ++++ 2 files changed, 11 insertions(+), 4 deletions(-) (limited to 'crawl-ref') diff --git a/crawl-ref/source/show.cc b/crawl-ref/source/show.cc index 628e41baed..784eac2994 100644 --- a/crawl-ref/source/show.cc +++ b/crawl-ref/source/show.cc @@ -250,10 +250,13 @@ void show_def::_update_item_at(const coord_def &gp, const coord_def &ep) #ifdef USE_TILE int idx = igrd(gp); - if (feat_is_stair(feat)) - tile_place_item_marker(ep.x, ep.y, idx); - else - tile_place_item(ep.x, ep.y, idx); + if (idx != NON_ITEM) + { + if (feat_is_stair(feat)) + tile_place_item_marker(ep.x, ep.y, idx); + else + tile_place_item(ep.x, ep.y, idx); + } #endif } diff --git a/crawl-ref/source/tilepick.cc b/crawl-ref/source/tilepick.cc index d919805693..0d40354652 100644 --- a/crawl-ref/source/tilepick.cc +++ b/crawl-ref/source/tilepick.cc @@ -4556,6 +4556,8 @@ void tile_floor_halo(dungeon_feature_type target, int tile) // Called from item() in view.cc void tile_place_item(int x, int y, int idx) { + ASSERT(idx != NON_ITEM); + int t = tileidx_item(mitm[idx]); if (mitm[idx].link != NON_ITEM) t |= TILE_FLAG_S_UNDER; @@ -4569,6 +4571,8 @@ void tile_place_item(int x, int y, int idx) // Called from item() in view.cc void tile_place_item_marker(int x, int y, int idx) { + ASSERT(idx != NON_ITEM); + env.tile_fg[x][y] |= TILE_FLAG_S_UNDER; if (item_needs_autopickup(mitm[idx])) -- cgit v1.2.3-54-g00ecf