@ -228,27 +228,24 @@ void LocalPlayer::updateAttributes(bool forceUpdate)
MWWorld : : Ptr ptrPlayer = getPlayerPtr ( ) ;
MWWorld : : Ptr ptrPlayer = getPlayerPtr ( ) ;
const MWMechanics : : NpcStats & ptrNpcStats = ptrPlayer . getClass ( ) . getNpcStats ( ptrPlayer ) ;
const MWMechanics : : NpcStats & ptrNpcStats = ptrPlayer . getClass ( ) . getNpcStats ( ptrPlayer ) ;
bool attributesChanged = false ;
for ( int i = 0 ; i < 8 ; + + i )
for ( int i = 0 ; i < 8 ; + + i )
{
{
if ( ptrNpcStats . getAttribute ( i ) . getBase ( ) ! = creatureStats . mAttributes [ i ] . mBase )
if ( ptrNpcStats . getAttribute ( i ) . getBase ( ) ! = creatureStats . mAttributes [ i ] . mBase | |
ptrNpcStats . getSkillIncrease ( i ) ! = npcStats . mSkillIncrease [ i ] | |
forceUpdate )
{
{
ptrNpcStats . getAttribute ( i ) . writeState ( creatureStats . mAttributes [ i ] ) ;
ptrNpcStats . getAttribute ( i ) . writeState ( creatureStats . mAttributes [ i ] ) ;
attributesChanged = true ;
}
if ( ptrNpcStats . getSkillIncrease ( i ) ! = npcStats . mSkillIncrease [ i ] )
{
npcStats . mSkillIncrease [ i ] = ptrNpcStats . getSkillIncrease ( i ) ;
npcStats . mSkillIncrease [ i ] = ptrNpcStats . getSkillIncrease ( i ) ;
attribute sChanged = true ;
attributeChanges . attributeIndexes . push_back ( i ) ;
}
}
}
}
if ( attribute sChanged | | forceUpdate )
if ( attribute Changes. attributeIndexes . size ( ) > 0 )
{
{
getNetworking ( ) - > getPlayerPacket ( ID_PLAYER_ATTRIBUTE ) - > setPlayer ( this ) ;
getNetworking ( ) - > getPlayerPacket ( ID_PLAYER_ATTRIBUTE ) - > setPlayer ( this ) ;
getNetworking ( ) - > getPlayerPacket ( ID_PLAYER_ATTRIBUTE ) - > Send ( ) ;
getNetworking ( ) - > getPlayerPacket ( ID_PLAYER_ATTRIBUTE ) - > Send ( ) ;
attributeChanges . attributeIndexes . clear ( ) ;
}
}
}
}