From a3f51c4dbac537dfddbd90d4a8129fd82db8c9c5 Mon Sep 17 00:00:00 2001 From: haranp Date: Wed, 30 Jul 2008 12:57:58 +0000 Subject: Fix 2029792: drop menu lets you choose more than the amount of the item. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6734 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/invent.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'crawl-ref/source/invent.cc') diff --git a/crawl-ref/source/invent.cc b/crawl-ref/source/invent.cc index 513a09685e..90adbfb0ef 100644 --- a/crawl-ref/source/invent.cc +++ b/crawl-ref/source/invent.cc @@ -173,6 +173,13 @@ const int InvEntry::item_freshness() const return freshness; } +void InvEntry::select(int qty) +{ + if ( item && item->quantity < qty ) + qty = item->quantity; + MenuEntry::select(qty); +} + std::string InvEntry::get_text() const { std::ostringstream tstr; -- cgit v1.2.3-54-g00ecf