1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-26 14:37:44 +00:00

save a newly created house to the db correctly

This commit is contained in:
NotAdam 2018-12-23 21:00:00 +11:00
parent b124ae06b1
commit abb3771b86
2 changed files with 11 additions and 1 deletions

View file

@ -563,6 +563,8 @@ void Sapphire::World::Manager::HousingMgr::buildPresetEstate( Entity::Player& pl
if( !initHouseModels( player, pLand, presetItem ) )
return;
createHouse( house );
pLand->setState( HouseState::privateHouse );
pLand->setLandType( LandType::Private );
hZone->sendLandUpdate( plotNum );

View file

@ -142,9 +142,17 @@ namespace Sapphire::World::Manager
*/
bool initHouseModels( Entity::Player& player, LandPtr land, uint32_t presetCatalogId );
private:
/*!
* @brief Creates a house and saves the minimum amount required to persist a house through restarts.
*
* Any other changes will be covered by the usual saving logic and can be safely ignored here.
*
* @param house The house to create in the house table
*/
void createHouse( HousePtr house ) const;
private:
/*!
* @brief Gets the next available house id
* @return The next available house id