summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/source/show.cc40
-rw-r--r--crawl-ref/source/show.h10
2 files changed, 37 insertions, 13 deletions
diff --git a/crawl-ref/source/show.cc b/crawl-ref/source/show.cc
index d342225d9b..ec18a5aae7 100644
--- a/crawl-ref/source/show.cc
+++ b/crawl-ref/source/show.cc
@@ -23,25 +23,51 @@
#include "viewmap.h"
show_type::show_type()
- : cls(SH_NOTHING), colour(0)
+ : cls(SH_NOTHING),
+ feat(DNGN_UNSEEN),
+ item(SHOW_ITEM_NONE),
+ mons(MONS_NO_MONSTER),
+ colour(0)
{
- // To quiet Valgrind warnings.
- feat = (dungeon_feature_type) -1;
}
show_type::show_type(monster_type montype)
- : cls(SH_MONSTER), mons(montype), colour(0) {}
+ : cls(SH_MONSTER),
+ feat(DNGN_UNSEEN),
+ item(SHOW_ITEM_NONE),
+ mons(montype),
+ colour(0)
+{
+}
show_type::show_type(dungeon_feature_type f)
- : cls(SH_FEATURE), feat(f), colour(0) {}
+ : cls(SH_FEATURE),
+ feat(f),
+ item(SHOW_ITEM_NONE),
+ mons(MONS_NO_MONSTER),
+ colour(0)
+{
+}
static show_item_type _item_to_show_code(const item_def &item);
show_type::show_type(const item_def &it)
- : cls(SH_ITEM), item(_item_to_show_code(it)), colour(0) {}
+ : cls(SH_ITEM),
+ feat(DNGN_UNSEEN),
+ item(_item_to_show_code(it)),
+ mons(MONS_NO_MONSTER),
+ colour(0)
+{
+}
show_type::show_type(show_item_type t)
- : cls(SH_ITEM), item(t), colour(0) {}
+ : cls(SH_ITEM),
+ feat(DNGN_UNSEEN),
+ item(t),
+ mons(MONS_NO_MONSTER),
+ colour(0)
+{
+}
bool show_type::operator < (const show_type &other) const
{
diff --git a/crawl-ref/source/show.h b/crawl-ref/source/show.h
index be71529485..3f2e4cb88a 100644
--- a/crawl-ref/source/show.h
+++ b/crawl-ref/source/show.h
@@ -5,6 +5,7 @@
enum show_item_type
{
+ SHOW_ITEM_NONE,
SHOW_ITEM_ORB,
SHOW_ITEM_WEAPON,
SHOW_ITEM_ARMOUR,
@@ -38,12 +39,9 @@ enum show_class
struct show_type
{
show_class cls;
- union
- {
- dungeon_feature_type feat;
- show_item_type item;
- monster_type mons;
- };
+ dungeon_feature_type feat;
+ show_item_type item;
+ monster_type mons;
unsigned short colour;
show_type();