diff --git a/src/character.h b/src/character.h index 4ad33414474f1..ae9474126511d 100644 --- a/src/character.h +++ b/src/character.h @@ -1768,7 +1768,7 @@ class Character : public Creature, public visitable * @param interactive Alert player and drain moves if true. */ std::optional::iterator> - wear( item_location item_wear, bool interactive = true ); + wear( item_location item_wear, bool interactive = true, bool no_remove = false ); /** Used for eating object at a location. Removes item if all of it was consumed. * @returns trinary enum NONE, SOME or ALL amount consumed. diff --git a/src/character_attire.cpp b/src/character_attire.cpp index 485771beb8081..2f1446f8f4752 100644 --- a/src/character_attire.cpp +++ b/src/character_attire.cpp @@ -228,7 +228,7 @@ Character::wear( int pos, bool interactive ) } std::optional::iterator> -Character::wear( item_location item_wear, bool interactive ) +Character::wear( item_location item_wear, bool interactive, bool no_remove ) { item to_wear = *item_wear; if( is_worn( to_wear ) ) { @@ -254,6 +254,8 @@ Character::wear( item_location item_wear, bool interactive ) if( &to_wear == &weapon ) { weapon = item(); was_weapon = true; + } else if( no_remove ) { + was_weapon = false; } else if( has_item( to_wear ) ) { remove_item( to_wear ); was_weapon = false; diff --git a/src/iuse.cpp b/src/iuse.cpp index 2baf0f15329b3..54c8e59a2118f 100644 --- a/src/iuse.cpp +++ b/src/iuse.cpp @@ -8625,7 +8625,7 @@ std::optional iuse::change_outfit( Character *p, item *it, const tripoint & auto ret = p->can_wear( component ); if( ret.success() ) { item_location new_clothes( *p, &component ); - p->wear( new_clothes ); + p->wear( new_clothes, true, true ); } else { // For some reason we couldn't wear this item. Maybe the player mutated in the meanwhile, but // drop the item instead of deleting it.