diff --git a/src/common/Common.h b/src/common/Common.h index f986821a..77d29367 100644 --- a/src/common/Common.h +++ b/src/common/Common.h @@ -869,10 +869,10 @@ namespace Sapphire::Common enum HouseStatus : uint8_t { none, - HouseForSale, - HouseSold, - HousePrivateEstate, - HouseFreeCompanyEstate, + ForSale, + Sold, + PrivateEstate, + FreeCompanyEstate, }; enum HouseIconAdd : uint8_t diff --git a/src/world/Manager/HousingMgr.cpp b/src/world/Manager/HousingMgr.cpp index fd4ab7ef..8e0c01a6 100644 --- a/src/world/Manager/HousingMgr.cpp +++ b/src/world/Manager/HousingMgr.cpp @@ -365,7 +365,7 @@ Sapphire::LandPurchaseResult Sapphire::World::Manager::HousingMgr::purchaseLand( if( !pLand ) return LandPurchaseResult::ERR_INTERNAL; - if( pLand->getStatus() != HouseStatus::HouseForSale ) + if( pLand->getStatus() != HouseStatus::ForSale ) return LandPurchaseResult::ERR_NOT_AVAILABLE; if( gilAvailable < plotPrice ) @@ -388,7 +388,7 @@ Sapphire::LandPurchaseResult Sapphire::World::Manager::HousingMgr::purchaseLand( player.removeCurrency( CurrencyType::Gil, plotPrice ); pLand->setOwnerId( player.getId() ); - pLand->setStatus( HouseStatus::HouseSold ); + pLand->setStatus( HouseStatus::Sold ); pLand->setLandType( Common::LandType::Private ); player.setLandFlags( LandFlagsSlot::Private, 0x00, pLand->getLandIdent() ); @@ -437,7 +437,7 @@ bool Sapphire::World::Manager::HousingMgr::relinquishLand( Entity::Player& playe pLand->setCurrentPrice( pLand->getMaxPrice() ); pLand->setOwnerId( 0 ); - pLand->setStatus( HouseStatus::HouseForSale ); + pLand->setStatus( HouseStatus::ForSale ); pLand->setLandType( Common::LandType::none ); pLand->updateLandDb(); @@ -477,11 +477,11 @@ void Sapphire::World::Manager::HousingMgr::sendWardLandInfo( Entity::Player& pla auto& entry = wardInfoPacket->data().houseInfoEntry[ i ]; - // retail always sends the house price in this packet, even after the house has been HouseSold + // retail always sends the house price in this packet, even after the house has been Sold // so I guess we do the same entry.housePrice = land->getCurrentPrice(); - if( land->getStatus() == Common::HouseStatus::HouseForSale ) + if( land->getStatus() == Common::HouseStatus::ForSale ) continue; if( auto house = land->getHouse() ) @@ -682,7 +682,7 @@ void Sapphire::World::Manager::HousingMgr::buildPresetEstate( Entity::Player& pl createHouse( house ); - pLand->setStatus( HouseStatus::HousePrivateEstate ); + pLand->setStatus( HouseStatus::PrivateEstate ); pLand->setLandType( LandType::Private ); hZone->sendLandUpdate( plotNum ); diff --git a/src/world/Territory/Housing/HousingInteriorTerritory.cpp b/src/world/Territory/Housing/HousingInteriorTerritory.cpp index 63fb581e..6bef748b 100644 --- a/src/world/Territory/Housing/HousingInteriorTerritory.cpp +++ b/src/world/Territory/Housing/HousingInteriorTerritory.cpp @@ -76,14 +76,19 @@ void Sapphire::World::Territory::Housing::HousingInteriorTerritory::onPlayerZone player.queuePacket( indoorInitPacket ); + bool isFcHouse = pLand->getStatus() == Common::HouseStatus::PrivateEstate; auto yardPacketTotal = static_cast< uint8_t >( 2 + pLand->getSize() ); for( uint8_t yardPacketNum = 0; yardPacketNum < yardPacketTotal; yardPacketNum++ ) { auto objectInitPacket = makeZonePacket< Server::FFXIVIpcHousingObjectInitialize >( player.getId() ); memcpy( &objectInitPacket->data().landIdent, &m_landIdent, sizeof( Common::LandIdent ) ); - // todo: change this when FC houses become a thing - objectInitPacket->data().u1 = 2; // 2 = actrl 0x400 will hide the fc door, otherwise it will stay there + + if( isFcHouse ) + objectInitPacket->data().u1 = 2; // 2 = actrl 0x400 will hide the fc door, otherwise it will stay there + else + objectInitPacket->data().u1 = 0; + objectInitPacket->data().u2 = 100; objectInitPacket->data().packetNum = yardPacketNum; objectInitPacket->data().packetTotal = yardPacketTotal; @@ -94,8 +99,8 @@ void Sapphire::World::Territory::Housing::HousingInteriorTerritory::onPlayerZone player.queuePacket( objectInitPacket ); } - // todo: if in fc house, don't send this - player.queuePacket( Server::makeActorControl143( player.getId(), Network::ActorControl::HideAdditionalChambersDoor ) ); + if( isFcHouse ) + player.queuePacket( Server::makeActorControl143( player.getId(), Network::ActorControl::HideAdditionalChambersDoor ) ); } void Sapphire::World::Territory::Housing::HousingInteriorTerritory::onUpdate( uint32_t currTime ) diff --git a/src/world/Territory/Land.cpp b/src/world/Territory/Land.cpp index 28e63e8a..15411d24 100644 --- a/src/world/Territory/Land.cpp +++ b/src/world/Territory/Land.cpp @@ -227,7 +227,7 @@ void Sapphire::Land::updateLandDb() void Sapphire::Land::update( uint32_t currTime ) { - if( getStatus() == HouseStatus::HouseForSale ) + if( getStatus() == HouseStatus::ForSale ) { if( m_nextDrop < currTime && m_minPrice < m_currentPrice ) {