@ -920,7 +920,7 @@ void LocalPlayer::setAttributes()
{
{
MWWorld : : Ptr ptrPlayer = getPlayerPtr ( ) ;
MWWorld : : Ptr ptrPlayer = getPlayerPtr ( ) ;
MWMechanics : : CreatureStats * ptrCreature Stats = & ptrPlayer . getClass ( ) . get Creature Stats( ptrPlayer ) ;
MWMechanics : : NpcStats * ptrNpc Stats = & ptrPlayer . getClass ( ) . get Npc Stats( ptrPlayer ) ;
MWMechanics : : AttributeValue attributeValue ;
MWMechanics : : AttributeValue attributeValue ;
for ( int attributeIndex = 0 ; attributeIndex < 8 ; + + attributeIndex )
for ( int attributeIndex = 0 ; attributeIndex < 8 ; + + attributeIndex )
@ -928,14 +928,14 @@ void LocalPlayer::setAttributes()
// If the server wants to clear our attribute's non-zero modifier, we need to remove
// If the server wants to clear our attribute's non-zero modifier, we need to remove
// the spell effect causing it, to avoid an infinite loop where the effect keeps resetting
// the spell effect causing it, to avoid an infinite loop where the effect keeps resetting
// the modifier
// the modifier
if ( creatureStats . mAttributes [ attributeIndex ] . mMod = = 0 & & ptr Creature Stats- > getAttribute ( attributeIndex ) . getModifier ( ) > 0 )
if ( creatureStats . mAttributes [ attributeIndex ] . mMod = = 0 & & ptr Npc Stats- > getAttribute ( attributeIndex ) . getModifier ( ) > 0 )
{
{
ptr Creature Stats- > getActiveSpells ( ) . purgeEffectByArg ( ESM : : MagicEffect : : FortifyAttribute , attributeIndex ) ;
ptr Npc Stats- > getActiveSpells ( ) . purgeEffectByArg ( ESM : : MagicEffect : : FortifyAttribute , attributeIndex ) ;
MWBase : : Environment : : get ( ) . getMechanicsManager ( ) - > updateMagicEffects ( ptrPlayer ) ;
MWBase : : Environment : : get ( ) . getMechanicsManager ( ) - > updateMagicEffects ( ptrPlayer ) ;
// Is the modifier for this attribute still higher than 0? If so, unequip items that
// Is the modifier for this attribute still higher than 0? If so, unequip items that
// fortify the attribute
// fortify the attribute
if ( ptr Creature Stats- > getAttribute ( attributeIndex ) . getModifier ( ) > 0 )
if ( ptr Npc Stats- > getAttribute ( attributeIndex ) . getModifier ( ) > 0 )
{
{
MechanicsHelper : : unequipItemsByEffect ( ptrPlayer , ESM : : Enchantment : : ConstantEffect , ESM : : MagicEffect : : FortifyAttribute , attributeIndex , - 1 ) ;
MechanicsHelper : : unequipItemsByEffect ( ptrPlayer , ESM : : Enchantment : : ConstantEffect , ESM : : MagicEffect : : FortifyAttribute , attributeIndex , - 1 ) ;
mwmp : : Main : : get ( ) . getGUIController ( ) - > refreshGuiMode ( MWGui : : GM_Inventory ) ;
mwmp : : Main : : get ( ) . getGUIController ( ) - > refreshGuiMode ( MWGui : : GM_Inventory ) ;
@ -943,7 +943,9 @@ void LocalPlayer::setAttributes()
}
}
attributeValue . readState ( creatureStats . mAttributes [ attributeIndex ] ) ;
attributeValue . readState ( creatureStats . mAttributes [ attributeIndex ] ) ;
ptrCreatureStats - > setAttribute ( attributeIndex , attributeValue ) ;
ptrNpcStats - > setAttribute ( attributeIndex , attributeValue ) ;
ptrNpcStats - > setSkillIncrease ( attributeIndex , npcStats . mSkillIncrease [ attributeIndex ] ) ;
}
}
}
}
@ -976,11 +978,6 @@ void LocalPlayer::setSkills()
skillValue . readState ( npcStats . mSkills [ skillIndex ] ) ;
skillValue . readState ( npcStats . mSkills [ skillIndex ] ) ;
ptrNpcStats - > setSkill ( skillIndex , skillValue ) ;
ptrNpcStats - > setSkill ( skillIndex , skillValue ) ;
}
}
for ( int attributeIndex = 0 ; attributeIndex < 8 ; + + attributeIndex )
ptrNpcStats - > setSkillIncrease ( attributeIndex , npcStats . mSkillIncrease [ attributeIndex ] ) ;
ptrNpcStats - > setLevelProgress ( npcStats . mLevelProgress ) ;
}
}
void LocalPlayer : : setLevel ( )
void LocalPlayer : : setLevel ( )
@ -988,8 +985,9 @@ void LocalPlayer::setLevel()
MWBase : : World * world = MWBase : : Environment : : get ( ) . getWorld ( ) ;
MWBase : : World * world = MWBase : : Environment : : get ( ) . getWorld ( ) ;
MWWorld : : Ptr ptrPlayer = world - > getPlayerPtr ( ) ;
MWWorld : : Ptr ptrPlayer = world - > getPlayerPtr ( ) ;
MWMechanics : : CreatureStats * ptrCreatureStats = & ptrPlayer . getClass ( ) . getCreatureStats ( ptrPlayer ) ;
MWMechanics : : NpcStats * ptrNpcStats = & ptrPlayer . getClass ( ) . getNpcStats ( ptrPlayer ) ;
ptrCreatureStats - > setLevel ( creatureStats . mLevel ) ;
ptrNpcStats - > setLevel ( creatureStats . mLevel ) ;
ptrNpcStats - > setLevelProgress ( npcStats . mLevelProgress ) ;
}
}
void LocalPlayer : : setBounty ( )
void LocalPlayer : : setBounty ( )