Skip to content

Commit

Permalink
no longer force wield
Browse files Browse the repository at this point in the history
  • Loading branch information
Saicchi committed Jan 7, 2021
1 parent ec4ca98 commit c44b9ed
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions src/activity_actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2700,20 +2700,14 @@ void read_activity_actor::start( player_activity &act, Character &who )
return;
}

// make reader wield book to prevent
// losing item_location errors while loading
if( !who.is_wielding( *book ) ) {
if( !who.is_armed() ||
( who.is_npc() || query_yn( _( "Wield the %s and start reading?" ), book->tname() ) ) ) {

if( !who.wield( *book ) ) {
add_msg( m_bad, who.can_wield( *book ).c_str() );
act.set_to_null();
return;
}
// location changed
book = item_location( who, &who.weapon );
// book item_location must be of type character
// or else there will be item_location errors while loading
if( book.where() != item_location::type::character ) {
// character should have book before starting this activity
if( who.has_item( *book ) ) {
book = item_location( who, book.get_item() );
} else {
debugmsg( "ACT_READ character '%s' does not have '%s' book", who.get_name(), book->tname() );
act.set_to_null();
return;
}
Expand Down

0 comments on commit c44b9ed

Please sign in to comment.