diff options
author | Nicholas Feinberg <pleasingfung@gmail.com> | 2014-07-04 17:24:47 -0700 |
---|---|---|
committer | Nicholas Feinberg <pleasingfung@gmail.com> | 2014-07-04 17:24:47 -0700 |
commit | b98b8932dcd445179cf0c0d235e91f6d1e577f92 (patch) | |
tree | 7e575ed8c1165244f653ebfc3545818634728403 /crawl-ref/source/shopping.cc | |
parent | 018e8dee5c24d5aa14632fe9dad5295a7ee9c7f4 (diff) | |
download | crawl-ref-b98b8932dcd445179cf0c0d235e91f6d1e577f92.tar.gz crawl-ref-b98b8932dcd445179cf0c0d235e91f6d1e577f92.zip |
Refactor item pickup code
Diffstat (limited to 'crawl-ref/source/shopping.cc')
-rw-r--r-- | crawl-ref/source/shopping.cc | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/crawl-ref/source/shopping.cc b/crawl-ref/source/shopping.cc index d9ed3471f0..9a28efc86d 100644 --- a/crawl-ref/source/shopping.cc +++ b/crawl-ref/source/shopping.cc @@ -817,12 +817,8 @@ static bool _purchase(int shop, int item_got, int cost, bool id) set_ident_flags(item, ISFLAG_IDENT_MASK); } - const int quant = item.quantity; - // Note that item will be invalidated if num == item.quantity. - const int num = move_item_to_player(item_got, item.quantity, false); - // Shopkeepers will now place goods you can't carry outside the shop. - if (num < quant) + if (!move_item_to_inv(item_got, item.quantity, false)) { move_item_to_grid(&item_got, env.shop[shop].pos); return false; |