summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/source/dungeon.cc5
-rw-r--r--crawl-ref/source/externs.h2
-rw-r--r--crawl-ref/source/shopping.cc13
-rw-r--r--crawl-ref/source/shopping.h2
-rw-r--r--crawl-ref/source/stash.cc6
-rw-r--r--crawl-ref/source/tags.cc2
6 files changed, 14 insertions, 16 deletions
diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc
index 62a156abca..a3c39b3a6f 100644
--- a/crawl-ref/source/dungeon.cc
+++ b/crawl-ref/source/dungeon.cc
@@ -4301,8 +4301,9 @@ void place_spec_shop( int level_number,
env.shop[i].level = level_number * 2;
- env.shop[i].type = (force_s_type != SHOP_RANDOM) ? force_s_type
- : random2(NUM_SHOPS);
+ env.shop[i].type = static_cast<shop_type>(
+ (force_s_type != SHOP_RANDOM) ? force_s_type
+ : random2(NUM_SHOPS));
if (env.shop[i].type == SHOP_FOOD)
{
diff --git a/crawl-ref/source/externs.h b/crawl-ref/source/externs.h
index 311879ace4..2875f8f832 100644
--- a/crawl-ref/source/externs.h
+++ b/crawl-ref/source/externs.h
@@ -1204,7 +1204,7 @@ struct shop_struct
unsigned char x;
unsigned char y;
unsigned char greed;
- unsigned char type;
+ shop_type type;
unsigned char level;
FixedVector<unsigned char, 3> keeper_name;
diff --git a/crawl-ref/source/shopping.cc b/crawl-ref/source/shopping.cc
index 003a418d1b..d3124f835f 100644
--- a/crawl-ref/source/shopping.cc
+++ b/crawl-ref/source/shopping.cc
@@ -293,22 +293,19 @@ static void in_a_shop( int shopidx )
}
}
-bool shoptype_identifies_stock(int shoptype)
+bool shoptype_identifies_stock(shop_type type)
{
return
- shoptype != SHOP_WEAPON_ANTIQUE &&
- shoptype != SHOP_ARMOUR_ANTIQUE &&
- shoptype != SHOP_GENERAL_ANTIQUE;
+ type != SHOP_WEAPON_ANTIQUE &&
+ type != SHOP_ARMOUR_ANTIQUE &&
+ type != SHOP_GENERAL_ANTIQUE;
}
static void shop_print( const char *shoppy, int sh_lines )
{
gotoxy(1, sh_lines);
-
cprintf("%s", shoppy);
-
- for (int i = strlen(shoppy); i < 80; i++)
- cprintf(" ");
+ clear_to_end_of_line();
}
static void more3()
diff --git a/crawl-ref/source/shopping.h b/crawl-ref/source/shopping.h
index a6918e9c0a..c1f044eefe 100644
--- a/crawl-ref/source/shopping.h
+++ b/crawl-ref/source/shopping.h
@@ -28,6 +28,6 @@ const shop_struct *get_shop(int sx, int sy);
std::string shop_name(int sx, int sy);
-bool shoptype_identifies_stock(int shoptype);
+bool shoptype_identifies_stock(shop_type type);
#endif
diff --git a/crawl-ref/source/stash.cc b/crawl-ref/source/stash.cc
index 0889f3006b..7cd5e28a81 100644
--- a/crawl-ref/source/stash.cc
+++ b/crawl-ref/source/stash.cc
@@ -698,7 +698,7 @@ std::string ShopInfo::shop_item_name(const shop_item &si) const
const unsigned long oldflags = si.item.flags;
- if ( shoptype_identifies_stock(this->shoptype) )
+ if (shoptype_identifies_stock(static_cast<shop_type>(this->shoptype)))
const_cast<shop_item&>(si).item.flags |= ISFLAG_IDENT_MASK;
const std::string itemname = Stash::stash_item_name(si.item);
@@ -717,7 +717,7 @@ std::string ShopInfo::shop_item_desc(const shop_item &si) const
const unsigned long oldflags = si.item.flags;
- if (shoptype_identifies_stock(this->shoptype))
+ if (shoptype_identifies_stock(static_cast<shop_type>(this->shoptype)))
const_cast<shop_item&>(si).item.flags |= ISFLAG_IDENT_MASK;
if (is_dumpable_artefact(si.item, false))
@@ -741,7 +741,7 @@ void ShopInfo::describe_shop_item(const shop_item &si) const
{
const unsigned long oldflags = si.item.flags;
- if (shoptype_identifies_stock(this->shoptype))
+ if (shoptype_identifies_stock(static_cast<shop_type>(this->shoptype)))
const_cast<shop_item&>(si).item.flags |= ISFLAG_IDENT_MASK;
describe_item( si.item );
diff --git a/crawl-ref/source/tags.cc b/crawl-ref/source/tags.cc
index 0c9d0fc0a5..8ae971b5a2 100644
--- a/crawl-ref/source/tags.cc
+++ b/crawl-ref/source/tags.cc
@@ -1570,7 +1570,7 @@ static void tag_read_level( struct tagHeader &th, char minorVersion )
env.shop[i].x = unmarshallByte(th);
env.shop[i].y = unmarshallByte(th);
env.shop[i].greed = unmarshallByte(th);
- env.shop[i].type = unmarshallByte(th);
+ env.shop[i].type = static_cast<shop_type>(unmarshallByte(th));
env.shop[i].level = unmarshallByte(th);
}