1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-22 20:57:46 +00:00
This commit is contained in:
AriAvery 2018-11-09 10:00:36 +01:00
parent 9cc2cd633f
commit d6118e9d80
2 changed files with 10 additions and 16 deletions

View file

@ -2746,7 +2746,7 @@ Core::Data::HousingLandSet::HousingLandSet( uint32_t row_id, Core::Data::ExdData
for ( int i = 0; i < 60; i++ )
sizes.push_back( exdData->getField< uint8_t >( row, i ) );
for ( int i = 60; i < 60 + 60; i++ )
minPrices.push_back( exdData->getField< uint8_t >( row, i ) );
minPrices.push_back( exdData->getField< uint32_t >( row, i ) );
for ( int i = 300; i < 300 + 60; i++ )
prices.push_back( exdData->getField< uint32_t >( row, i ) );

View file

@ -275,23 +275,17 @@ void Core::Land::Update( uint32_t currTime )
{
if( getState() == HouseState::forSale )
{
if( m_nextDrop < currTime )
if( m_nextDrop < currTime && m_minPrice < m_currentPrice )
{
m_nextDrop = currTime + 21600; // +6 hours
if( m_currentPrice == 0 )
{
m_currentPrice = m_initPrice;
}
else if( m_minPrice < m_currentPrice )
{
m_currentPrice = ( m_currentPrice / 100 ) * 99.58;
m_devaluationTime = m_nextDrop - currTime;
}
else
{
m_devaluationTime = 0;
}
m_nextDrop = currTime + 21600;
m_currentPrice = ( m_currentPrice / 100 ) * 99.58;
}
else if( m_currentPrice == 0 )
{
m_nextDrop = currTime + 21600;
m_currentPrice = m_initPrice;
}
m_devaluationTime = m_nextDrop - currTime;
UpdateDatabase();
}
}