Skip to content

Commit

Permalink
Fixed Tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
DragonSlayer62 committed Jan 29, 2025
1 parent c0c6455 commit 5541dab
Showing 1 changed file with 34 additions and 34 deletions.
68 changes: 34 additions & 34 deletions source/cChar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2924,24 +2924,24 @@ bool CChar::WearItem( CItem *toWear )
}

scriptTriggers.clear();
scriptTriggers.shrink_to_fit();
scriptTriggers = this->GetScriptTriggers();
for( auto i : scriptTriggers )
{
cScript *tScript = JSMapping->GetScript( i );
if( tScript != nullptr )
{
// If script returns false, prevent item from being equipped
if( tScript->OnEquipAttempt( this, toWear ) == 0 )
{
CSocket *mSock = this->GetSocket();
if( mSock != nullptr )
{
Bounce( mSock, toWear );
}
return false;
}
}
scriptTriggers.shrink_to_fit();
scriptTriggers = this->GetScriptTriggers();
for( auto i : scriptTriggers )
{
cScript *tScript = JSMapping->GetScript( i );
if( tScript != nullptr )
{
// If script returns false, prevent item from being equipped
if( tScript->OnEquipAttempt( this, toWear ) == 0 )
{
CSocket *mSock = this->GetSocket();
if( mSock != nullptr )
{
Bounce( mSock, toWear );
}
return false;
}
}
}

bool rValue = true;
Expand Down Expand Up @@ -2970,7 +2970,7 @@ bool CChar::WearItem( CItem *toWear )
IncStaminaLeech( itemLayers[tLayer]->GetStaminaLeech() );
IncManaLeech( itemLayers[tLayer]->GetManaLeech() );

IncHitChance( itemLayers[tLayer]->GetHitChance() );
IncHitChance( itemLayers[tLayer]->GetHitChance() );
IncDefenseChance( itemLayers[tLayer]->GetDefenseChance() );

IncHealthBonus( itemLayers[tLayer]->GetHealthBonus() );
Expand Down Expand Up @@ -3030,20 +3030,20 @@ bool CChar::TakeOffItem( ItemLayers Layer )
}

scriptTriggers.clear();
scriptTriggers.shrink_to_fit();
scriptTriggers = this->GetScriptTriggers();
for( auto i : scriptTriggers )
{
cScript *tScript = JSMapping->GetScript( i );
if( tScript != nullptr )
{
// If script returns false, prevent item from being equipped
if( tScript->OnUnequipAttempt( this, itemLayers[Layer] ) == 0 )
{
return false;
}
}
}
scriptTriggers.shrink_to_fit();
scriptTriggers = this->GetScriptTriggers();
for( auto i : scriptTriggers )
{
cScript *tScript = JSMapping->GetScript( i );
if( tScript != nullptr )
{
// If script returns false, prevent item from being equipped
if( tScript->OnUnequipAttempt( this, itemLayers[Layer] ) == 0 )
{
return false;
}
}
}

if( Layer == IL_PACKITEM ) // It's our pack!
{
Expand All @@ -3055,7 +3055,7 @@ bool CChar::TakeOffItem( ItemLayers Layer )

IncSwingSpeedIncrease( -itemLayers[Layer]->GetSwingSpeedIncrease() );

IncHealthLeech( -itemLayers[Layer]->GetHealthLeech() );
IncHealthLeech( -itemLayers[Layer]->GetHealthLeech() );
IncStaminaLeech( -itemLayers[Layer]->GetStaminaLeech() );
IncManaLeech( -itemLayers[Layer]->GetManaLeech() );

Expand Down

0 comments on commit 5541dab

Please sign in to comment.