From 4adbd468bacb869c0366030199ab618c6a43122c Mon Sep 17 00:00:00 2001 From: RobbieNeko <30732426+RobbieNeko@users.noreply.github.com> Date: Sat, 4 Jan 2025 16:20:19 -0500 Subject: [PATCH 1/2] Allow mutant-spawned liquids to be stored/consumed Basically just ports the change Vollch made to spells spawning items --- src/mutation.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/mutation.cpp b/src/mutation.cpp index 7c1b800346a5..4e964355d68f 100644 --- a/src/mutation.cpp +++ b/src/mutation.cpp @@ -20,6 +20,7 @@ #include "event_bus.h" #include "field_type.h" #include "game.h" +#include "handle_liquid.h" #include "item.h" #include "item_contents.h" #include "itype.h" @@ -583,7 +584,12 @@ void Character::activate_mutation( const trait_id &mut ) return; } } else if( !mdata.spawn_item.is_empty() ) { - i_add_or_drop( item::spawn( mdata.spawn_item ) ); + detached_ptr granted = item::spawn( mdata.spawn_item ); + if (granted->made_of(LIQUID)){ + liquid_handler::consume_liquid( std::move( granted ), 1 ); + } else{ + i_add_or_drop( std::move(granted) ); + } add_msg_if_player( mdata.spawn_item_message() ); tdata.powered = false; return; From a0f3bfeccc0e2b0ce9c4ff0718f2d4e4e1743f97 Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Sat, 4 Jan 2025 21:44:08 +0000 Subject: [PATCH 2/2] style(autofix.ci): automated formatting --- src/mutation.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mutation.cpp b/src/mutation.cpp index 4e964355d68f..e81ff6628c94 100644 --- a/src/mutation.cpp +++ b/src/mutation.cpp @@ -585,10 +585,10 @@ void Character::activate_mutation( const trait_id &mut ) } } else if( !mdata.spawn_item.is_empty() ) { detached_ptr granted = item::spawn( mdata.spawn_item ); - if (granted->made_of(LIQUID)){ + if( granted->made_of( LIQUID ) ) { liquid_handler::consume_liquid( std::move( granted ), 1 ); - } else{ - i_add_or_drop( std::move(granted) ); + } else { + i_add_or_drop( std::move( granted ) ); } add_msg_if_player( mdata.spawn_item_message() ); tdata.powered = false;