Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix integrated armor being incompatible with some mutations #73547

Merged
merged 7 commits into from
May 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/JSON_FLAGS.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ Some armor flags, such as `WATCH` and `ALARMCLOCK` are compatible with other ite
- ```HELMET_NAPE_PROTECTOR``` Item can be worn with different hard helmets, as attachment; specifically can be put in pocket for armor with this flag restriction.
- ```HOOD``` Allow this clothing to conditionally cover the head, for additional warmth or water protection, if the player's head isn't encumbered.
- ```HYGROMETER``` This gear is equipped with an accurate hygrometer (which is used to measure humidity).
- ```INTEGRATED``` This item represents a part of you granted by mutations or bionics. It will always fit, cannot be unequipped (aside from losing the source), and won't drop on death, but otherwise behaves like normal armor with regards to function, encumbrance, layer conflicts and so on.
- ```INTEGRATED``` This item represents a part of you granted by mutations or bionics. It will always fit, will not conflict with armor-blocking mutations, cannot be unequipped (aside from losing the source), and won't drop on death, but otherwise behaves like normal armor with regards to function, encumbrance, layer conflicts and so on.
- ```IR_EFFECT``` Being worn, this item will give an infrared vision.
- ```MUTE``` Makes the player mute.
- ```NORMAL``` Items worn like normal clothing. This is assumed as default.
Expand Down
3 changes: 2 additions & 1 deletion src/character_attire.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@ ret_val<void> Character::can_wear( const item &it, bool with_equip_change ) cons
return ret_val<void>::make_failure( _( "Can't wear that, it's filthy!" ) );
}

if( !it.has_flag( flag_OVERSIZE ) && !it.has_flag( flag_SEMITANGIBLE ) &&
if( !it.has_flag( flag_OVERSIZE ) && !it.has_flag( flag_INTEGRATED ) &&
!it.has_flag( flag_SEMITANGIBLE ) &&
!it.has_flag( flag_UNRESTRICTED ) ) {
for( const trait_id &mut : get_mutations() ) {
const mutation_branch &branch = mut.obj();
Expand Down
3 changes: 2 additions & 1 deletion src/iuse_actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,8 @@ ret_val<void> iuse_transform::can_use( const Character &p, const item &it,

if( p.is_worn( it ) ) {
item tmp = item( target );
if( !tmp.has_flag( flag_OVERSIZE ) && !tmp.has_flag( flag_SEMITANGIBLE ) ) {
if( !tmp.has_flag( flag_OVERSIZE ) && !tmp.has_flag( flag_INTEGRATED ) &&
!tmp.has_flag( flag_SEMITANGIBLE ) ) {
for( const trait_id &mut : p.get_mutations() ) {
const mutation_branch &branch = mut.obj();
if( branch.conflicts_with_item( tmp ) ) {
Expand Down