From 09ec0b4bea7e4a16eb6009305b7984bcca95a7b8 Mon Sep 17 00:00:00 2001 From: congq Date: Tue, 10 Dec 2019 18:06:08 -0500 Subject: [PATCH 1/3] handle liquid in-progress crafting --- src/item.cpp | 5 +++++ src/pickup.cpp | 2 ++ 2 files changed, 7 insertions(+) diff --git a/src/item.cpp b/src/item.cpp index 222912b2f1a58..15c03281e8863 100644 --- a/src/item.cpp +++ b/src/item.cpp @@ -320,6 +320,11 @@ item::item( const recipe *rec, int qty, std::list items, std::vectorresult())->phase == LIQUID ) { + current_phase = static_cast( 2 ); + } } item item::make_corpse( const mtype_id &mt, time_point turn, const std::string &name ) diff --git a/src/pickup.cpp b/src/pickup.cpp index 863209a068d37..22dced36a76cf 100644 --- a/src/pickup.cpp +++ b/src/pickup.cpp @@ -272,6 +272,8 @@ bool pick_one_up( item_location &loc, int quantity, bool &got_water, bool &offer } } else if( newit.made_of_from_type( LIQUID ) && !newit.is_frozen_liquid() ) { got_water = true; + } else if( newit.is_craft() && newit.made_of( LIQUID )) { + got_water = true; //Handles in progress liquid craft } else if( !u.can_pickWeight( newit, false ) ) { if( !autopickup ) { const std::string &explain = string_format( _( "The %s is too heavy!" ), From f242d65d51b124ff434972c173837067fd177cd5 Mon Sep 17 00:00:00 2001 From: congq Date: Tue, 10 Dec 2019 19:33:44 -0500 Subject: [PATCH 2/3] handle liquid in-progress crafting --- src/pickup.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/pickup.cpp b/src/pickup.cpp index 22dced36a76cf..c9ce88aa0459b 100644 --- a/src/pickup.cpp +++ b/src/pickup.cpp @@ -270,10 +270,9 @@ bool pick_one_up( item_location &loc, int quantity, bool &got_water, bool &offer if( !( got_water = !( u.crush_frozen_liquid( newloc ) ) ) ) { option = STASH; } - } else if( newit.made_of_from_type( LIQUID ) && !newit.is_frozen_liquid() ) { + } else if( newit.made_of_from_type( LIQUID ) && !newit.is_frozen_liquid() || + newit.is_craft() && newit.made_of( LIQUID ) ) { got_water = true; - } else if( newit.is_craft() && newit.made_of( LIQUID )) { - got_water = true; //Handles in progress liquid craft } else if( !u.can_pickWeight( newit, false ) ) { if( !autopickup ) { const std::string &explain = string_format( _( "The %s is too heavy!" ), From 76039cef13a2ac6ae4ca9c7538f1639b1b033581 Mon Sep 17 00:00:00 2001 From: congq Date: Tue, 10 Dec 2019 20:08:08 -0500 Subject: [PATCH 3/3] handle liquid in-progress crafting --- src/pickup.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pickup.cpp b/src/pickup.cpp index c9ce88aa0459b..788e5ff7975a5 100644 --- a/src/pickup.cpp +++ b/src/pickup.cpp @@ -270,8 +270,8 @@ bool pick_one_up( item_location &loc, int quantity, bool &got_water, bool &offer if( !( got_water = !( u.crush_frozen_liquid( newloc ) ) ) ) { option = STASH; } - } else if( newit.made_of_from_type( LIQUID ) && !newit.is_frozen_liquid() || - newit.is_craft() && newit.made_of( LIQUID ) ) { + } else if(( newit.made_of_from_type( LIQUID ) && !newit.is_frozen_liquid() ) || + ( newit.is_craft() && newit.made_of( LIQUID ) )) { got_water = true; } else if( !u.can_pickWeight( newit, false ) ) { if( !autopickup ) {