summaryrefslogtreecommitdiff
path: root/src/store.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/store.cc')
-rw-r--r--src/store.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/store.cc b/src/store.cc
index 1a26f536..195598f1 100644
--- a/src/store.cc
+++ b/src/store.cc
@@ -297,6 +297,9 @@ static s32b price_item(object_type *o_ptr, int greed, bool_ flip)
/* Mega-Hack -- Black market sucks */
if (st_info[st_ptr->st_idx].flags1 & SF1_ALL_ITEM) price = price / 2;
+
+ /* No selling means you get no money */
+ if (no_selling) price = 0;
}
/* Shop is selling */
@@ -310,14 +313,14 @@ static s32b price_item(object_type *o_ptr, int greed, bool_ flip)
/* Mega-Hack -- Black market sucks */
if (st_info[st_ptr->st_idx].flags1 & SF1_ALL_ITEM) price = price * 2;
+
+ /* Never give items away for free */
+ if (price <= 0L) price = 1L;
}
/* Compute the final price (with rounding) */
price = (price * adjust + 50L) / 100L;
- /* Note -- Never become "free" */
- if (price <= 0L) return (1L);
-
/* Return the price */
return (price);
}