From e76d5fc4941b027944b3903681d72eb2f20296db Mon Sep 17 00:00:00 2001 From: Gleb Mazovetskiy Date: Sun, 5 Jun 2022 13:02:09 +0100 Subject: [PATCH] UseScroll: use `HasInventoryOrBeltItem` --- Source/inv.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Source/inv.cpp b/Source/inv.cpp index dc1eb8f91..b2c5acb8c 100644 --- a/Source/inv.cpp +++ b/Source/inv.cpp @@ -1948,13 +1948,10 @@ bool UseScroll(const spell_id spell) if (pcurs != CURSOR_HAND) return false; - Player &myPlayer = *MyPlayer; - if (leveltype == DTYPE_TOWN && !spelldata[spell].sTownSpell) return false; - const InventoryAndBeltPlayerItemsRange items { myPlayer }; - return std::any_of(items.begin(), items.end(), [spell](const Item &item) { + return HasInventoryOrBeltItem(*MyPlayer, [spell](const Item &item) { return item.isScrollOf(spell); }); }