Hello, I have this little problem. So when a player used AFK Vendor, and put amount of 1.5M Perins, and then they are off. The Mail only receive 200K perins. Any tips how to increase the maximum mail perins? Thank you.
BOOL CMover::AddGold(int nGold, BOOL bSend)
BOOL CMover::AddGold(int nGold, BOOL bSend)
{
if (!IsValidObj(this))
return FALSE;
if (nGold == 0)
return TRUE;
__int64 i64Total = static_cast<__int64>(GetGold()) + static_cast<__int64>(nGold);
if (i64Total > static_cast<__int64>(INT_MAX))
i64Total = static_cast<__int64>(INT_MAX);
else if (i64Total < 0)
i64Total = 0;
SetGold(static_cast<int>(i64Total));
if (bSend)
{
#ifdef __WORLDSERVER
if (i64Total > INT_MAX)
i64Total = INT_MAX;
g_UserMng.AddSetPointParam(this, DST_GOLD, (int)i64Total);
#endif // __WORLDSERVER
}
return TRUE;
}
Quote:
Hello, I have this little problem. So when a player used AFK Vendor, and put amount of 1.5M Perins, and then they are off. The Mail only receive 200K perins. Any tips how to increase the maximum mail perins? Thank you.
BOOL CMover::AddGold( int nGold, BOOL bSend )
{
if( nGold == 0 )
return TRUE;
//#ifdef __WORLDSERVER
// if( m_vtInfo.TradeGetGold() != 0 )
// return FALSE;
//#endif // __WORLDSERVER
#ifdef __PERIN_BUY_BUG
__int64 i64Total = static_cast<__int64>( GetGold() ) + static_cast<__int64>( nGold );
if( i64Total > static_cast<__int64>( INT_MAX ) )
i64Total = static_cast<__int64>( INT_MAX );
else if( i64Total < 0 )
i64Total = 0;
SetGold( static_cast<int>( i64Total ) );
#else // __PERIN_BUY_BUG
int nTotal = GetGold() + nGold;
if( nGold > 0 )
{
if( nTotal < 0 ) // overflow?
nTotal = INT_MAX;
}
else // nGold < 0
{
if( nTotal < 0 ) // underflow?
{
//#ifdef __WORLDSERVER
// Error( "AddGold: nTotal < 0" );
//#endif // __WORLDSERVER
nTotal = 0;
// return FALSE;
}
}
SetGold( nTotal );
#endif // __PERIN_BUY_BUG
if( bSend )
{
#ifdef __WORLDSERVER
#ifdef __PERIN_BUY_BUG
g_UserMng.AddSetPointParam( this, DST_GOLD, static_cast<int>( i64Total ) );
#else // __PERIN_BUY_BUG
g_UserMng.AddSetPointParam( this, DST_GOLD, nTotal );
#endif // __PERIN_BUY_BUG
#endif // __WORLDSERVER
}
return TRUE;
}
:handsdown::handsdown::handsdown:Quote:
PHP Code:BOOL CMover::AddGold( int nGold, BOOL bSend )
{
if( nGold == 0 )
return TRUE;
//#ifdef __WORLDSERVER
// if( m_vtInfo.TradeGetGold() != 0 )
// return FALSE;
//#endif // __WORLDSERVER
#ifdef __PERIN_BUY_BUG
__int64 i64Total = static_cast<__int64>( GetGold() ) + static_cast<__int64>( nGold );
if( i64Total > static_cast<__int64>( INT_MAX ) )
i64Total = static_cast<__int64>( INT_MAX );
else if( i64Total < 0 )
i64Total = 0;
SetGold( static_cast<int>( i64Total ) );
#else // __PERIN_BUY_BUG
int nTotal = GetGold() + nGold;
if( nGold > 0 )
{
if( nTotal < 0 ) // overflow?
nTotal = INT_MAX;
}
else // nGold < 0
{
if( nTotal < 0 ) // underflow?
{
//#ifdef __WORLDSERVER
// Error( "AddGold: nTotal < 0" );
//#endif // __WORLDSERVER
nTotal = 0;
// return FALSE;
}
}
SetGold( nTotal );
#endif // __PERIN_BUY_BUG
if( bSend )
{
#ifdef __WORLDSERVER
#ifdef __PERIN_BUY_BUG
g_UserMng.AddSetPointParam( this, DST_GOLD, static_cast<int>( i64Total ) );
#else // __PERIN_BUY_BUG
g_UserMng.AddSetPointParam( this, DST_GOLD, nTotal );
#endif // __PERIN_BUY_BUG
#endif // __WORLDSERVER
}
return TRUE;
}