From 02d98db391e111569e0f9f68d297880ac50b767a Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Mon, 3 Feb 2020 20:43:43 -0500 Subject: [PATCH] Prevent shops from selling unidentified options. Patch identified by @x-qq Fixes #65 --- src/scenario/shop.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/scenario/shop.cpp b/src/scenario/shop.cpp index a38ea9e0..9c05d470 100644 --- a/src/scenario/shop.cpp +++ b/src/scenario/shop.cpp @@ -111,7 +111,6 @@ void cShop::addItem(size_t n, cItem item, size_t quantity, int chance) { if(item.variety == eItemType::NO_ITEM) return; items[i].type = chance == 100 ? eShopItemType::ITEM : eShopItemType::OPT_ITEM; items[i].item = item; - items[i].item.ident = true; items[i].quantity = quantity; items[i].index = n; if(chance < 100) @@ -123,6 +122,8 @@ void cShop::refreshItems(std::vector& fromList) { for(size_t i = 0; i < items.size(); i++) { if(items[i].type == eShopItemType::ITEM || items[i].type == eShopItemType::OPT_ITEM) items[i].item = fromList[items[i].index]; + // Prevent shops from selling unidentified items + items[i].item.ident = true; } }