Skip to content

Commit

Permalink
Item summoning spells should respect "Keep hands free" (cataclysmbnte…
Browse files Browse the repository at this point in the history
  • Loading branch information
Vollch authored Oct 10, 2023
1 parent bd82bf4 commit bb811f3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/character_martial_arts.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ class character_martial_arts
private:
std::vector<matype_id> ma_styles;
matype_id style_selected = matype_id( "style_none" );
bool keep_hands_free = false;
public:
character_martial_arts();
character_martial_arts( const std::vector<matype_id> &styles,
Expand All @@ -32,6 +31,7 @@ class character_martial_arts
void reset_style();
// checks that style selected is one that is known, otherwise resets it
void selected_style_check();
bool keep_hands_free = false;
/** Creates the UI and handles player input for picking martial arts styles */
bool pick_style( const avatar &you );

Expand Down
3 changes: 2 additions & 1 deletion src/magic_spell_effect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "avatar.h"
#include "bodypart.h"
#include "calendar.h"
#include "character_martial_arts.h"
#include "character.h"
#include "color.h"
#include "creature.h"
Expand Down Expand Up @@ -740,7 +741,7 @@ void spell_effect::spawn_ethereal_item( const spell &sp, Creature &caster, const
if( you.can_wear( granted ).success() ) {
granted.set_flag( flag_id( "FIT" ) );
you.wear_item( granted, false );
} else if( !you.is_armed() ) {
} else if( !you.is_armed() && !you.martial_arts_data->keep_hands_free ) {
you.set_primary_weapon( granted );
} else {
you.i_add( granted );
Expand Down

0 comments on commit bb811f3

Please sign in to comment.