Skip to content

Commit

Permalink
feat: Liquid summoned by spells can be stored and used (#3637)
Browse files Browse the repository at this point in the history
Liquid handling for spawn spells
  • Loading branch information
Vollch authored Nov 12, 2023
1 parent d90ae17 commit c9e3585
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/magic_spell_effect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "field.h"
#include "field_type.h"
#include "game.h"
#include "handle_liquid.h"
#include "item.h"
#include "line.h"
#include "magic.h"
Expand Down Expand Up @@ -751,7 +752,9 @@ void spell_effect::spawn_ethereal_item( const spell &sp, Creature &caster, const
granted->charges = sp.damage();
}
avatar &you = get_avatar();
if( you.can_wear( *granted ).success() ) {
if( granted->made_of( LIQUID ) ) {
liquid_handler::consume_liquid( std::move( granted ), 1 );
} else if( you.can_wear( *granted ).success() ) {
granted->set_flag( flag_id( "FIT" ) );
you.wear_item( std::move( granted ), false );
} else if( !you.is_armed() && !you.martial_arts_data->keep_hands_free ) {
Expand Down

0 comments on commit c9e3585

Please sign in to comment.