From 50fe47a8e11cda279441673f77179837ef4bdd6e Mon Sep 17 00:00:00 2001 From: Davi Date: Thu, 5 Dec 2019 03:23:36 -0500 Subject: [PATCH] Fix items with charges washing bug --- src/iuse.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/iuse.cpp b/src/iuse.cpp index 3451746c3fc9a..251f23e7cbf05 100644 --- a/src/iuse.cpp +++ b/src/iuse.cpp @@ -9456,7 +9456,8 @@ int iuse::wash_items( player *p, bool soft_items, bool hard_items ) ) { units::volume total_volume = 0_ml; for( const auto &p : items ) { - total_volume += p.first->volume() * p.second; + total_volume += p.first->volume() * p.second / + ( p.first->count_by_charges() ? p.first->charges : 1 ); } washing_requirements required = washing_requirements_for_volume( total_volume ); auto to_string = []( int val ) -> std::string { @@ -9494,7 +9495,7 @@ int iuse::wash_items( player *p, bool soft_items, bool hard_items ) p->add_msg_if_player( m_info, _( "Never mind." ) ); return 0; } - total_volume += i.volume() * pair.second; + total_volume += i.volume() * pair.second / ( i.count_by_charges() ? i.charges : 1 ); } washing_requirements required = washing_requirements_for_volume( total_volume );