From e7bc21a1f27d1d360ca232be74954baa6307d457 Mon Sep 17 00:00:00 2001 From: Mordred Date: Wed, 25 Jan 2023 17:11:23 +0100 Subject: [PATCH] WiP Fix houses not being loaded after restart --- src/world/Manager/HousingMgr.cpp | 8 ++++---- src/world/Territory/HousingZone.cpp | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/world/Manager/HousingMgr.cpp b/src/world/Manager/HousingMgr.cpp index db44c1a7..37ebddf9 100644 --- a/src/world/Manager/HousingMgr.cpp +++ b/src/world/Manager/HousingMgr.cpp @@ -80,8 +80,8 @@ bool HousingMgr::init() Logger::info( "HousingMgr: Caching housing land init data" ); //LAND_SEL_ALL - // 18 wards per territory, 4 territories - m_landCache.reserve( 18 * 4 ); + // 12 wards per territory, 2 territories + m_landCache.reserve( 12 * 2 ); initLandCache(); @@ -115,7 +115,7 @@ bool HousingMgr::loadEstateInventories() { Logger::info( "HousingMgr: Loading inventories for estates" ); -/* auto& db = Common::Service< Db::DbWorkerPool< Db::ZoneDbConnection > >::ref(); + auto& db = Common::Service< Db::DbWorkerPool< Db::ZoneDbConnection > >::ref(); auto stmt = db.getPreparedStatement( Db::LAND_INV_SEL_ALL ); auto res = db.query( stmt ); @@ -166,7 +166,7 @@ bool HousingMgr::loadEstateInventories() itemCount++; } - Logger::debug( "HousingMgr: Loaded {0} inventory items", itemCount );*/ + Logger::debug( "HousingMgr: Loaded {0} inventory items", itemCount ); return true; } diff --git a/src/world/Territory/HousingZone.cpp b/src/world/Territory/HousingZone.cpp index d51fbb54..0c2f466b 100644 --- a/src/world/Territory/HousingZone.cpp +++ b/src/world/Territory/HousingZone.cpp @@ -138,8 +138,8 @@ bool Sapphire::HousingZone::init() m_landPtrMap[ entry.m_landId ] = land; // TODO: Fixme - // if( entry.m_houseId > 0 ) - // registerEstateEntranceEObj( entry.m_landId ); + if( entry.m_houseId > 0 ) + registerEstateEntranceEObj( entry.m_landId ); updateYardObjects( land->getLandIdent() ); }