From d6118e9d80c79cf07d66cbcda4a57266d2beeecc Mon Sep 17 00:00:00 2001 From: AriAvery <41122212+AriAvery@users.noreply.github.com> Date: Fri, 9 Nov 2018 10:00:36 +0100 Subject: [PATCH] :/ --- src/common/Exd/ExdDataGenerated.cpp | 2 +- src/servers/sapphire_zone/Zone/Land.cpp | 24 +++++++++--------------- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/src/common/Exd/ExdDataGenerated.cpp b/src/common/Exd/ExdDataGenerated.cpp index 83cd85e0..aafcb458 100644 --- a/src/common/Exd/ExdDataGenerated.cpp +++ b/src/common/Exd/ExdDataGenerated.cpp @@ -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 ) ); diff --git a/src/servers/sapphire_zone/Zone/Land.cpp b/src/servers/sapphire_zone/Zone/Land.cpp index 97d4b3b2..ac6c9e76 100644 --- a/src/servers/sapphire_zone/Zone/Land.cpp +++ b/src/servers/sapphire_zone/Zone/Land.cpp @@ -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(); } } \ No newline at end of file