mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-05-25 11:07:45 +00:00
housing fixes. it's working now!
This commit is contained in:
parent
3e5d0a47f0
commit
44b071ea3e
5 changed files with 35 additions and 14 deletions
|
@ -92,7 +92,10 @@ Sapphire::ItemPtr Sapphire::ItemContainer::getItem( uint8_t slotId )
|
|||
void Sapphire::ItemContainer::setItem( uint8_t slotId, ItemPtr pItem )
|
||||
{
|
||||
if( slotId > m_size )
|
||||
{
|
||||
Logger::error( "Slot out of range {0}", slotId );
|
||||
return;
|
||||
}
|
||||
|
||||
m_itemMap[ slotId ] = pItem;
|
||||
}
|
||||
|
|
|
@ -704,10 +704,12 @@ void Sapphire::World::Manager::HousingMgr::buildPresetEstate( Entity::Player& pl
|
|||
|
||||
pLand->updateLandDb();
|
||||
|
||||
// start house built event
|
||||
// start house built event - disabled because it fucks your audio device
|
||||
// CmnDefHousingBuildHouse_00149
|
||||
player.eventStart( player.getId(), 0x000B0095, Event::EventHandler::EventType::Housing, 1, 1 );
|
||||
player.playScene( 0x000B0095, 0, static_cast< uint32_t >( SET_BASE | HIDE_HOTBAR ) , 0, 1, plotNum, nullptr );
|
||||
//player.eventStart( player.getId(), 0x000B0095, Event::EventHandler::EventType::Housing, 1, 1 );
|
||||
//player.playScene( 0x000B0095, 0, static_cast< uint32_t >( SET_BASE | HIDE_HOTBAR ) , 0, 1, plotNum, nullptr );
|
||||
// instead we do a fake zone to unlock the client
|
||||
Common::Service< TerritoryMgr >::ref().movePlayer( player.getCurrentTerritory(), player.getAsPlayer() );
|
||||
|
||||
player.setLandFlags( LandFlagsSlot::Private, EstateBuilt, ident );
|
||||
player.sendLandFlagsSlot( LandFlagsSlot::Private );
|
||||
|
|
|
@ -143,15 +143,15 @@ void Sapphire::World::Manager::InventoryMgr::updateHousingItemPosition( Sapphire
|
|||
|
||||
stmt->setUInt64( 1, item->getUId() );
|
||||
|
||||
stmt->setUInt( 2, pos.x );
|
||||
stmt->setUInt( 3, pos.y );
|
||||
stmt->setUInt( 4, pos.z );
|
||||
stmt->setInt( 5, rot );
|
||||
stmt->setDouble( 2, static_cast< double >( pos.x ) );
|
||||
stmt->setDouble( 3, static_cast< double >( pos.y ) );
|
||||
stmt->setDouble( 4, static_cast< double >( pos.z ) );
|
||||
stmt->setDouble( 5, static_cast< double >( rot ) );
|
||||
|
||||
stmt->setUInt( 6, pos.x );
|
||||
stmt->setUInt( 7, pos.y );
|
||||
stmt->setUInt( 8, pos.z );
|
||||
stmt->setInt( 9, rot );
|
||||
stmt->setDouble( 6, static_cast< double >( pos.x ) );
|
||||
stmt->setDouble( 7, static_cast< double >( pos.y ) );
|
||||
stmt->setDouble( 8, static_cast< double >( pos.z ) );
|
||||
stmt->setDouble( 9, static_cast< double >( rot ) );
|
||||
|
||||
db.execute( stmt );
|
||||
}
|
||||
|
|
|
@ -240,5 +240,21 @@ void Sapphire::Land::update( uint64_t tickCount )
|
|||
|
||||
Sapphire::Land::InvMaxItemsPair Sapphire::Land::getInventoryItemMax() const
|
||||
{
|
||||
return std::make_pair( m_maxPlacedExternalItems, m_maxPlacedInternalItems );
|
||||
//return std::make_pair( m_maxPlacedExternalItems, m_maxPlacedInternalItems );
|
||||
switch( m_size )
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
return std::make_pair( 20, 200 );
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
return std::make_pair( 30, 300 );
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
return std::make_pair( 40, 400 );
|
||||
}
|
||||
}
|
||||
assert( false );
|
||||
}
|
||||
|
|
|
@ -87,8 +87,8 @@ namespace Sapphire
|
|||
Sapphire::HousePtr m_pHouse;
|
||||
|
||||
//item storage
|
||||
uint16_t m_maxPlacedExternalItems;
|
||||
uint16_t m_maxPlacedInternalItems;
|
||||
//uint16_t m_maxPlacedExternalItems;
|
||||
//uint16_t m_maxPlacedInternalItems;
|
||||
|
||||
//price
|
||||
uint32_t m_initPrice;
|
||||
|
|
Loading…
Add table
Reference in a new issue