summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/shopping.cc
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-27 08:46:50 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-27 08:46:50 +0000
commita124171efd9ff0f38532b3a15a008705ad58ae38 (patch)
tree215f660375bc6f0a6624939bd8dfc0b7da645030 /crawl-ref/source/shopping.cc
parent1332e506af6d32843dd48acac1d663074ec86553 (diff)
downloadcrawl-ref-a124171efd9ff0f38532b3a15a008705ad58ae38.tar.gz
crawl-ref-a124171efd9ff0f38532b3a15a008705ad58ae38.zip
Various cleanups. (I can't run tiles, but it compiled fine, so I hope I didn't
introduce a subtle bug.) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8811 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/shopping.cc')
-rw-r--r--crawl-ref/source/shopping.cc42
1 files changed, 21 insertions, 21 deletions
diff --git a/crawl-ref/source/shopping.cc b/crawl-ref/source/shopping.cc
index 9345a5ba28..70227a4f2d 100644
--- a/crawl-ref/source/shopping.cc
+++ b/crawl-ref/source/shopping.cc
@@ -1801,7 +1801,7 @@ std::string shop_name(const coord_def& where)
return ("Buggy Shop");
}
- int shop_type = cshop->type;
+ const shop_type type = cshop->type;
unsigned long seed = static_cast<unsigned long>( cshop->keeper_name[0] )
| (static_cast<unsigned long>( cshop->keeper_name[1] ) << 8)
@@ -1809,27 +1809,28 @@ std::string shop_name(const coord_def& where)
std::string sh_name = apostrophise(make_name(seed, false)) + " ";
- if (shop_type == SHOP_WEAPON_ANTIQUE || shop_type == SHOP_ARMOUR_ANTIQUE)
+ if (type == SHOP_WEAPON_ANTIQUE || type == SHOP_ARMOUR_ANTIQUE)
sh_name += "Antique ";
sh_name +=
- (shop_type == SHOP_WEAPON
- || shop_type == SHOP_WEAPON_ANTIQUE) ? "Weapon" :
- (shop_type == SHOP_ARMOUR
- || shop_type == SHOP_ARMOUR_ANTIQUE) ? "Armour" :
-
- (shop_type == SHOP_JEWELLERY) ? "Jewellery" :
- (shop_type == SHOP_WAND) ? "Magical Wand" :
- (shop_type == SHOP_BOOK) ? "Book" :
- (shop_type == SHOP_FOOD) ? "Food" :
- (shop_type == SHOP_SCROLL) ? "Magic Scroll" :
- (shop_type == SHOP_GENERAL_ANTIQUE) ? "Assorted Antiques" :
- (shop_type == SHOP_DISTILLERY) ? "Distillery" :
- (shop_type == SHOP_GENERAL) ? "General Store"
- : "Bug";
-
- if (shop_type != SHOP_GENERAL
- && shop_type != SHOP_GENERAL_ANTIQUE && shop_type != SHOP_DISTILLERY)
+ (type == SHOP_WEAPON
+ || type == SHOP_WEAPON_ANTIQUE) ? "Weapon" :
+ (type == SHOP_ARMOUR
+ || type == SHOP_ARMOUR_ANTIQUE) ? "Armour" :
+
+ (type == SHOP_JEWELLERY) ? "Jewellery" :
+ (type == SHOP_WAND) ? "Magical Wand" :
+ (type == SHOP_BOOK) ? "Book" :
+ (type == SHOP_FOOD) ? "Food" :
+ (type == SHOP_SCROLL) ? "Magic Scroll" :
+ (type == SHOP_GENERAL_ANTIQUE) ? "Assorted Antiques" :
+ (type == SHOP_DISTILLERY) ? "Distillery" :
+ (type == SHOP_GENERAL) ? "General Store"
+ : "Bug";
+
+ if (type != SHOP_GENERAL
+ && type != SHOP_GENERAL_ANTIQUE
+ && type != SHOP_DISTILLERY)
{
const char* suffixnames[] = {"Shoppe", "Boutique", "Emporium", "Shop"};
const int temp = (where.x + where.y) % 4;
@@ -1842,6 +1843,5 @@ std::string shop_name(const coord_def& where)
bool is_shop_item(const item_def &item)
{
- return (item.pos.x == 0 && item.pos.y >= 5
- && item.pos.y < (MAX_SHOPS + 5));
+ return (item.pos.x == 0 && item.pos.y >= 5 && item.pos.y < (MAX_SHOPS + 5));
}