Skip to content

Commit

Permalink
reduce gear collisions.
Browse files Browse the repository at this point in the history
  • Loading branch information
esotericist committed Aug 3, 2019
1 parent c6fde59 commit 45428d0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion data/json/flags.json
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@
"type": "json_flag",
"context": [ "ARMOR", "TOOL_ARMOR" ],
"description": "Prevents the item from participating in the encumbrance system when worn.",
"info": "It seems <info>partially intangible</info>, and can occupy the same space as other things."
"info": "It seems <info>partially intangible</info>, and can occupy the same space as other things when worn."
},
{
"id": "SHEATH_KNIFE",
Expand Down
24 changes: 12 additions & 12 deletions src/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10218,7 +10218,8 @@ bool player::wearing_something_on( body_part bp ) const
bool player::natural_attack_restricted_on( body_part bp ) const
{
for( auto &i : worn ) {
if( i.covers( bp ) && !i.has_flag( "ALLOWS_NATURAL_ATTACKS" ) ) {
if( i.covers( bp ) && !i.has_flag( "ALLOWS_NATURAL_ATTACKS" ) && !i.has_flag( "SEMITANGIBLE" ) &&
!i.has_flag( "PERSONAL" ) && !i.has_flag( "AURA" ) ) {
return true;
}
}
Expand All @@ -10232,9 +10233,9 @@ bool player::is_wearing_shoes( const side &which_side ) const
if( which_side == side::LEFT || which_side == side::BOTH ) {
left = false;
for( const item &worn_item : worn ) {
if( worn_item.covers( bp_foot_l ) &&
!worn_item.has_flag( "BELTED" ) &&
!worn_item.has_flag( "SKINTIGHT" ) ) {
if( worn_item.covers( bp_foot_l ) && !worn_item.has_flag( "BELTED" ) &&
!worn_item.has_flag( "PERSONAL" ) && !worn_item.has_flag( "AURA" ) &&
!worn_item.has_flag( "SEMITANGIBLE" ) && !worn_item.has_flag( "SKINTIGHT" ) ) {
left = true;
break;
}
Expand All @@ -10243,9 +10244,9 @@ bool player::is_wearing_shoes( const side &which_side ) const
if( which_side == side::RIGHT || which_side == side::BOTH ) {
right = false;
for( const item &worn_item : worn ) {
if( worn_item.covers( bp_foot_r ) &&
!worn_item.has_flag( "BELTED" ) &&
!worn_item.has_flag( "SKINTIGHT" ) ) {
if( worn_item.covers( bp_foot_r ) && !worn_item.has_flag( "BELTED" ) &&
!worn_item.has_flag( "PERSONAL" ) && !worn_item.has_flag( "AURA" ) &&
!worn_item.has_flag( "SEMITANGIBLE" ) && !worn_item.has_flag( "SKINTIGHT" ) ) {
right = true;
break;
}
Expand All @@ -10257,9 +10258,8 @@ bool player::is_wearing_shoes( const side &which_side ) const
bool player::is_wearing_helmet() const
{
for( const item &i : worn ) {
if( i.covers( bp_head ) &&
!i.has_flag( "HELMET_COMPAT" ) &&
!i.has_flag( "SKINTIGHT" ) &&
if( i.covers( bp_head ) && !i.has_flag( "HELMET_COMPAT" ) && !i.has_flag( "SKINTIGHT" ) &&
!i.has_flag( "PERSONAL" ) && !i.has_flag( "AURA" ) && !i.has_flag( "SEMITANGIBLE" ) &&
!i.has_flag( "OVERSIZE" ) ) {
return true;
}
Expand All @@ -10272,8 +10272,8 @@ int player::head_cloth_encumbrance() const
int ret = 0;
for( auto &i : worn ) {
const item *worn_item = &i;
if( i.covers( bp_head ) && ( worn_item->has_flag( "HELMET_COMPAT" ) ||
worn_item->has_flag( "SKINTIGHT" ) ) ) {
if( i.covers( bp_head ) && !i.has_flag( "SEMITANGIBLE" ) &&
( worn_item->has_flag( "HELMET_COMPAT" ) || worn_item->has_flag( "SKINTIGHT" ) ) ) {
ret += worn_item->get_encumber( *this );
}
}
Expand Down

0 comments on commit 45428d0

Please sign in to comment.