mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-27 22:57:45 +00:00
WiP Fix house inventory not working
This commit is contained in:
parent
8565ad1cd5
commit
a280f9c3b8
7 changed files with 22 additions and 27 deletions
|
@ -578,13 +578,13 @@ bool HousingMgr::initHouseModels( Entity::Player& player, LandPtr land, uint32_t
|
|||
auto itemMax = land->getInventoryItemMax();
|
||||
|
||||
// type, maxSize, tableName, isMultiStorage
|
||||
auto intContainer = make_ItemContainer( Common::InventoryType::HousingInteriorAppearance, itemMax.second, "houseiteminventory", true );
|
||||
auto extContainer = make_ItemContainer( Common::InventoryType::HousingExteriorAppearance, itemMax.first, "houseiteminventory", true );
|
||||
// auto intContainer = make_ItemContainer( Common::InventoryType::HousingInteriorAppearance, itemMax.second, "houseiteminventory", true );
|
||||
// auto extContainer = make_ItemContainer( Common::InventoryType::HousingExteriorAppearance, itemMax.first, "houseiteminventory", true );
|
||||
|
||||
// add containers to inv collection
|
||||
auto& houseInventory = getEstateInventory( house->getLandIdent() );
|
||||
houseInventory[ Common::InventoryType::HousingInteriorAppearance ] = intContainer;
|
||||
houseInventory[ Common::InventoryType::HousingExteriorAppearance ] = extContainer;
|
||||
houseInventory[ Common::InventoryType::HousingInteriorAppearance ];// = intContainer;
|
||||
houseInventory[ Common::InventoryType::HousingExteriorAppearance ];// = extContainer;
|
||||
|
||||
auto& exdData = Common::Service< Sapphire::Data::ExdData >::ref();
|
||||
auto preset = exdData.getRow< Excel::HousingPreset >( getItemAdditionalData( presetCatalogId ) );
|
||||
|
@ -728,7 +728,7 @@ void HousingMgr::buildPresetEstate( Entity::Player& player, HousingZone& zone, u
|
|||
player.setLandFlags( Common::LandFlagsSlot::Private, Common::HOUSING_LAND_STATUS::HOUSING_LAND_STATUS_BUILDHOUSE, ident );
|
||||
player.sendLandFlagsSlot( Common::LandFlagsSlot::Private );
|
||||
|
||||
//zone.registerEstateEntranceEObj( plotNum );
|
||||
zone.registerEstateEntranceEObj( plotNum );
|
||||
}
|
||||
|
||||
void HousingMgr::requestEstateRename( Entity::Player& player, const Common::LandIdent ident )
|
||||
|
|
|
@ -25,8 +25,7 @@ using namespace Sapphire;
|
|||
using namespace Sapphire::World::Manager;
|
||||
|
||||
TerritoryMgr::TerritoryMgr() :
|
||||
m_lastInstanceId( 10000 ),
|
||||
m_inRangeDistance( 0 )
|
||||
m_lastInstanceId( 10000 )
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -66,11 +65,6 @@ bool TerritoryMgr::init()
|
|||
return false;
|
||||
}
|
||||
|
||||
auto& server = Common::Service< World::WorldServer >::ref();
|
||||
auto& cfg = server.getConfig();
|
||||
|
||||
m_inRangeDistance = cfg.network.inRangeDistance;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -657,11 +651,6 @@ void TerritoryMgr::disableCurrentFestival()
|
|||
setCurrentFestival( 0 );
|
||||
}
|
||||
|
||||
float TerritoryMgr::getInRangeDistance() const
|
||||
{
|
||||
return m_inRangeDistance;
|
||||
}
|
||||
|
||||
void TerritoryMgr::createAndJoinQuestBattle( Entity::Player& player, uint16_t questBattleId )
|
||||
{
|
||||
auto qb = createQuestBattle( questBattleId );
|
||||
|
|
|
@ -155,8 +155,6 @@ namespace Sapphire::World::Manager
|
|||
*/
|
||||
const std::pair< uint16_t, uint16_t >& getCurrentFestival() const;
|
||||
|
||||
float getInRangeDistance() const;
|
||||
|
||||
private:
|
||||
using TerritoryTypeDetailCache = std::unordered_map< uint16_t, std::shared_ptr< Excel::ExcelStruct< Excel::TerritoryType > > >;
|
||||
using InstanceIdToTerritoryPtrMap = std::unordered_map< uint32_t, TerritoryPtr >;
|
||||
|
@ -201,9 +199,6 @@ namespace Sapphire::World::Manager
|
|||
/*! current festival(s) to set for public zones from festival.exd */
|
||||
std::pair< uint16_t, uint16_t > m_currentFestival;
|
||||
|
||||
/*! Max distance at which actors in range of a player are sent */
|
||||
float m_inRangeDistance;
|
||||
|
||||
/*! Map used to find a contentFinderConditionID to a questBattle */
|
||||
QuestBattleIdToContentFinderCondMap m_questBattleToContentFinderMap;
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ Sapphire::HousingZone::HousingZone( uint8_t wardNum, uint16_t territoryTypeId,
|
|||
m_wardNum( wardNum ),
|
||||
m_landSetId( ( static_cast< uint32_t >( territoryTypeId ) << 16 ) | wardNum )
|
||||
{
|
||||
|
||||
m_inRangeDistance = 3000;
|
||||
}
|
||||
|
||||
bool Sapphire::HousingZone::init()
|
||||
|
@ -298,8 +298,9 @@ Sapphire::Entity::EventObjectPtr Sapphire::HousingZone::registerEstateEntranceEO
|
|||
auto land = getLand( landId );
|
||||
assert( land );
|
||||
|
||||
auto eObj = Entity::make_EventObject( getNextEObjId(), 2002737, 0, 0, 4, land->getMapMarkerPosition(), 0.f, "entrance", 0 );
|
||||
auto eObj = Entity::make_EventObject( getNextEObjId(), 2002737, 0, 0, 4, FFXIVARR_POSITION3{ 0, 10, 0 }, 0.f, "entrance", 0 );
|
||||
eObj->setHousingLink( static_cast< uint32_t >( landId ) << 8 );
|
||||
eObj->setGimmickId( static_cast< uint32_t >( landId ) << 8 );
|
||||
eObj->setScale( 1.f );
|
||||
|
||||
addEObj( eObj );
|
||||
|
|
|
@ -76,7 +76,7 @@ namespace Sapphire
|
|||
*/
|
||||
using YardObjectArrayBoundsArray = std::array< YardObjectArrayBoundsPair, 60 >;
|
||||
|
||||
const uint32_t m_landSetMax = 18;
|
||||
const uint32_t m_landSetMax = 12;
|
||||
LandPtrMap m_landPtrMap;
|
||||
uint8_t m_wardNum;
|
||||
uint32_t m_landSetId;
|
||||
|
|
|
@ -69,7 +69,8 @@ Territory::Territory( uint16_t territoryTypeId, uint32_t guId, const std::string
|
|||
m_nextEObjId( START_EOBJ_ID ),
|
||||
m_nextActorId( START_GAMEOBJECT_ID ),
|
||||
m_lastUpdate( 0 ),
|
||||
m_lastActivityTime( Common::Util::getTimeMs() )
|
||||
m_lastActivityTime( Common::Util::getTimeMs() ),
|
||||
m_inRangeDistance( 80.f )
|
||||
{
|
||||
auto& exdData = Common::Service< Data::ExdData >::ref();
|
||||
auto& teriMgr = Common::Service< TerritoryMgr >::ref();
|
||||
|
@ -656,6 +657,11 @@ void Territory::updateActorPosition( Entity::GameObject& actor )
|
|||
}
|
||||
}
|
||||
|
||||
float Territory::getInRangeDistance()
|
||||
{
|
||||
return m_inRangeDistance;
|
||||
}
|
||||
|
||||
|
||||
void Territory::updateInRangeSet( Entity::GameObjectPtr pActor, CellPtr pCell )
|
||||
{
|
||||
|
@ -669,7 +675,7 @@ void Territory::updateInRangeSet( Entity::GameObjectPtr pActor, CellPtr pCell )
|
|||
|
||||
auto iter = pCell->m_actors.begin();
|
||||
|
||||
float fRange = teriMgr.getInRangeDistance();
|
||||
float fRange = getInRangeDistance();
|
||||
int32_t count = 0;
|
||||
while( iter != pCell->m_actors.end() )
|
||||
{
|
||||
|
|
|
@ -76,6 +76,8 @@ namespace Sapphire
|
|||
|
||||
Common::TerritoryIdent m_ident;
|
||||
|
||||
float m_inRangeDistance;
|
||||
|
||||
public:
|
||||
Territory();
|
||||
|
||||
|
@ -123,6 +125,8 @@ namespace Sapphire
|
|||
virtual void onEventHandlerOrder( Entity::Player& player, uint32_t arg0, uint32_t arg1, uint32_t arg2,
|
||||
uint32_t arg3, uint32_t arg4 );
|
||||
|
||||
virtual float getInRangeDistance();
|
||||
|
||||
Common::Weather getNextWeather();
|
||||
|
||||
void pushActor( const Entity::GameObjectPtr& pActor );
|
||||
|
|
Loading…
Add table
Reference in a new issue