From 6a0957551b14a65cc91de8b25f0207d2c184298d Mon Sep 17 00:00:00 2001 From: George Kightly Date: Tue, 10 Dec 2024 19:32:13 +0000 Subject: [PATCH] Check first item volume instead of stack volume --- src/advanced_inv.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/advanced_inv.cpp b/src/advanced_inv.cpp index 5a9c44e9a658f..178e651f8475f 100644 --- a/src/advanced_inv.cpp +++ b/src/advanced_inv.cpp @@ -655,9 +655,9 @@ struct advanced_inv_sorter { break; case SORTBY_PRICEPERVOLUME: { const double price_density1 = static_cast( d1.items.front()->price( true ) ) / - static_cast( std::max( 1, d1.volume.value() ) ); + static_cast( std::max( 1, d1.items.front()->volume().value() ) ); const double price_density2 = static_cast( d2.items.front()->price( true ) ) / - static_cast( std::max( 1, d2.volume.value() ) ); + static_cast( std::max( 1, d2.items.front()->volume().value() ) ); if( price_density1 != price_density2 ) { return price_density1 > price_density2; }