@ -112,37 +112,40 @@ void Player::update()
{
{
auto plPCtrl = mwmp : : Networking : : get ( ) . getPlayerPacketController ( ) ;
auto plPCtrl = mwmp : : Networking : : get ( ) . getPlayerPacketController ( ) ;
if ( inventory. isEquipmentChanged ( ) )
if ( baseInfoChanged )
{
{
auto packet = plPCtrl - > GetPacket ( ID_PLAYER_ EQUIPMENT ) ;
auto packet = plPCtrl - > GetPacket ( ID_PLAYER_ BASEINFO ) ;
packet - > setPlayer ( this ) ;
packet - > setPlayer ( basePlayer ) ;
packet - > Send ( false ) ;
packet - > Send ( false ) ;
packet - > Send ( true ) ;
packet - > Send ( true ) ;
inventory . resetEquipmentFlag ( ) ;
}
}
if ( inventory . inventoryChangeType ( ) ! = 0 )
// The character class can override values from below on the client, so send it first
cClass . update ( ) ;
if ( statsChanged )
{
{
auto packet = plPCtrl - > GetPacket ( ID_PLAYER_EQUIPMENT ) ;
auto packet = plPCtrl - > GetPacket ( ID_PLAYER_ STATS_DYNAMIC ) ;
packet - > setPlayer ( this ) ;
packet - > setPlayer ( basePlayer ) ;
packet - > Send ( /*toOthers*/ false ) ;
packet - > Send ( false ) ;
inventory. resetInventoryFlag ( ) ;
packet- > Send ( true ) ;
}
}
if ( attributes Changed)
if ( position Changed)
{
{
auto packet = plPCtrl - > GetPacket ( ID_PLAYER_ ATTRIBUTE ) ;
auto packet = plPCtrl - > GetPacket ( ID_PLAYER_ POSITION ) ;
packet - > setPlayer ( basePlayer ) ;
packet - > setPlayer ( basePlayer ) ;
packet - > Send ( false ) ;
packet - > Send ( false ) ;
packet - > Send ( true ) ;
}
}
if ( statsChanged )
if ( attributesChanged )
{
{
auto packet = plPCtrl - > GetPacket ( ID_PLAYER_ STATS_DYNAMIC ) ;
auto packet = plPCtrl - > GetPacket ( ID_PLAYER_ ATTRIBUTE ) ;
packet - > setPlayer ( basePlayer ) ;
packet - > setPlayer ( basePlayer ) ;
packet - > Send ( false ) ;
packet - > Send ( false ) ;
packet - > Send ( true ) ;
packet - > Send ( true ) ;
}
}
if ( skillsChanged )
if ( skillsChanged )
{
{
auto packet = plPCtrl - > GetPacket ( ID_PLAYER_SKILL ) ;
auto packet = plPCtrl - > GetPacket ( ID_PLAYER_SKILL ) ;
@ -150,19 +153,22 @@ void Player::update()
packet - > Send ( false ) ;
packet - > Send ( false ) ;
packet - > Send ( true ) ;
packet - > Send ( true ) ;
}
}
if ( baseInfoChanged )
if ( inventory . isEquipmentChanged ( ) )
{
{
auto packet = plPCtrl - > GetPacket ( ID_PLAYER_ BASEINFO ) ;
auto packet = plPCtrl - > GetPacket ( ID_PLAYER_ EQUIPMENT ) ;
packet - > setPlayer ( basePlayer ) ;
packet - > setPlayer ( this ) ;
packet - > Send ( false ) ;
packet - > Send ( false ) ;
packet - > Send ( true ) ;
packet - > Send ( true ) ;
inventory . resetEquipmentFlag ( ) ;
}
}
if ( positionChanged )
if ( inventory. inventoryChangeType ( ) ! = 0 )
{
{
auto packet = plPCtrl - > GetPacket ( ID_PLAYER_POSITION ) ;
auto packet = plPCtrl - > GetPacket ( ID_PLAYER_EQUIPMENT ) ;
packet - > setPlayer ( basePlayer ) ;
packet - > setPlayer ( this ) ;
packet - > Send ( false ) ;
packet - > Send ( /*toOthers*/ false ) ;
inventory . resetInventoryFlag ( ) ;
}
}
if ( changedMap )
if ( changedMap )
@ -181,7 +187,6 @@ void Player::update()
cellAPI . resetChangedCell ( ) ;
cellAPI . resetChangedCell ( ) ;
}
}
cClass . update ( ) ;
settings . update ( ) ;
settings . update ( ) ;
books . update ( ) ;
books . update ( ) ;
gui . update ( ) ;
gui . update ( ) ;