Skip to content

Commit

Permalink
Merge pull request #35873 from DaviBones/laundry-charges
Browse files Browse the repository at this point in the history
Fix resource requirements when washing items with charges
  • Loading branch information
ZhilkinSerg committed Dec 5, 2019
2 parents 5812006 + 50fe47a commit 34ac4b8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/iuse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 );
Expand Down

0 comments on commit 34ac4b8

Please sign in to comment.