From b5b49f4d8c752cc6ed8d664c7230f78467e75ba6 Mon Sep 17 00:00:00 2001 From: NotAdam Date: Sat, 29 Dec 2018 19:38:29 +1100 Subject: [PATCH] store aetheryte status in house object --- src/world/Manager/HousingMgr.cpp | 1 + src/world/Manager/HousingMgr.h | 2 ++ src/world/Territory/House.cpp | 12 +++++++++++- src/world/Territory/House.h | 4 ++++ src/world/Territory/Land.cpp | 7 ------- src/world/Territory/Land.h | 1 - 6 files changed, 18 insertions(+), 9 deletions(-) diff --git a/src/world/Manager/HousingMgr.cpp b/src/world/Manager/HousingMgr.cpp index c3aa2369..b14ac88b 100644 --- a/src/world/Manager/HousingMgr.cpp +++ b/src/world/Manager/HousingMgr.cpp @@ -193,6 +193,7 @@ void Sapphire::World::Manager::HousingMgr::initLandCache() entry.m_estateName = res->getString( "HouseName" ); entry.m_buildTime = res->getUInt64( "BuildTime" ); entry.m_endorsements = res->getUInt64( "Endorsements" ); + entry.m_hasAetheryte = res->getBoolean( "Aetheryte" ); m_landCache[ entry.m_landSetId ].push_back( entry ); diff --git a/src/world/Manager/HousingMgr.h b/src/world/Manager/HousingMgr.h index 4e1079a7..9dd0bd23 100644 --- a/src/world/Manager/HousingMgr.h +++ b/src/world/Manager/HousingMgr.h @@ -46,6 +46,8 @@ namespace Sapphire::World::Manager std::string m_estateComment; std::string m_estateName; + bool m_hasAetheryte; + uint64_t m_buildTime; uint64_t m_endorsements; diff --git a/src/world/Territory/House.cpp b/src/world/Territory/House.cpp index b3c95ff8..396e763e 100644 --- a/src/world/Territory/House.cpp +++ b/src/world/Territory/House.cpp @@ -32,7 +32,7 @@ void Sapphire::House::updateHouseDb() stmt->setUInt( 6, m_houseId ); stmt->setInt64( 1, m_buildTime ); - stmt->setInt( 2, 0 ); + stmt->setBool( 2, m_hasAetheryte ); stmt->setString( 3, m_estateComment ); stmt->setString( 4, m_estateName ); @@ -104,4 +104,14 @@ void Sapphire::House::setInteriorModel( Sapphire::Common::HousingInteriorSlot sl uint32_t Sapphire::House::getInteriorModel( Sapphire::Common::HousingInteriorSlot slot ) { return m_interiorModelCache[ slot ]; +} + +bool Sapphire::House::getHasAetheryte() const +{ + return m_hasAetheryte; +} + +void Sapphire::House::setHasAetheryte( bool hasAetheryte ) +{ + m_hasAetheryte = hasAetheryte; } \ No newline at end of file diff --git a/src/world/Territory/House.h b/src/world/Territory/House.h index f0dab0a8..3229e0e0 100644 --- a/src/world/Territory/House.h +++ b/src/world/Territory/House.h @@ -41,12 +41,16 @@ namespace Sapphire void updateHouseDb(); + void setHasAetheryte( bool hasAetheryte ); + bool getHasAetheryte() const; + private: uint32_t m_landSetId; Common::LandIdent m_landIdent; uint32_t m_houseId; uint64_t m_buildTime; + bool m_hasAetheryte; HouseModelsArray m_exteriorModelCache; uint32_t m_interiorModelCache[10]; diff --git a/src/world/Territory/Land.cpp b/src/world/Territory/Land.cpp index 7500aee4..432b473b 100644 --- a/src/world/Territory/Land.cpp +++ b/src/world/Territory/Land.cpp @@ -73,13 +73,6 @@ void Sapphire::Land::init( Common::LandType type, uint8_t size, uint8_t state, u } } -uint32_t Sapphire::Land::convertItemIdToHousingItemId( uint32_t itemId ) -{ - auto pExdData = m_pFw->get< Data::ExdDataGenerated >(); - auto info = pExdData->get< Sapphire::Data::Item >( itemId ); - return info->additionalData; -} - uint32_t Sapphire::Land::getCurrentPrice() const { return m_currentPrice; diff --git a/src/world/Territory/Land.h b/src/world/Territory/Land.h index eff9a954..f6af5f2a 100644 --- a/src/world/Territory/Land.h +++ b/src/world/Territory/Land.h @@ -66,7 +66,6 @@ namespace Sapphire InvMaxItemsPair getInventoryItemMax() const; private: - uint32_t convertItemIdToHousingItemId( uint32_t itemId ); uint32_t getNextHouseId(); Common::LandIdent m_landIdent;